CumulusDocs
Open Studio
On this page

Create or version a secret

Create a secret or add a version. Keep the returned version for references in agents and trunks; the response does not return the value.

Operation ID: secrets.put.

Request

PUT /api/v1/secrets/{secret_id}

  • TypeScript SDK: client.secrets.put (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "secrets.put" (path arguments use input.path). Legacy alias: secrets_put. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: admin.
  • Idempotency: Required. Send Idempotency-Key (TypeScript SDK: idempotencyKey) and keep it for retries.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Use an admin key and replace this illustrative value with a newly generated secret from your secret manager. The response returns metadata, not the bytes. Save its id and current_version for a pinned reference and configure matching bytes on your server.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Set IDEMPOTENCY_KEY to a new UUID for this action and keep it for retries. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS -X PUT "${CUMULUS_BASE_URL%/}/api/v1/secrets/${SECRET_ID}" \
  -H "Authorization: Bearer $CUMULUS_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "kind": "http_auth",
  "value": "example-only-replace-with-a-generated-secret"
}'

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const idempotencyKey = process.env.IDEMPOTENCY_KEY;
if (!idempotencyKey) throw new Error("Set IDEMPOTENCY_KEY for this request");

const response = await client.secrets.put({
  "path": {
    "secret_id": "<secret_id>"
  },
  "body": {
    "kind": "http_auth",
    "value": "example-only-replace-with-a-generated-secret"
  },
  idempotencyKey,
});

Integration notes

Use an admin key. Choose sip_auth for a trunk password, webhook_signing for a webhook secret or http_auth for an HTTP credential. The response returns metadata, never the value. Reference the saved secret as {id, version: current_version}.

For a Basis Theory proxy credential, use http_auth and an action.put edit with auth: {scheme: "header", header_name: "BT-PROXY-KEY", secret_ref: {id, version}}. Remove the key query parameter from the action URL and keep the value out of prompts. Proxy access does not grant tokenization permissions.

Input schema

Path, query and header parameters

secret_id

path parameter · Required.

Type: string. minLength: 1. maxLength: 128. pattern: ^[a-z0-9][a-z0-9_-]*$.

Idempotency-Key

header parameter · Required.

Type: string. minLength: 1. maxLength: 256.

JSON request body

FieldType or valuesRequiredDescription and limits
kind"webhook_signing" · "http_auth" · "sip_auth" · "twilio_credentials"Required—
valuestringRequiredminLength: 1. maxLength: 16384.
Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [
    {
      "name": "secret_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[a-z0-9][a-z0-9_-]*$"
      }
    },
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SecretsPutRequest"
        }
      }
    }
  }
}

Responses

HTTP 200

Create a secret or add a new version

application/json

FieldType or valuesRequiredDescription and limits
idstringRequiredminLength: 1. maxLength: 128. pattern: ^[a-z0-9][a-z0-9_-]*$.
namestringRequiredminLength: 1. maxLength: 128. pattern: ^[a-z0-9][a-z0-9_-]*$.
kind"webhook_signing" · "http_auth" · "sip_auth" · "twilio_credentials"Required—
current_versionstringRequiredminLength: 1. maxLength: 128.
versionsarray of objectRequiredminItems: 1.
versions[].versionstringRequiredminLength: 1. maxLength: 128.
versions[].created_atstring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.
created_atstring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "200": {
    "description": "Create a secret or add a new version",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SecretMetadata"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

Referenced schemas

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI JSON
{
  "components": {
    "schemas": {
      "SecretsPutRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "webhook_signing",
              "http_auth",
              "sip_auth",
              "twilio_credentials"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          }
        },
        "required": [
          "kind",
          "value"
        ],
        "additionalProperties": false
      },
      "SecretMetadata": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "webhook_signing",
              "http_auth",
              "sip_auth",
              "twilio_credentials"
            ]
          },
          "current_version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "versions": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                }
              },
              "required": [
                "version",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "current_version",
          "versions",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}

Errors and recovery

See API error handling and Troubleshooting.

Content version 00a0e79eCustomer SDKMarkdown source
Create or version a secret · Cumulus developer docs