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

# Create Secret

`POST /secrets`

## Request

- Base URL: `https://api.mengi.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mengi.cloud/secrets`
- Auth: none declared

Create a new secret.

The secret is stored in OpenBao - nothing is stored in our database.

## Request body

- SecretCreate
  - `name` string, required
  - `value` string, nullable
  - `generate` boolean
  - `deployment_id` string, uuid, nullable
  - `organization_id` string, uuid, nullable

## Response `201`

Successful Response

- SecretResponse
  - `name` string, required
  - `key` string, required
  - `deployment_id` string, nullable
  - `database_id` string, nullable
  - `organization_id` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/4ae9b375cdbb?raw)
