---
title: "Update app secrets"
method: PATCH
path: "/api/apps/{handle}/{appId}/secrets"
---

# Update app secrets

`PATCH /api/apps/{handle}/{appId}/secrets`

## Request

- Base URL: `https://reduck.ai`
- URL: `https://reduck.ai/api/apps/{handle}/{appId}/secrets`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Set or unset an app's secrets, several at a time.

## Path parameters

- `handle` string, required: The owner a resource is addressed under: "@username" for a personal scope, or a bare slug for a project.
- `appId` string, uuid, required

## Request body

- object
  - `secrets` object, required: Each name maps to `null` to remove that secret, a string to set its value, or an object setting its value, its page access, or both. Names you do not mention are left alone. Sending page access on its own changes an existing secret without re-sending the credential, and does nothing at all for a name that does not exist yet; sending a value on its own leaves that secret's page access as it was. A secret created here is closed to the page unless you open it. The whole batch either lands or does not.

## Response `200`

OK

- AppSecrets
  - `secrets` AppSecret[], required
    - `name` string, required
    - `required` boolean, required: Whether the image's manifest says the app needs this one. False for a name the manifest never declared: nothing in the app asks for it, so nothing breaks without it.
    - `pageUsable` boolean, required: Whether a request triggered from the app's page may spend this secret. A task, the app's own server-side code, may spend every one of them regardless.

## Other responses

- `400`: Invalid request
- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found
- `503`: This environment has no key to seal secrets under, so a write here could never be read back.

---

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