---
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.
  - `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** `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/42240c74704e/schema)
