Mail API reference

Mail API · Outbound-Webhooks

post/v1/workspaces/{workspace_id}/webhooks/default/rotate-secretAuth

Rotate the workspace-default webhook signing secret. Previous secret remains valid for 24h. Plaintext returned once. Deprecated: use `/webhooks/endpoints` instead. Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`; after 2027-01-15 this route returns 410. The slot is an ordinary endpoint (`legacy_slot` set) in `GET /webhooks/endpoints`.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Headers

Idempotency-Keystring

Opaque client-generated string (1–256 chars, `[A-Za-z0-9._:-]`) used to deduplicate retries within a 24h window. A retry with the same key and body returns the original response with `Idempotent-Replay: true`.

Response · 200

id*string · uuid
workspace_id*string · uuid
domain_id*string · uuid

Null for the workspace-default config; set for a per-domain override.

url*string · uri
event_types*array
signing_secret_hint*string

Last 4 chars of the active signing secret.

prev_signing_secret_active*boolean

True while a previous signing secret is still being honoured (24h grace after rotation).

prev_signing_secret_expires_at*string · date-time
disabled_at*string · date-time

Set when auto-disabled after sustained failure.

disabled_reason*string
consecutive_failures*number
created_at*string · date-time
updated_at*string · date-time
signing_secret*string

Plaintext signing secret. Returned once on create / rotate; never reconstructable.

Example

Request

POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/webhooks/default/rotate-secret
Authorization: Bearer YOUR_TOKEN

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "domain_id": "00000000-0000-0000-0000-000000000000",
  "url": "string",
  "event_types": [
    "string"
  ],
  "signing_secret_hint": "string",
  "prev_signing_secret_active": false,
  "prev_signing_secret_expires_at": "2026-01-01T00:00:00.000Z",
  "disabled_at": "2026-01-01T00:00:00.000Z",
  "disabled_reason": "string",
  "consecutive_failures": 0,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "signing_secret": "string"
}