Skip to main content

Tokens API

The Tokens API allows you to retrieve CLI tokens for your user profile and app environments. These are sensitive operations that require appropriate permissions.

Make sure to read the Get Started document to understand how the API works.

Get User Token

Retrieves the decoded CLI token for the authenticated user. This is the token used for CLI authentication and API access.

Endpoint: GET /api/public/v1/user/token

Permissions:

  • Requires user authentication
  • For MCP requests: requires the quave:read:secrets scope

Example Request

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/user/token'

Example Response

{
"token": "your-decoded-cli-token-value",
"username": "johndoe",
"email": "john@example.com",
"cliTokenGeneratedAt": "2025-01-15T10:30:00.000Z"
}

Response Fields

FieldTypeDescription
tokenStringThe decoded CLI token value.
usernameStringThe username of the authenticated user.
emailStringThe email of the authenticated user.
cliTokenGeneratedAtDateWhen the token was generated.

Get App Environment Token

Retrieves the decoded CLI token for a specific app environment. Requires admin permission on the account that owns the environment.

Endpoint: GET /api/public/v1/app-env/token

Permissions:

  • Requires admin permission on the account
  • For MCP requests: requires the quave:read:secrets scope

Query Parameters

ParameterTypeRequiredDescription
appEnvIdStringEitherThe ID of the app environment.
envNameStringEitherThe CLI environment name (alternative to appEnvId).

Example Request

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/app-env/token?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7b'

Example Response

{
"token": "decoded-app-env-cli-token-value",
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"cliEnvName": "production",
"name": "Production",
"cliTokenGeneratedAt": "2025-01-15T10:30:00.000Z"
}

Response Fields

FieldTypeDescription
tokenStringThe decoded CLI token value for the environment.
appEnvIdStringThe app environment ID.
cliEnvNameStringThe CLI environment name.
nameStringThe display name of the environment.
cliTokenGeneratedAtDateWhen the token was generated.