---
title: "Create secret"
method: POST
path: "/v2/aihub/secrets"
tags: ["secrets"]
---

# Create secret

`POST /v2/aihub/secrets`

Create a new secret in this organization.

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

## Headers

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

## Request body

- object
  - `alias` string, required — Name of the secret.
  - `description` string — Description of the secret.
  - `value` string, required — Content of the secret.
  - `allowed_workspaces_type` 'ALL' | 'SOME' | 'NONE', required — Which workspaces in this organization are allowed to use this secret in custom functions.
  - `allowed_workspaces` string[] — Which workspaces are allowed to use this secret, if only some are allowed. Required when `allowed_workspaces_type` is `SOME`, otherwise ignored.

## Response `200`

Secret created successfully.

- SecretsCreateSecretResponse200 — 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)
