---
title: "Update secret"
method: PATCH
path: "/v2/aihub/secrets"
tags: ["secrets"]
---

# Update secret

`PATCH /v2/aihub/secrets`

Update the description, value, or allowed workspaces for a secret. If a value for a parameter is not specified, it will remain the same.

<Note>Only organization admins can update secrets.</Note>

## Headers

- `Authorization` string, required
- `IB-Context` string

## Request body

- object
  - `alias` string, required — Name of the secret to update.
  - `description` string — New description of the secret.
  - `value` string — New content of the secret.
  - `allowed_workspaces_type` 'ALL' | 'SOME' | 'NONE' — New designation of which workspaces in this organization are allowed to use this secret in custom functions.
  - `allowed_workspaces` string[] — New designation of which workspaces are allowed to use this secret, if only some are.

## Response `200`

Secret updated successfully.

- SecretsUpdateSecretResponse200 — Empty response body

---

[API](https://skmtc.net/instabase/apis/api-reference.md) · [All operations](https://skmtc.net/instabase/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/instabase/api-reference/revisions/3a4f46d48141/schema)
