Skip to Content
Webhooks

Create a project webhook subscription

Creates an active webhook subscription starting at the current project journal sequence. The generated signing secret is returned once in the response.

POST
/api/projects/{projectId}/webhooks

Authorization

headerAuthorizationBearer <Postdot API key>

A user-owned Postdot API key sent as Authorization: Bearer <token>. Its project scope is limited by the creator’s current access.

Path Parameters

projectId*string
Length1 <= length

Request Body

  1. body
url*string

Destination HTTPS URL for webhook deliveries. Private, loopback, and link-local destinations are rejected unless explicitly permitted by instance network policy.

Length1 <= length <= 2048
events*array<>

Project event types this subscription listens to.

Items1 <= items

Response Body

Response for status 201

application/json
  1. response
webhook*
secret*string

The signing secret for this webhook. It is returned only once on creation.

Length1 <= length
Example Request
curl -X POST 'https://postdot.example/api/projects/string/webhooks' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "string",
  "events": [
    "post.created"
  ]
}'
Example Response
{
  "webhook": {
    "id": "string",
    "projectId": "string",
    "url": "string",
    "events": [
      "post.created"
    ],
    "state": "active",
    "pausedReason": "string",
    "cursorSequence": 0,
    "secretVersion": 1,
    "previousSecretExpiresAt": 0,
    "createdByActorId": "string",
    "updatedByActorId": "string",
    "createdAt": 0,
    "updatedAt": 0
  },
  "secret": "string"
}

Was this page helpful?