# Secrets

Write-only secrets, the HTTPS secret injections that reference them, and the preset catalog

Source: https://slashinfra.com/docs/api-reference/control/secrets
Last modified: 2026-11-30T16:36:19.000Z

Write-only secrets, the HTTPS secret injections that reference them, and the preset catalog

Resource, request and plan limits are listed on [Limits](https://slashinfra.com/docs/reference/limits).

[Download OpenAPI specification](https://slashinfra.com/docs/control.openapi.json) · Version 0.1.0

[GETList the secret injection presets](https://slashinfra.com/docs/api-reference/control/secrets#getSecret-injection-presets)[GETList secrets](https://slashinfra.com/docs/api-reference/control/secrets#getSecrets)[POSTCreate a secret](https://slashinfra.com/docs/api-reference/control/secrets#postSecrets)[DELETEDelete a secret](https://slashinfra.com/docs/api-reference/control/secrets#deleteSecretsByRef)[PATCHDescribe a secret](https://slashinfra.com/docs/api-reference/control/secrets#patchSecretsByRef)[PUTReplace the value of a secret](https://slashinfra.com/docs/api-reference/control/secrets#putSecretsByRef)

### List the secret injection presets

GET

/secret-injection-presets

Returns the shared catalog of prepared HTTPS secret injections for common API providers; a client picks a secret and sends the explicit rules of a preset. The catalog is not a destination allowlist, and later edits never change an existing SVM.

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Response Body

The shared preset catalog, in display order; a client adds the secret that the user picks to each rule.

`application/json`

- response

- response
- …

The shared preset catalog, in display order; a client adds the secret that the user picks to each rule.

`[index: integer]?`

One prepared secret injection: the user picks the secret, and the client submits explicit rules and the preset environment.

Example Request

```
curl -X GET 'https://api.slashinfra.com/secret-injection-presets'
```

Example ResponseSchema

```
[  {    "env": {      "DEBUG": "1"    },    "id": "openai",    "rules": [      {        "domain": "api.openai.com",        "header": "authorization",        "placeholder": "__TELEGRAM_BOT_TOKEN__",        "value_format": "raw",        "value_prefix": "Bearer "      }    ],    "service": "OpenAI"  }]
```

### List secrets

GET

/secrets

Returns the metadata of every write-only secret of one project, by name. `project` is an id or name and defaults to `default`. The value is never part of an answer: send a new value to `PUT /secrets/:ref` to replace it.

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Query Parameters

`project?`string

The project id or name, `default` when omitted; an unknown project answers 404 `project_not_found`.

#### Response Body

Every secret of the project, by name; `[]` when the project has none.

`application/json`

- response

- response
- …

Every secret of the project, by name; `[]` when the project has none.

`[index: integer]?`

One write-only secret of the organization; answers never include its value.

Example Request

```
curl -X GET 'https://api.slashinfra.com/secrets'
```

Example ResponseSchema

```
[  {    "created_ms": 1767225600000,    "description": "production OpenAI key",    "id": "sec_6f1c0f0e8a",    "name": "openai",    "project": "proj_6f1c0f0e8a",    "updated_ms": 1767225600000,    "version": 2  }]
```

### Create a secret

POST

/secrets

Stores a secret value in the vault Worker, which encrypts it with AES-256-GCM under one key; control keeps only the name and metadata. An SVM or a profile references the secret by id, and the value reaches only the nodes that serve a referencing SVM.

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Request Body

The name, value and optional description of the new secret.

- body

- body
- …

The name, value and optional description of the new secret.

`description?`|

An optional note about the secret: trimmed, empty becomes null, at most 200 code points and no control character.

`name*`string

The name of the secret, unique in its project: `^[a-z][a-z0-9-]{0,31}$`; an existing name answers 409 `name_taken`.

`project?`string

The project id or name of the secret; `default` when omitted, and an unknown project answers 404 `project_not_found`.

`value*`string

The secret value, write-only: the vault Worker encrypts it and control never stores it; the CLI reads it from standard input ([secrets](https://slashinfra.com/docs/platform/secrets)).

#### Response Body

One write-only secret of the organization; answers never include its value.

`application/json`

- response

- response
- …

One write-only secret of the organization; answers never include its value.

`created_ms*`integer

The creation time in milliseconds since the Unix epoch.

`description*`|

An optional note about the secret: trimmed, at most 200 code points, no control character, and never the value.

`id*`string

The secret id: `sec_` and ten symbols of the SVM id alphabet.

`name*`string

The name of the secret, unique in its project.

`project*`string

The id of the project of the secret.

`updated_ms*`integer

The time of the last change, in milliseconds since the Unix epoch.

`version*`integer

The version of the stored value, from 1; every replacement increments it.

Example Request

```
curl -X POST 'https://api.slashinfra.com/secrets' \  -H 'Content-Type: application/json' \  -d '{  "name": "openai",  "value": "sk-..."}'
```

Example ResponseSchema

```
{  "created_ms": 1767225600000,  "description": "production OpenAI key",  "id": "sec_6f1c0f0e8a",  "name": "openai",  "project": "proj_6f1c0f0e8a",  "updated_ms": 1767225600000,  "version": 2}
```

### Delete a secret

DELETE

/secrets/{ref}

Deletes a secret that no SVM or profile references; a referenced one answers 409 `secret_in_use`, so remove the rules that name it first. A rule that names a deleted secret can never be created.

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Path Parameters

`ref*`string

The secret id (`sec_` and ten id symbols), or its name in the `project` query; an id resolves in every project.

Length`1 <= length`

#### Query Parameters

`project?`string

The project id or name, `default` when omitted; an unknown project answers 404 `project_not_found`.

#### Response Body

The secret is deleted, with no body.

`response?`string`text/plain`

The secret is deleted, with no body.

Example Request

```
curl -X DELETE 'https://api.slashinfra.com/secrets/openai'
```

Example ResponseSchema

```
"string"
```

### Describe a secret

PATCH

/secrets/{ref}

Changes only the description of a secret; the value, its version and every node stay untouched, and empty text clears it. The `secret.update` audit row omits the text.

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Path Parameters

`ref*`string

The secret id (`sec_` and ten id symbols), or its name in the `project` query; an id resolves in every project.

Length`1 <= length`

#### Query Parameters

`project?`string

The project id or name, `default` when omitted; an unknown project answers 404 `project_not_found`.

#### Request Body

The new description of the secret.

- body

- body
- …

The new description of the secret.

`description*`|

The new description: trimmed, empty becomes null, at most 200 code points and no control character.

#### Response Body

One write-only secret of the organization; answers never include its value.

`application/json`

- response

- response
- …

One write-only secret of the organization; answers never include its value.

`created_ms*`integer

The creation time in milliseconds since the Unix epoch.

`description*`|

An optional note about the secret: trimmed, at most 200 code points, no control character, and never the value.

`id*`string

The secret id: `sec_` and ten symbols of the SVM id alphabet.

`name*`string

The name of the secret, unique in its project.

`project*`string

The id of the project of the secret.

`updated_ms*`integer

The time of the last change, in milliseconds since the Unix epoch.

`version*`integer

The version of the stored value, from 1; every replacement increments it.

Example Request

```
curl -X PATCH 'https://api.slashinfra.com/secrets/openai' \  -H 'Content-Type: application/json' \  -d '{  "description": "production OpenAI key"}'
```

Example ResponseSchema

```
{  "created_ms": 1767225600000,  "description": "production OpenAI key",  "id": "sec_6f1c0f0e8a",  "name": "openai",  "project": "proj_6f1c0f0e8a",  "updated_ms": 1767225600000,  "version": 2}
```

### Replace the value of a secret

PUT

/secrets/{ref}

The vault Worker seals the new value as the next version, and every node that serves a referencing SVM must cache it before the answer; a timeout answers 503 and keeps the new version. A node that misses the value stops injecting the old one; see [secrets](https://slashinfra.com/docs/platform/secrets) for the rotation rules.

#### Authorization

`apiKey`

header`Authorization``Bearer <token>`

An API key (`si_` and 43 base64url characters), sent as `Authorization: Bearer si_...`; see [Using the API](https://slashinfra.com/docs/reference/api).

#### Path Parameters

`ref*`string

The secret id (`sec_` and ten id symbols), or its name in the `project` query; an id resolves in every project.

Length`1 <= length`

#### Query Parameters

`project?`string

The project id or name, `default` when omitted; an unknown project answers 404 `project_not_found`.

#### Request Body

The new value of the secret.

- body

- body
- …

The new value of the secret.

`value*`string

The new value, encrypted and never returned.

#### Response Body

One write-only secret of the organization; answers never include its value.

`application/json`

- response

- response
- …

One write-only secret of the organization; answers never include its value.

`created_ms*`integer

The creation time in milliseconds since the Unix epoch.

`description*`|

An optional note about the secret: trimmed, at most 200 code points, no control character, and never the value.

`id*`string

The secret id: `sec_` and ten symbols of the SVM id alphabet.

`name*`string

The name of the secret, unique in its project.

`project*`string

The id of the project of the secret.

`updated_ms*`integer

The time of the last change, in milliseconds since the Unix epoch.

`version*`integer

The version of the stored value, from 1; every replacement increments it.

Example Request

```
curl -X PUT 'https://api.slashinfra.com/secrets/openai' \  -H 'Content-Type: application/json' \  -d '{  "value": "sk-..."}'
```

Example ResponseSchema

```
{  "created_ms": 1767225600000,  "description": "production OpenAI key",  "id": "sec_6f1c0f0e8a",  "name": "openai",  "project": "proj_6f1c0f0e8a",  "updated_ms": 1767225600000,  "version": 2}
```

GET

/secret-injection-presets

Example Request

```
curl -X GET 'https://api.slashinfra.com/secret-injection-presets'
```

```
[
{
"env": {
"DEBUG": "1"
},
"id": "openai",
"rules": [
{
"domain": "api.openai.com",
"header": "authorization",
"placeholder": "__TELEGRAM_BOT_TOKEN__",
"value_format": "raw",
"value_prefix": "Bearer "
}
],
"service": "OpenAI"
}
]
```

GET

/secrets

Example Request

```
curl -X GET 'https://api.slashinfra.com/secrets'
```

```
[
{
"created_ms": 1767225600000,
"description": "production OpenAI key",
"id": "sec_6f1c0f0e8a",
"name": "openai",
"project": "proj_6f1c0f0e8a",
"updated_ms": 1767225600000,
"version": 2
}
]
```

POST

/secrets

Example Request

```
curl -X POST 'https://api.slashinfra.com/secrets' \
-H 'Content-Type: application/json' \
-d '{
"name": "openai",
"value": "sk-..."
}'
```

```
{
"created_ms": 1767225600000,
"description": "production OpenAI key",
"id": "sec_6f1c0f0e8a",
"name": "openai",
"project": "proj_6f1c0f0e8a",
"updated_ms": 1767225600000,
"version": 2
}
```

DELETE

/secrets/{ref}

Example Request

```
curl -X DELETE 'https://api.slashinfra.com/secrets/openai'
```

```
"string"
```

PATCH

/secrets/{ref}

Example Request

```
curl -X PATCH 'https://api.slashinfra.com/secrets/openai' \
-H 'Content-Type: application/json' \
-d '{
"description": "production OpenAI key"
}'
```

```
{
"created_ms": 1767225600000,
"description": "production OpenAI key",
"id": "sec_6f1c0f0e8a",
"name": "openai",
"project": "proj_6f1c0f0e8a",
"updated_ms": 1767225600000,
"version": 2
}
```

PUT

/secrets/{ref}

Example Request

```
curl -X PUT 'https://api.slashinfra.com/secrets/openai' \
-H 'Content-Type: application/json' \
-d '{
"value": "sk-..."
}'
```

```
{
"created_ms": 1767225600000,
"description": "production OpenAI key",
"id": "sec_6f1c0f0e8a",
"name": "openai",
"project": "proj_6f1c0f0e8a",
"updated_ms": 1767225600000,
"version": 2
}
```
