# Generate Secret

**POST /api/v2/guest/secret/generate**

Creates a new secret with a randomly generated value. Accepts optional password generation parameters (length, character sets), TTL, recipient email, and share domain. Returns the receipt and secret records with share URLs.


## Servers
- Aotearoa New Zealand: https://nz.onetimesecret.com (Aotearoa New Zealand)
- Canada: https://ca.onetimesecret.com (Canada)
- Europe: https://eu.onetimesecret.com (Europe)
- United Kingdom: https://uk.onetimesecret.com (United Kingdom)
- United States: https://us.onetimesecret.com (United States)
- Development: http://localhost:3000 (Development)



## Parameters



### Body: application/json (object)

- **secret** (object)



## Responses
### 200
Successful response

#### Body: application/json (object)
- **user_id** (string)

- **shrimp** (string)

- **record** (object)

- **details** (object)


### 400
Bad Request - Invalid request parameters or body

#### Body: application/json (object)
- **error** (string)
  ADR-013: user-facing message (V2+). On frozen V1 this is the error type identifier.

- **error_type** (string)
  Machine-readable error class the client branches on (ADR-013, e.g., "RecordNotFound")

- **message** (string)
  Human-readable error message (legacy/V1 shape)

- **field** (string)
  Field that caused the error, if applicable

- **error_id** (string)
  Unique error tracking identifier

- **request_id** (string)
  Request correlation id; mirrors the x-request-id response header and appears in the server request log. Quote this when reporting an error.


### 404
Not Found - Resource does not exist

#### Body: application/json (object)
- **error** (string)
  ADR-013: user-facing message (V2+). On frozen V1 this is the error type identifier.

- **error_type** (string)
  Machine-readable error class the client branches on (ADR-013, e.g., "RecordNotFound")

- **message** (string)
  Human-readable error message (legacy/V1 shape)

- **field** (string)
  Field that caused the error, if applicable

- **error_id** (string)
  Unique error tracking identifier

- **request_id** (string)
  Request correlation id; mirrors the x-request-id response header and appears in the server request log. Quote this when reporting an error.


### 422
Unprocessable Entity - Validation failed

#### Body: application/json (object)
- **error** (string)
  ADR-013: user-facing message (V2+). On frozen V1 this is the error type identifier.

- **error_type** (string)
  Machine-readable error class the client branches on (ADR-013, e.g., "RecordNotFound")

- **message** (string)
  Human-readable error message (legacy/V1 shape)

- **field** (string)
  Field that caused the error, if applicable

- **error_id** (string)
  Unique error tracking identifier

- **request_id** (string)
  Request correlation id; mirrors the x-request-id response header and appears in the server request log. Quote this when reporting an error.


### 429
Too Many Requests - Rate limit exceeded

#### Body: application/json (object)
- **error** (string)
  ADR-013: user-facing message (V2+). On frozen V1 this is the error type identifier.

- **error_type** (string)
  Machine-readable error class the client branches on (ADR-013, e.g., "RecordNotFound")

- **message** (string)
  Human-readable error message (legacy/V1 shape)

- **field** (string)
  Field that caused the error, if applicable

- **error_id** (string)
  Unique error tracking identifier

- **request_id** (string)
  Request correlation id; mirrors the x-request-id response header and appears in the server request log. Quote this when reporting an error.


### 500
Internal Server Error - Something went wrong

#### Body: application/json (object)
- **error** (string)
  ADR-013: user-facing message (V2+). On frozen V1 this is the error type identifier.

- **error_type** (string)
  Machine-readable error class the client branches on (ADR-013, e.g., "RecordNotFound")

- **message** (string)
  Human-readable error message (legacy/V1 shape)

- **field** (string)
  Field that caused the error, if applicable

- **error_id** (string)
  Unique error tracking identifier

- **request_id** (string)
  Request correlation id; mirrors the x-request-id response header and appears in the server request log. Quote this when reporting an error.



[Powered by Bump.sh](https://bump.sh)
