---
title: "Set Secret"
method: POST
path: "/secrets/{name}"
---

# Set Secret

`POST /secrets/{name}`

## Request

- Base URL: `https://api-docs.session-exchange.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.session-exchange.com/secrets/{name}`
- Auth: none declared

Admin, or a producer holding a write grant on `name`: encrypt `value` under the TENANT's
DEK and emit secret.set. Optional `if_version` makes it a compare-and-swap (409
`version_conflict`); it is REQUIRED for CAS_SECRETS (`router-routes`), whose value must also
pass the routing-table validation, incl. the fleet table's adapter-owner preservation (#62).

## Path parameters

- `name` string, required

## Request body

- object

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/session-exchange/apis/a4sx.md) · [All operations](https://skmtc.dev/session-exchange/apis/a4sx/llms.txt) · [OpenAPI document](https://skmtc.dev/session-exchange/apis/a4sx/revisions/abaefc33dfc7?raw)
