Sign Up

API Keys

GET
/api-keys/current

Describes the API key presented on this request.

Authorization

api_key
headerAuthorizationBearer <token>

Bearer project API key.

Response Body

The project API key

application/json
  1. response

A project API key together with its tenant context.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
imported_from?|

"v0" when the key was created on Daytona v0 and imported by the v0 ↔ v2 key sync; null for a key created on this platform.

key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

project_id*string

The project ID.

Formatuuid
project_permissions*array<string>

The project permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
service_account_id?|

The service account that owns the API key, when applicable.

Formatuuid
service_account_name?|

The service account name, when applicable and available.

sync_to_v0*boolean

Whether the v0 ↔ v2 key sync copies this key to Daytona v0 (for an organization that is kept in sync with Daytona v0). true for a live key a person minted in the organization's default project unless it was opted out by updating the API key, and always for a live key imported from Daytona v0. false for every key the sync never copies: keys in other projects, service-account keys, the dashboard's own key named default, and revoked or expired keys. A Daytona v0 copy can read every sandbox, snapshot and registry of the organization on Daytona v0, which has no read permissions.

sync_to_v1*booleanDeprecated

Deprecated: use sync_to_v0, which carries the same value.

context*

The project and organization in which the key acts.

curl -X GET 'https://example.com/api-keys/current'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "imported_from": "string",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "project_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z",  "service_account_id": "81f92c7b-60ae-411e-bc6f-e2dc93db8886",  "service_account_name": "string",  "sync_to_v0": true,  "sync_to_v1": true,  "context": {    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",    "org_name": "string",    "project_name": "string"  }}
GET
/orgs/{org_id}/api-keys

Authorization

user_jwt read:org_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:org_api_keys

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of organization API keys

application/json
  1. response

A page of organization API keys.

next_cursor?|

The cursor for the next page, or null when this is the last page.

organization_api_keys*array<>

The organization API keys in this page.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/api-keys'
{  "next_cursor": "string",  "organization_api_keys": [    {      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "expires_at": "2019-08-24T14:15:22Z",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "key_prefix": "string",      "key_suffix": "string",      "last_used_at": "2019-08-24T14:15:22Z",      "name": "string",      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",      "org_permissions": [        "string"      ],      "revoked_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/orgs/{org_id}/api-keys

Only some organization permissions can be held by an organization API key; a request that names any other is refused, naming the permissions at fault.

Authorization

user_jwt write:org_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:org_api_keys

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
expires_at?|

Optional expiry; must be in the future. Absent means it never expires.

Formatdate-time
name*string

The key's display name.

org_permissions*array<string>

The organization permissions the key holds. Required, with at least one entry: a key never gets a default or implied permission set. A project permission is not a valid value here.

Items1 <= items

Response Body

The created organization API key

application/json
  1. response

A newly created organization API key and its one-time secret token.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

org_id*string

The organization ID.

Formatuuid
org_permissions*array<string>

The organization permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
token*string

The secret token, returned only when the key is created.

curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "org_permissions": [    "string"  ]}'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "org_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z",  "token": "string"}
GET
/orgs/{org_id}/api-keys/current

Describes the organization API key presented on this request, with the permissions it holds now.

Authorization

org_key
headerAuthorizationBearer <token>

Bearer organization API key.

Path Parameters

org_id*string

The organization ID

Formatuuid

Response Body

The organization API key

application/json
  1. response

An organization API key without its secret token.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

org_id*string

The organization ID.

Formatuuid
org_permissions*array<string>

The organization permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/api-keys/current'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "org_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z"}
GET
/orgs/{org_id}/api-keys/{key_id}

Authorization

user_jwt read:org_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:org_api_keys

Path Parameters

org_id*string

The organization ID

Formatuuid
key_id*string

The API key ID

Formatuuid

Response Body

The organization API key

application/json
  1. response

An organization API key without its secret token.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

org_id*string

The organization ID.

Formatuuid
org_permissions*array<string>

The organization permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "org_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z"}
DELETE
/orgs/{org_id}/api-keys/{key_id}

Authorization

user_jwt delete:org_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: delete:org_api_keys

Path Parameters

org_id*string

The organization ID

Formatuuid
key_id*string

The API key ID

Formatuuid

Response Body

Organization API key revoked

curl -X DELETE 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Empty

List project API keys

GET
/projects/{project_id}/api-keys

Authorization

user_jwt read:project_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:project_api_keys

Path Parameters

project_id*string

The project ID

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of project API keys

application/json
  1. response

A page of project API keys.

next_cursor?|

The cursor for the next page, or null when this is the last page.

project_api_keys*array<>

The project API keys in this page.

curl -X GET 'https://example.com/projects/string/api-keys'
{  "next_cursor": "string",  "project_api_keys": [    {      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "expires_at": "2019-08-24T14:15:22Z",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "imported_from": "string",      "key_prefix": "string",      "key_suffix": "string",      "last_used_at": "2019-08-24T14:15:22Z",      "name": "string",      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",      "project_permissions": [        "string"      ],      "revoked_at": "2019-08-24T14:15:22Z",      "service_account_id": "81f92c7b-60ae-411e-bc6f-e2dc93db8886",      "service_account_name": "string",      "sync_to_v0": true,      "sync_to_v1": true    }  ]}

Create a project API key

POST
/projects/{project_id}/api-keys

The requested project permissions must be grantable by the current member. A service-account key is also limited by that account's permissions.

Authorization

user_jwt write:project_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:project_api_keys

Path Parameters

project_id*string

The project ID

Request Body

application/json
  1. body
expires_at?|

Optional expiry; must be in the future. Absent means it never expires.

Formatdate-time
name?|

The key's display name.

project_permissions*array<string>

The project permissions the key holds. Required, with at least one entry: a key never gets a default or implied permission set.

Items1 <= items
service_account_id?|

The service account that owns this key, or null for the current user.

Formatuuid
sync_to_v0?|

Whether the v0 ↔ v2 key sync may copy this key to Daytona v0. Absent = true. Only a key a person mints in the organization's default project is ever copied; elsewhere the field is ignored and the response says false. A Daytona v0 copy can read every sandbox, snapshot and registry of the organization on Daytona v0, which has no read permissions; false keeps the key on this platform only. Change it later by updating the API key.

sync_to_v1?|Deprecated

Deprecated: use sync_to_v0. Accepted with the same meaning; a request that sets both to different values is refused.

Response Body

The created project API key

application/json
  1. response

A newly created project API key and its one-time secret token.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
imported_from?|

"v0" when the key was created on Daytona v0 and imported by the v0 ↔ v2 key sync; null for a key created on this platform.

key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

project_id*string

The project ID.

Formatuuid
project_permissions*array<string>

The project permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
service_account_id?|

The service account that owns the API key, when applicable.

Formatuuid
service_account_name?|

The service account name, when applicable and available.

sync_to_v0*boolean

Whether the v0 ↔ v2 key sync copies this key to Daytona v0 (for an organization that is kept in sync with Daytona v0). true for a live key a person minted in the organization's default project unless it was opted out by updating the API key, and always for a live key imported from Daytona v0. false for every key the sync never copies: keys in other projects, service-account keys, the dashboard's own key named default, and revoked or expired keys. A Daytona v0 copy can read every sandbox, snapshot and registry of the organization on Daytona v0, which has no read permissions.

sync_to_v1*booleanDeprecated

Deprecated: use sync_to_v0, which carries the same value.

token*string

The secret token, returned only when the key is created.

curl -X POST 'https://example.com/projects/string/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "project_permissions": [    "string"  ]}'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "imported_from": "string",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "project_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z",  "service_account_id": "81f92c7b-60ae-411e-bc6f-e2dc93db8886",  "service_account_name": "string",  "sync_to_v0": true,  "sync_to_v1": true,  "token": "string"}

Get a project API key

GET
/projects/{project_id}/api-keys/{key_id}

Authorization

user_jwt read:project_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:project_api_keys

Path Parameters

project_id*string

The project ID

key_id*string

The API key ID

Formatuuid

Response Body

The project API key

application/json
  1. response

A project API key without its secret token.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
imported_from?|

"v0" when the key was created on Daytona v0 and imported by the v0 ↔ v2 key sync; null for a key created on this platform.

key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

project_id*string

The project ID.

Formatuuid
project_permissions*array<string>

The project permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
service_account_id?|

The service account that owns the API key, when applicable.

Formatuuid
service_account_name?|

The service account name, when applicable and available.

sync_to_v0*boolean

Whether the v0 ↔ v2 key sync copies this key to Daytona v0 (for an organization that is kept in sync with Daytona v0). true for a live key a person minted in the organization's default project unless it was opted out by updating the API key, and always for a live key imported from Daytona v0. false for every key the sync never copies: keys in other projects, service-account keys, the dashboard's own key named default, and revoked or expired keys. A Daytona v0 copy can read every sandbox, snapshot and registry of the organization on Daytona v0, which has no read permissions.

sync_to_v1*booleanDeprecated

Deprecated: use sync_to_v0, which carries the same value.

curl -X GET 'https://example.com/projects/string/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "imported_from": "string",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "project_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z",  "service_account_id": "81f92c7b-60ae-411e-bc6f-e2dc93db8886",  "service_account_name": "string",  "sync_to_v0": true,  "sync_to_v1": true}

Update a project API key

PATCH
/projects/{project_id}/api-keys/{key_id}

Changes whether this key is configured to be copied to Daytona v0. The copy itself follows shortly afterwards — turning it off deletes the Daytona v0 key — and this key keeps working either way. Only a live key a person created in the organization's default project can be copied.

Authorization

user_jwt delete:project_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: delete:project_api_keys

Path Parameters

project_id*string

The project ID

key_id*string

The API key ID

Formatuuid

Request Body

application/json
  1. body
sync_to_v0?boolean

Whether the v0 ↔ v2 key sync keeps a copy of this key on Daytona v0. false deletes the Daytona v0 copy (the key keeps working here); true copies the key to Daytona v0 again. A Daytona v0 copy can read every sandbox, snapshot and registry of the organization on Daytona v0, which has no read permissions. Only a key a person minted in the organization's default project is ever copied; a key imported from Daytona v0 always is. Required (or the deprecated sync_to_v1).

sync_to_v1?booleanDeprecated

Deprecated: use sync_to_v0. Accepted with the same meaning; a request that sets both to different values is refused.

Response Body

The project API key

application/json
  1. response

A project API key without its secret token.

created_at*string

When the API key was created.

Formatdate-time
created_by?|

The user who created the API key, when visible.

Formatuuid
expires_at?|

When the API key expires, or null when it does not expire.

Formatdate-time
id*string

The API key ID.

Formatuuid
imported_from?|

"v0" when the key was created on Daytona v0 and imported by the v0 ↔ v2 key sync; null for a key created on this platform.

key_prefix?|

The recognizable leading token characters, when available.

key_suffix?|

The recognizable trailing token characters, when available.

last_used_at?|

When the API key was last used, or null when unknown.

Formatdate-time
name*string

The API key name.

project_id*string

The project ID.

Formatuuid
project_permissions*array<string>

The project permissions granted to the API key.

revoked_at?|

When the API key was revoked, or null while active.

Formatdate-time
service_account_id?|

The service account that owns the API key, when applicable.

Formatuuid
service_account_name?|

The service account name, when applicable and available.

sync_to_v0*boolean

Whether the v0 ↔ v2 key sync copies this key to Daytona v0 (for an organization that is kept in sync with Daytona v0). true for a live key a person minted in the organization's default project unless it was opted out by updating the API key, and always for a live key imported from Daytona v0. false for every key the sync never copies: keys in other projects, service-account keys, the dashboard's own key named default, and revoked or expired keys. A Daytona v0 copy can read every sandbox, snapshot and registry of the organization on Daytona v0, which has no read permissions.

sync_to_v1*booleanDeprecated

Deprecated: use sync_to_v0, which carries the same value.

curl -X PATCH 'https://example.com/projects/string/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "imported_from": "string",  "key_prefix": "string",  "key_suffix": "string",  "last_used_at": "2019-08-24T14:15:22Z",  "name": "string",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "project_permissions": [    "string"  ],  "revoked_at": "2019-08-24T14:15:22Z",  "service_account_id": "81f92c7b-60ae-411e-bc6f-e2dc93db8886",  "service_account_name": "string",  "sync_to_v0": true,  "sync_to_v1": true}

Revoke a project API key

DELETE
/projects/{project_id}/api-keys/{key_id}

Authorization

user_jwt delete:project_api_keys
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: delete:project_api_keys

Path Parameters

project_id*string

The project ID

key_id*string

The API key ID

Formatuuid

Response Body

Project API key revoked

curl -X DELETE 'https://example.com/projects/string/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Empty