Widget signing secret

GET /widget-signing-secret

Get the organization's widget signing secret, the key you sign a customer's email with before an authenticated widget can read their data. There is one per organization, and it is created the first time you ask for it.

Requires the settings:read permission.

Request
curl \
  "https://api.cascade.dev/widget-signing-secret" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "secret": "string",
  "endsWith": "string",
  "generatedAt": "2025-01-15T09:30:00Z",
  "lastUsedAt": "2025-01-15T09:30:00Z",
  "createdAt": "2025-01-15T09:30:00Z"
}

POST /widget-signing-secret/rotate

Generate a new widget signing secret. The old one stops working right away, so every storefront still signing with it needs the new value before its shoppers can sign in again. The rotation is recorded in the audit trail.

Requires the settings:write permission.

Request
curl \
  -X POST \
  "https://api.cascade.dev/widget-signing-secret/rotate" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "secret": "string",
  "endsWith": "string",
  "generatedAt": "2025-01-15T09:30:00Z",
  "lastUsedAt": "2025-01-15T09:30:00Z",
  "createdAt": "2025-01-15T09:30:00Z"
}