Skip to main content
POST
/
api
/
secrets
Create a new secret
curl --request POST \
  --url https://api.example.com/api/secrets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "STRIPE_API_KEY",
  "value": "sk_live_...",
  "isReserved": false,
  "expiresAt": "2023-11-07T05:31:56Z"
}
'
{
"success": true,
"message": "Secret STRIPE_API_KEY has been created successfully",
"id": "123e4567-e89b-12d3-a456-426614174000"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
key
string
required

Unique key identifier (uppercase letters, numbers, underscores only)

Example:

"STRIPE_API_KEY"

value
string
required

Secret value to be encrypted

Example:

"sk_live_..."

isReserved
boolean
default:false

Whether the secret is protected from deletion

expiresAt
string<date-time> | null

Optional expiration date for the secret

Response

Secret created successfully

success
boolean
message
string
id
string<uuid>