Personal Access Token

Generate a new personal access token

This endpoint allows clients to generate a new personal access token for a specific user and tenant.

Request
Request Body schema: application/json
required
name
required
string

name for the token.

description
required
string

description for the token.

expiry_at
required
integer

exipy date for token.

Responses
200

Token successfully generated

400

Bad request

401

Unauthorized

post/authn2/v0/personal-access-token/
Request samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "expiry_at": 0
}
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "description": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "token": "string",
  • "prefix": "string",
  • "expiry_at": 0
}

Get tokens for corresponding user and tenant

Get all tokens associated with the given user and tenant.

Responses
200

OK

400

Bad request

401

Unauthorized

get/authn2/v0/personal-access-token/
Request samples
Response samples
application/json
{
  • "count": 0,
  • "personal_access_tokens": [
    ]
}

Renew personal access token

Renew token associated with the given token_id.

Request
path Parameters
personal_access_token_id
required
string <uuid>

Personal Access Token Id

Request Body schema: application/json
required
expiry_at
required
integer

exipy date for token.

Responses
200

OK

400

Bad request

401

Unauthorized

put/authn2/v0/personal-access-token/{personal_access_token_id}
Request samples
application/json
{
  • "expiry_at": 0
}
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "description": "string",
  • "created_at": "string",
  • "updated_at": "string",
  • "token": "string",
  • "prefix": "string",
  • "expiry_at": 0,
  • "legacy_token_id": 0,
  • "legacy_developer_app_id": "string"
}

Delete personal access token

Delete token.

Request
path Parameters
personal_access_token_id
required
string <uuid>

Personal Access Token Id

Responses
204

OK

400

Bad request

401

Unauthorized

delete/authn2/v0/personal-access-token/{personal_access_token_id}
Request samples
Response samples
application/json
{
  • "status": 0,
  • "code": 0,
  • "error": "string",
  • "errors": [
    ],
  • "message": "string"
}