---
title: "Set function secret"
method: PUT
path: "/v1/functions/{functionId}/secrets/{key}"
tags: ["Functions"]
---

# Set function secret

`PUT /v1/functions/{functionId}/secrets/{key}`

Create or update a secret on a function. Marks the function out-of-sync; the next `POST /deploy` re-publishes the Lambda with the new env. Keys must match `[A-Z_][A-Z0-9_]*` (uppercase env-var style) and cannot start with reserved prefixes (AWS_, LAMBDA_, etc).

## Path parameters

- `functionId` string, required
- `key` string, required

## Request body

- object
  - `value` string, required

## Response `200`

Secret updated.

- object

## Other responses

- `201` — Secret created.
- `400` — Invalid key or value.
- `401` — Unauthorized.

---

[API](https://skmtc.net/zavudev/apis/zavu-unified-messaging-layer-api.md) · [All operations](https://skmtc.net/zavudev/apis/zavu-unified-messaging-layer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zavudev/zavu-unified-messaging-layer-api/versions/07b87b6ae707/schema)
