My account

Create a personal access token

Changed on

Create a personal access token for the signed-in user. A logto-verification-id in header and the personal-access-tokens scope are required. The token secret value is returned only in this response. The expiration time is required, must be in the future, and must be at most 365 days from now. A user can have at most 20 unexpired personal access tokens.

post/api/my-account/personal-access-tokens

Request

  • Base URL: https://[tenant_id].logto.app
  • URL: https://[tenant_id].logto.app/api/my-account/personal-access-tokens
  • Auth: OAuth 2 (client credentials, token URL /oidc/token, scopes: all)

Request body

namestring required

The name of the token. It must be unique among the user's personal access tokens.

expiresAtnumber required

The epoch time in milliseconds when the token expires. It must be in the future and at most 365 days from now.

Response

The personal access token was created successfully. The response includes the token secret value, which cannot be retrieved again.

namestring required
createdAtnumber required
expiresAtnumber nullable required
valuestring required

Changes