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

# Create a new secret

`POST /api/secrets`

Create a new encrypted secret with a unique key

## Request body

- object
  - `key` string, required — Unique key identifier (uppercase letters, numbers, underscores only)
  - `value` string, required — Secret value to be encrypted
  - `isReserved` boolean — Whether the secret is protected from deletion
  - `expiresAt` string, date-time, nullable — Optional expiration date for the secret

## Response `201`

Secret created successfully

- object
  - `success` boolean
  - `message` string
  - `id` string, uuid

## Other responses

- `400` — Invalid input
- `409` — Secret already exists

---

[API](https://skmtc.net/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.net/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/versions/a935bb49f932/schema)
