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

# Create Secret

`POST /v1/secrets`

## Request body

- SecretCreate
  - `description` string, nullable
  - `name` string, required — 2-64 characters: lowercase letters, digits, '-' and '_', starting and ending with a letter or digit. Prefixes the platform uses for its own secrets are rejected.
  - `value` string, required — Stored encrypted; never returned.

## Response `201`

Successful Response

- SecretResponse — A secret's metadata. The value is never part of this.
  - `created_at` string, nullable
  - `description` string, nullable
  - `id` string, uuid, required
  - `name` string, required — Unique within the workspace.
  - `owner` SecretOwner — The connection a managed secret belongs to.
    - `field` string, nullable — Which slot on the owner this fills — an env var, a header name.
    - `id` string, required — Its id, for deep-linking to it.
    - `name` string, nullable — Its display name, or null when the owner no longer exists.
    - `type` string, required — Kind of owner, e.g. mcp_instance or provider_config.
  - `updated_at` string, nullable
  - `used_by` SecretConsumer[]
    - `consumer_id` string, required — Id of the using entity.
    - `consumer_type` string, required — Kind of thing using the secret, e.g. provider_config.
    - `field` string, required — Which slot on that entity — a header name, an env var.

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-30** `99cf61829c55` — 1 info
  - added the optional property `owner` to the response with the `201` status
- **2026-08-30** `42240c74704e` — 1 info
  - endpoint added

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

---

[API](https://skmtc.dev/agentarea/apis/agentarea-api.md) · [All operations](https://skmtc.dev/agentarea/apis/agentarea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agentarea/agentarea-api/revisions/99cf61829c55/schema)
