Create an access token for a user
POST/v1/users/:username/tokens
Creates an access token for a service account or for your own user account. Requires an Admin token when creating service account tokens.
note
- Token creation scope: Through the API, you can create tokens for:
- Your own user account
- Service accounts within your organization
- Admins cannot create tokens for other user accounts through the API
- For service account token creation, use an Admin token for authentication. The token generated by this call is the service account's own token for its operations.
- For guidance on service account token creation and best practices, see Create and configure service accounts.
- If a service account is created through the admin API, connect to that service account with a read/write token before using read scaling tokens.
- Each token is tied to a specific account. Use the exact
usernamefor the user account or service account in the path/v1/users/:username/tokens. - The response returns the token secret once. Store it before closing the response.
- If the optional
ttlparameter is not specified, the access token remains valid until revoked by an administrator.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Successful response
Bad Request
Invalid Credentials
Unauthorized
Not Found
Internal Error