Sign Up

API Keys

List API keys

GET
/api-keys

Authorization

headerAuthorizationBearer <token>

API Key access

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

API keys retrieved successfully.

application/json
  1. response
[index: integer]?
curl -X GET 'http://localhost:3000/api-keys'
[  {    "organizationId": "123e4567-e89b-12d3-a456-426614174000",    "createdAt": "2024-03-14T12:00:00Z",    "lastUsedAt": "2024-03-14T12:00:00Z",    "permissions": [      "write:registries",      "write:registries"    ],    "name": "My API Key",    "value": "bb_********************def",    "userId": "123",    "expiresAt": "2024-03-14T12:00:00Z"  }]

Create API key

POST
/api-keys

Authorization

headerAuthorizationBearer <token>

API Key access

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Request Body

application/json
  1. body
name*string

The name of the API key

permissions*array<>

The list of organization resource permissions explicitly assigned to the API key

expiresAt?|

When the API key expires

Formatdate-time

Response Body

API key created successfully.

application/json
  1. response
name*string

The name of the API key

value*string

The API key value

createdAt*string

When the API key was created

Formatdate-time
permissions*array<>

The list of organization resource permissions assigned to the API key

expiresAt*|

When the API key expires

Formatdate-time
curl -X POST 'http://localhost:3000/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "permissions": [    "write:registries",    "write:registries"  ],  "name": "My API Key",  "expiresAt": "2025-06-09T12:00:00Z"}'
{  "createdAt": "2024-03-14T12:00:00Z",  "permissions": [    "write:registries",    "write:registries"  ],  "name": "My API Key",  "value": "bb_sk_1234567890abcdef",  "expiresAt": "2025-06-09T12:00:00Z"}
GET
/api-keys/current

Authorization

headerAuthorizationBearer <token>

API Key access

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

API key retrieved successfully.

application/json
  1. response
name*string

The name of the API key

value*string

The masked API key value

createdAt*string

When the API key was created

Formatdate-time
permissions*array<>

The list of organization resource permissions assigned to the API key

lastUsedAt*|

When the API key was last used

Formatdate-time
expiresAt*|

When the API key expires

Formatdate-time
userId*string

The user ID of the user who created the API key

organizationId?string

The organization ID associated with the API key

curl -X GET 'http://localhost:3000/api-keys/current'
{  "organizationId": "123e4567-e89b-12d3-a456-426614174000",  "createdAt": "2024-03-14T12:00:00Z",  "lastUsedAt": "2024-03-14T12:00:00Z",  "permissions": [    "write:registries",    "write:registries"  ],  "name": "My API Key",  "value": "bb_********************def",  "userId": "123",  "expiresAt": "2024-03-14T12:00:00Z"}

Get API key

GET
/api-keys/{name}

Authorization

headerAuthorizationBearer <token>

API Key access

Path Parameters

name*string

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

API key retrieved successfully.

application/json
  1. response
name*string

The name of the API key

value*string

The masked API key value

createdAt*string

When the API key was created

Formatdate-time
permissions*array<>

The list of organization resource permissions assigned to the API key

lastUsedAt*|

When the API key was last used

Formatdate-time
expiresAt*|

When the API key expires

Formatdate-time
userId*string

The user ID of the user who created the API key

organizationId?string

The organization ID associated with the API key

curl -X GET 'http://localhost:3000/api-keys/string'
{  "organizationId": "123e4567-e89b-12d3-a456-426614174000",  "createdAt": "2024-03-14T12:00:00Z",  "lastUsedAt": "2024-03-14T12:00:00Z",  "permissions": [    "write:registries",    "write:registries"  ],  "name": "My API Key",  "value": "bb_********************def",  "userId": "123",  "expiresAt": "2024-03-14T12:00:00Z"}

Delete API key

DELETE
/api-keys/{name}

Authorization

headerAuthorizationBearer <token>

API Key access

Path Parameters

name*string

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

API key deleted successfully.

curl -X DELETE 'http://localhost:3000/api-keys/string'
Empty

Delete API key for user

DELETE
/api-keys/{userId}/{name}

Authorization

headerAuthorizationBearer <token>

API Key access

Path Parameters

userId*string
name*string

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

API key deleted successfully.

curl -X DELETE 'http://localhost:3000/api-keys/string/string'
Empty