# Add personal access token **POST /api/users/{userId}/personal-access-tokens** Add a new personal access token for the user. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters ### Path parameters - **userId** (string) The unique identifier of the user. ### Body: application/json (object) - **name** (string) The personal access token name. Must be unique within the user. - **expiresAt** (number | null) The epoch time in milliseconds when the token will expire. If not provided, the token will never expire. ## Responses ### 201 The personal access token was added successfully. #### Body: application/json (object) - **tenantId** (string) - **userId** (string) - **name** (string) - **value** (string) - **createdAt** (number) - **expiresAt** (number | null) ### 400 Bad Request ### 401 Unauthorized ### 403 Forbidden ### 422 The personal access token name is already in use. [Powered by Bump.sh](https://bump.sh)