Skip to main content

Create personal access token

POST 

/personal-access-tokens

This creates a personal access token. expirationDate and userAwareTokenNeverExpires Relationship: Important: When expirationDate is null or empty (not included in the request body), the token will never expire. Required Validation: If expirationDate is null or empty, userAwareTokenNeverExpires must be set to true. This is a required validation rule. The valid values for expirationDate depend on the value provided for userAwareTokenNeverExpires:

  • When userAwareTokenNeverExpires is true (or required to be true): expirationDate can be null or omitted from the request body. When expirationDate is null or empty, the token will never expire. This creates a PAT that never expires and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * When userAwareTokenNeverExpires is false or omitted: expirationDate must be provided and must be a valid date-time string representing a future date (there is no upper limit). expirationDate cannot be null in this case. In this scenario, userAwareTokenNeverExpires can be omitted. Validation Rules: * If expirationDate is null or not included in the request body: userAwareTokenNeverExpires must be set to true (required). The token will never expire. * If expirationDate is provided and is not null: userAwareTokenNeverExpires can be omitted. Security Considerations: The userAwareTokenNeverExpires field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to true indicates that the user understands the increased security risks and has made an informed decision to proceed. Note: The userAwareTokenNeverExpires field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment.

Request

Responses

Created. Note - this is the only time Personal Access Tokens' secret attribute will be displayed.