Trawl API reference

Trawl API · Webhooks

post/v1/workspaces/{workspace_id}/webhooksAuth

Create a workspace webhook. The response includes the signing secret in clear EXACTLY ONCE — copy it now.

Deprecated: use `/v1/workspaces/{workspace_id}/webhooks/endpoints` (event filter, event descriptions, Send test that reports the result, event log, replay, rotation with a grace period). Responses carry `Deprecation: true` and `Sunset: Fri, 15 Jan 2027 00:00:00 GMT`.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Headers

Idempotency-Keystring

Stripe-style idempotency key. The signing secret is returned exactly once; a retry without this header creates a second webhook + secret. 24h TTL.

Request body

url*string

Destination URL (https required in prod).

activeboolean

Disabled webhooks are never delivered to.

Response · 201 Webhook created. Includes plaintext `signing_secret` exactly once.

id*string · uuid
workspace_id*string · uuid
url*string
active*boolean

Whether it receives events (`enabled` on the new routes).

failure_count*number

Failed deliveries in a row (`consecutive_failures` on the new routes).

last_status_code*number

HTTP status of the latest attempt.

last_attempt_at*string · date-time

When the latest attempt was made.

auto_disabled_at*string · date-time

Set when it was switched off automatically after sustained failures.

first_failure_at*string · date-time
created_at*string · date-time
secret_setboolean

Always true: every webhook has a signing secret.

signing_secret*string

Plaintext signing secret (`whsec_…`), returned EXACTLY ONCE. Persist immediately; it does not appear on later reads.

Example

Request

POST https://api.trawl.productcraft.co/v1/workspaces/{workspace_id}/webhooks
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "url": "string",
  "active": false
}

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "url": "string",
  "active": false,
  "failure_count": 0,
  "last_status_code": 0,
  "last_attempt_at": "2026-01-01T00:00:00.000Z",
  "auto_disabled_at": "2026-01-01T00:00:00.000Z",
  "first_failure_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "secret_set": false,
  "signing_secret": "string"
}