Create credentials

Field Description
id public key, account id
password UTF-8 string (8-64 symbols)

Request:

  • PUT /credentials
    {
      "data": {
          "type": "credentials",
          "id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3",
          "attributes": {
              "password": "testtest"
          }
      }
    }
    

Responses:

  • 201 Created
    {
      "data": {
          "type": "credentials",
          "id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3"
      }
    }
    
  • 409 Credentials for such account id already exist

Issue JWT

Field Description
account_id public key
email email address
platform_id public key, id of the platform that hosts an account
password UTF-8 string (8-64 symbols)

You can authorize using account_id or email+platform_id

Request:

  • POST /jwt
    {
      "data": {
          "attributes": {
              "account_id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3",
              "email": "test@test.net",
              "platform_id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3",
              "password": "testtest"
          }
      }
    }
    

Responses:

  • 201 Created
    {
      "data": {
          "type": "jwt",
          "attributes": {
              "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiR0JVUFpDTVZTWU8yQlBNQ0ZJQkFKTFlXVktKU1BaNDJYU1RNRVkyVFdGUVBZUzc2SFpDNFNCQUoiLCJhY2NvdW50X3R5cGUiOjQsInBsYXRmb3JtX2lkIjoiR0FOUUtDQ05SUERSTzZNREFSTFdKRlZRS082SllYR0JHNkNDMlVLUFVVNU03QzVUUFg0RDJFTjMiLCJlbWFpbCI6ImRhcmtzb21lQHVrci5uZXQiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInBob25lX251bWJlciI6IiszODA2MzE5MzYzMzEiLCJwaG9uZV92ZXJpZmllZCI6ZmFsc2UsImV4cCI6MTU0NjEwMTQ4OX0.W5X7p4_KZL5LMIoAzIZhQzrWos87cd6hDmJSveXAta-RVIYiNBc7p8jaF-XAmTvJBsWfyZS_NqW872NwdphRaA"
          }
      }
    }
    
  • 400 Neither account_id or email+platform_id should be set
  • 401 Invalid account_id/email or password

Refresh JWT

requires a valid jwt in the header

Request:

  • PATCH /jwt

Responses:

  • 201 Created
    {
      "data": {
          "type": "jwt",
          "attributes": {
              "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiR0JVUFpDTVZTWU8yQlBNQ0ZJQkFKTFlXVktKU1BaNDJYU1RNRVkyVFdGUVBZUzc2SFpDNFNCQUoiLCJhY2NvdW50X3R5cGUiOjQsInBsYXRmb3JtX2lkIjoiR0FOUUtDQ05SUERSTzZNREFSTFdKRlZRS082SllYR0JHNkNDMlVLUFVVNU03QzVUUFg0RDJFTjMiLCJlbWFpbCI6ImRhcmtzb21lQHVrci5uZXQiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInBob25lX251bWJlciI6IiszODA2MzE5MzYzMzEiLCJwaG9uZV92ZXJpZmllZCI6ZmFsc2UsImV4cCI6MTU0NjEwMTQ4OX0.W5X7p4_KZL5LMIoAzIZhQzrWos87cd6hDmJSveXAta-RVIYiNBc7p8jaF-XAmTvJBsWfyZS_NqW872NwdphRaA"
          }
      }
    }
    
  • 403 No jwt provided
  • 404 No account with account_id provided in jwt

Change password

requires a valid jwt in the header

Field Description
old_password UTF-8 string (8-64 symbols)
new_password UTF-8 string (8-64 symbols)

Request:

  • PATCH /credentials
    {
      "data": {
          "attributes": {
              "old_password": "testtest",
              "new_password": "12345678"
          }
      }
    }
    

Responses:

  • 200 OK
  • 401 Wrong old password
  • 403 No jwt provided
  • 404 Cant find user with provided account id in jwt

Request recovery

Field Description
id public key, account id
email email address
platform_id public key, platform of the account

You can use either id or email+platform_id

Request:

  • PUT /recovery_requests
    {
      "data": {
          "type": "recovery_requests",
          "id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3",
          "attributes": {
              "email": "test@test.net",
              "platform_id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3"
          }
      }
    }
    

Responses:

  • 204 No Content
  • 400 Email is not verified

Approve recovery request

Field Description
id public key, account id
token 20 symbols string
new_password UTF-8 string (8-64 symbols)

Request:

  • PATCH /recovery_requests
    {
      "data": {
          "type": "recovery_requests",
          "id": "GANQKCCNRPDRO6MDARLWJFVQKO6JYXGBG6CC2UKPUU5M7C5TPX4D2EN3",
          "attributes": {
              "token": "HTuRPYnOLBjbiOesdmeN",
              "new_password": "qwerty"
          }
      }
    }
    

Responses:

  • 204 No Content
  • 403 Invalid recovery token
  • 404 Recovery request or credential not found

results matching ""

    No results matching ""