Vault

Create a new vault secret

POST
/api/vault

Create a new WorkOS Vault secret scoped to the caller's organization. Returns 409 if a secret with the same name already exists - use /api/vault/upsert for create-or-update semantics.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/vault" \  -H "Content-Type: application/json" \  -d '{    "name": "TWILIO_AUTH_TOKEN",    "value": "sk_live_REDACTED",    "workosOrganizationId": "org_01HXYZ123ABCDEFG"  }'
{  "success": true,  "message": "Secret created successfully",  "data": {    "name": "TWILIO_AUTH_TOKEN"  }}