PostZen
Webhooks

Create a webhook

POST
/v1/webhooks

Creates an outbound webhook endpoint. A user may have up to 25 endpoints. This endpoint requires a read-write API key.

Authorization

bearerAuth
AuthorizationBearer <token>

PostZen API key.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/webhooks" \  -H "Content-Type: application/json" \  -d '{    "name": "Production events",    "url": "https://example.com/webhooks/postzen",    "events": [      "post.published",      "post.failed"    ],    "profileAccess": "all_profiles",    "secret": "customer-provided-secret"  }'
{  "message": "string",  "webhook": {    "id": "string",    "name": "string",    "url": "http://example.com",    "events": [      "post.published"    ],    "profileAccess": "all_profiles",    "profileIds": [      "string"    ],    "hasSigningSecret": true,    "customHeaderNames": [      "string"    ],    "isActive": true,    "disabledReason": "auto_consecutive_failures",    "consecutiveFailures": 0,    "lastDeliveredAt": "2019-08-24T14:15:22Z",    "lastFailedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
{  "error": "JSON body is required"}
{  "error": "Unauthorized"}
{  "error": "API key requires read_write permission"}
{  "error": "string"}
{  "error": "rate_limited",  "retryAfter": 30}
{  "error": "Failed to create post"}