---
title: "Update a secret"
method: PATCH
path: "/secrets/{secret_id}"
tags: ["Secrets"]
---

# Update a secret

`PATCH /secrets/{secret_id}`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/secrets/{secret_id}`
- Auth: API key in header `Authorization`

Rotates the value or edits the metadata of an existing secret. A secret's name and owning site are fixed at creation; `site_ids` applies to shared secrets only.

## Path parameters

- `secret_id` string, required

## Request body

- object
  - `value` string: Replacement value. Omit to leave it untouched.
  - `description` string: Human-readable note about what this secret is for.
  - `site_ids` string[]: Sites a shared secret applies to. Empty leaves it dormant — stored, but injected nowhere.
  - `egress_host` string: Host the in-chat agent may call with this secret injected server-side. The value itself is never exposed to the model.
  - `egress_header` string: Header the secret rides in when calling `egress_host` (e.g. Authorization).

## Response `200`

The updated secret (value masked)

- Secret
  - `object` string, required
  - `id` string, required
  - `name` string, required
  - `target` string, required
  - `scope` string, required
  - `site_id` string, nullable, required
  - `site_ids` object, required
  - `description` string, nullable, required
  - `egress_host` string, nullable, required
  - `egress_header` string, nullable, required
  - `egress_placement` string, required
  - `egress_signing` object, required
  - `egress_default_headers` object, required
  - `last4` string, required
  - `value` string, nullable, required
  - `created_at` string, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `404`: Resource not found
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.
- `500`: Internal server error

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
