---
title: "Create Secret"
method: POST
path: "/v1/secrets"
tags: ["Secrets"]
---

# Create Secret

`POST /v1/secrets`

Create a secret.

## Request body

- CreateSecretRequest — CreateSecretRequest is the request of CreateSecret.
  - `id` string — Secret identifier.
  - `labels` object — Secret labels.
  - `scopes` Scope[]
  - `secret_data` string, byte, required — The secret data. Must be Base64-encoded.

## Response `201`

Secret created

- CreateSecretResponse — CreateSecretResponse is the response of CreateSecret.
  - `secret` Secret — Defines the secret resource.
    - `id` string — Secret identifier.
    - `labels` object — Secret labels.
    - `scopes` Scope[]

## Other responses

- `401` — Unauthenticated.
- `500` — Internal Server Error. Reach out to support.
- `default` — An unexpected error response.

## Changes

- **2025-06-03** `a210961eeca2` — 3 warning, 1 info
  - removed the optional property `id` from the response with the `201` status
  - removed the optional property `labels` from the response with the `201` status
  - removed the optional property `scopes` from the response with the `201` status
  - added the optional property `secret` to the response with the `201` status
- **2025-05-27** `dfa71f9d277e` — 3 breaking, 1 warning, 3 info
  - removed the enum value `SCOPE_AI_AGENT` of the request property `scopes/items/`
  - removed the enum value `SCOPE_AI_GATEWAY` of the request property `scopes/items/`
  - removed the enum value `SCOPE_MCP_SERVER` of the request property `scopes/items/`
  - removed the optional property `secret` from the response with the `201` status
  - …3 more

[Change history](https://skmtc.dev/redpanda-data/apis/redpanda-cloud-data-plane-api/changes/v1/secrets/post.md)

---

[API](https://skmtc.dev/redpanda-data/apis/redpanda-cloud-data-plane-api.md) · [All operations](https://skmtc.dev/redpanda-data/apis/redpanda-cloud-data-plane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/redpanda-data/redpanda-cloud-data-plane-api/revisions/a797fd06fd45/schema)
