Create API Token
Returns a new API token belonging to a user.
The token can be minted at three levels of restriction, in increasing order of narrowness:
- Organization-scoped — pass organization. The token can only act on resources inside that organization.
- Group-scoped — pass organization, group, and scopes. The token is pinned to a single group inside the organization and only the operations listed in scopes are allowed. The caller must be an admin or owner of the organization.
- Unrestricted (deprecated) — no request body. The token can act on every organization the caller belongs to. Unrestricted tokens are deprecated and will be removed in a future release. Always pass organization for new tokens and rotate existing unrestricted tokens to scoped tokens.
Group-scoped tokens are designed for automations that should be able to provision and manage databases inside a single group without being able to touch the rest of the organization.
post/v1/auth/api-tokens/{tokenName}
Path parameters
tokenNamestring required
The name of the api token.
Request body
Example request
{
"organization": "my-org",
"group": "default",
"scopes": [
"db:create",
"db:configure",
"db:mint-token"
]
}Response
Successful response