Sign Up

Auth

Exchange a sign-in token

POST
/auth/token

Returns a project-scoped token for daytona:api or an organization-scoped token for daytona:analytics.

Authorization

oidc_jwt
headerAuthorizationBearer <token>

Bearer access token for a signed-in user, accepted by token exchange.

Request Body

Token exchange request. audience, org_id, and project_id may each appear at most once.

  1. body

A token exchange request accepted as JSON or form data.

audience?|

Target audience. Omit it, or send daytona:api, for a project-scoped token; send daytona:analytics for an organization-scoped token. Any other value is refused; the parameter may not be repeated.

grant_type*string

Must be urn:ietf:params:oauth:grant-type:token-exchange.

org_id?|

The organization for the analytics token. Required when audience is daytona:analytics; omitted (or null) otherwise.

Formatuuid
project_id?|

The project for the API token. Required when audience is absent or daytona:api; omitted (or null) when audience is daytona:analytics.

Formatuuid
resource?|

RFC 8693 target resource. Explicit down-scoping is not supported; omit this parameter.

scope?|

RFC 8693 scope request. Explicit down-scoping is not supported; omit this parameter.

subject_token*string

The sign-in token. It must match the bearer token on the request.

subject_token_type*string

Subject token type.

Response Body

The platform access token

application/json
  1. response

A platform access token.

access_token*string

Project- or organization-scoped access token.

expires_in*integer

Token lifetime in seconds (default 300).

Formatint64
Range0 <= value
issued_token_type*string

Always urn:ietf:params:oauth:token-type:access_token.

token_type*string

Always Bearer.

curl -X POST 'https://example.com/auth/token' \  -H 'Content-Type: application/json' \  -d '{  "grant_type": "string",  "subject_token": "string",  "subject_token_type": "string"}'
{  "access_token": "string",  "expires_in": 0,  "issued_token_type": "string",  "token_type": "string"}