Sign Up

Secret

List secrets

Deprecated
GET
/secret

This endpoint is deprecated and fails for organizations with more than 1500 secrets. Use listSecretsPaginated instead.

Authorization

headerAuthorizationBearer <token>

API Key access

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

List of all secrets (metadata only, values are not returned)

application/json
  1. response
[index: integer]?
curl -X GET 'http://localhost:3000/secret'
[  {    "createdAt": "2024-01-31T12:00:00Z",    "hosts": [      "api.anthropic.com"    ],    "name": "MY_API_KEY",    "description": "API key for external service",    "id": "123e4567-e89b-12d3-a456-426614174000",    "placeholder": "dtn_secret_a7f3b2c1e9d4f6g8",    "updatedAt": "2024-01-31T12:00:00Z"  }]

Create secret

POST
/secret

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

Secret name (alphanumeric, hyphens, underscores)

value*string

Secret value

description?string

Optional description of the secret

hosts?array<string>

Allowed hosts this secret may be sent to

Response Body

The secret has been successfully created.

application/json
  1. response
id*string

Secret ID

name*string

Secret name

description?string

Optional description of the secret

createdAt*string

Creation timestamp

Formatdate-time
placeholder*string

Opaque placeholder token injected as env var value in sandboxes

hosts*array<string>

Allowed hosts this secret may be sent to

updatedAt*string

Last update timestamp

Formatdate-time
curl -X POST 'http://localhost:3000/secret' \  -H 'Content-Type: application/json' \  -d '{  "hosts": [    "api.anthropic.com"  ],  "name": "MY_API_KEY",  "description": "description",  "value": "value"}'
{  "createdAt": "2024-01-31T12:00:00Z",  "hosts": [    "api.anthropic.com"  ],  "name": "MY_API_KEY",  "description": "API key for external service",  "id": "123e4567-e89b-12d3-a456-426614174000",  "placeholder": "dtn_secret_a7f3b2c1e9d4f6g8",  "updatedAt": "2024-01-31T12:00:00Z"}
GET
/secret/paginated

Authorization

headerAuthorizationBearer <token>

API Key access

Query Parameters

cursor?string

Pagination cursor from a previous response

limit?integer

Number of results per page

Range1 <= value <= 200
Default100
name?string

Filter by partial name match

sort?string

Field to sort by

Default"createdAt"
Value in"name""createdAt""updatedAt"
order?string

Direction to sort by

Default"desc"
Value in"asc""desc"

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

Paginated list of secrets (metadata only, values are not returned)

application/json
  1. response
items*array<>

List of results for the current page

total*integer

Total number of secrets matching the filters

nextCursor*|

Cursor for the next page of results

curl -X GET 'http://localhost:3000/secret/paginated'
{  "nextCursor": "nextCursor",  "total": 0,  "items": [    {      "createdAt": "2024-01-31T12:00:00Z",      "hosts": [        "api.anthropic.com"      ],      "name": "MY_API_KEY",      "description": "API key for external service",      "id": "123e4567-e89b-12d3-a456-426614174000",      "placeholder": "dtn_secret_a7f3b2c1e9d4f6g8",      "updatedAt": "2024-01-31T12:00:00Z"    },    {      "createdAt": "2024-01-31T12:00:00Z",      "hosts": [        "api.anthropic.com"      ],      "name": "MY_API_KEY",      "description": "API key for external service",      "id": "123e4567-e89b-12d3-a456-426614174000",      "placeholder": "dtn_secret_a7f3b2c1e9d4f6g8",      "updatedAt": "2024-01-31T12:00:00Z"    }  ]}

Get secret

GET
/secret/{secretId}

Authorization

headerAuthorizationBearer <token>

API Key access

Path Parameters

secretId*string

ID of the secret

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

The secret metadata (value is not returned)

application/json
  1. response
id*string

Secret ID

name*string

Secret name

description?string

Optional description of the secret

createdAt*string

Creation timestamp

Formatdate-time
placeholder*string

Opaque placeholder token injected as env var value in sandboxes

hosts*array<string>

Allowed hosts this secret may be sent to

updatedAt*string

Last update timestamp

Formatdate-time
curl -X GET 'http://localhost:3000/secret/string'
{  "createdAt": "2024-01-31T12:00:00Z",  "hosts": [    "api.anthropic.com"  ],  "name": "MY_API_KEY",  "description": "API key for external service",  "id": "123e4567-e89b-12d3-a456-426614174000",  "placeholder": "dtn_secret_a7f3b2c1e9d4f6g8",  "updatedAt": "2024-01-31T12:00:00Z"}

Update secret

PATCH
/secret/{secretId}

Authorization

headerAuthorizationBearer <token>

API Key access

Path Parameters

secretId*string

ID of the secret

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Request Body

application/json
  1. body
value?string

New secret value

description?string

Optional description of the secret

hosts?array<string>

Allowed hosts this secret may be sent to

Response Body

The secret has been successfully updated.

application/json
  1. response
id*string

Secret ID

name*string

Secret name

description?string

Optional description of the secret

createdAt*string

Creation timestamp

Formatdate-time
placeholder*string

Opaque placeholder token injected as env var value in sandboxes

hosts*array<string>

Allowed hosts this secret may be sent to

updatedAt*string

Last update timestamp

Formatdate-time
curl -X PATCH 'http://localhost:3000/secret/string' \  -H 'Content-Type: application/json' \  -d '{  "hosts": [    "api.anthropic.com"  ],  "description": "description",  "value": "value"}'
{  "createdAt": "2024-01-31T12:00:00Z",  "hosts": [    "api.anthropic.com"  ],  "name": "MY_API_KEY",  "description": "API key for external service",  "id": "123e4567-e89b-12d3-a456-426614174000",  "placeholder": "dtn_secret_a7f3b2c1e9d4f6g8",  "updatedAt": "2024-01-31T12:00:00Z"}

Delete secret

DELETE
/secret/{secretId}

Authorization

headerAuthorizationBearer <token>

API Key access

Path Parameters

secretId*string

ID of the secret

Header Parameters

X-Daytona-Organization-ID?string

Use with JWT to specify the organization ID

Response Body

The secret has been successfully deleted.

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