---
title: "Create a new secret"
method: POST
path: "/v1/secrets"
tags: ["Secrets"]
---

# Create a new secret

`POST /v1/secrets`

Create a new secret in your organization. The secret value will be encrypted and stored securely.

## Request body

- CreateSecretRequest — Request body for creating a new secret
  - `type` 'cookie' | 'key-value' | 'totp', required — Type of secret
  - `key` string, required — User-defined name for the secret
  - `value` string, required — The secret value to store
  - `sensitive` boolean, required — Whether the secret should be treated as sensitive
  - `note` string, required — Optional note about the secret

## Response `201`

Secret created successfully

- object
  - `id` string, required — The unique identifier of the created secret

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Invalid or missing API key
- `409` — Conflict - Secret name already exists
- `500` — Internal Server Error

---

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