Set a secret
⚠️
Preview — this feature is being built; the design below is the spec.
PUT https://app.syntic.ai/v1/vaults/{vault_id}/secrets/{name}Create a secret, or replace its value. The value is encrypted with your organization’s key before storage and is never returned by any endpoint, log or trace. Restrict where it may be sent with allowed_destinations.
For how this fits into a full workflow, see Credential vaults.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <key>: a private inference key (sk_live_...). See Authentication. |
syntic-beta | Yes, while in preview | agents-2026-11-01. Without it the call fails with 400 beta_required. See Versioning. |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Description |
|---|---|---|
vault_id | string | The vault id, starting with vlt_. |
name | string | 1 to 64 letters, digits, - and _. |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
value | string | Yes | The secret, up to 16 KB. |
allowed_destinations | array of strings | No | Host names, *. wildcards allowed. Strongly recommended. |
Response
200 OK, Content-Type: application/json
{
"name": "crm-token",
"hint": "…9f2a",
"allowed_destinations": [
"mcp.example.com"
],
"created_at": "2026-11-03T09:00:00Z",
"updated_at": "2026-11-05T09:00:00Z",
"last_used_at": "2026-11-05T10:00:03Z"
}Examples
curl -sS -X PUT https://app.syntic.ai/v1/vaults/vlt_01JC2B4D6F8H0K2M4P6R/secrets/crm-token \
-H "Authorization: Bearer $SYNTIC_API_KEY" \
-H "syntic-beta: agents-2026-11-01" \
-H "Content-Type: application/json" \
-d '{
"value": "crm_live_REPLACE_ME",
"allowed_destinations": [
"mcp.example.com"
]
}'Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 400 | invalid_request_error | invalid_secret_name | Disallowed characters. |
| 400 | invalid_request_error | secret_too_large | Value over 16 KB. |
| 403 | permission_error | role_required | The key’s creator is not an Administrator or Owner. |
| 404 | not_found_error | vault_not_found | No vault with that id in this workspace. |
| 401 | authentication_error | invalid_api_key | The key is missing, unknown, revoked or expired. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Who may call this
Creating vaults and writing or deleting secrets needs a key created by an Administrator or Owner. Any key in the workspace may list vaults and read secret names, so developers can wire up agents without ever handling values.
Each write records a vault.secret_written audit event; the value itself is never logged.
Related
Was this page helpful?