Skip to main content
POST
https://api.bunship.com
/
api
/
v1
/
organizations
/
{orgId}
/
webhooks
Create Webhook Endpoint
curl --request POST \
  --url https://api.bunship.com/api/v1/organizations/{orgId}/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "description": "<string>",
  "events": [
    "<string>"
  ]
}
'
{
  "success": true,
  "data": {
    "id": "wh_abc123",
    "organizationId": "org_cld2abc123def456",
    "url": "https://example.com/webhooks/bunship",
    "description": "Production webhook handler",
    "events": ["member.added", "member.removed"],
    "secret": "whsec_abc123def456...",
    "isActive": true,
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}
Creates a new webhook endpoint for the organization. A signing secret is generated automatically and returned in the response. Store the secret securely — it is only shown once and is used to verify webhook signatures.

Auth

Requires a valid Bearer token. User must be a member of the organization.

Path Parameters

orgId
string
required
Organization identifier.

Request Body

url
string
required
Webhook delivery URL. Must be a valid HTTPS URI.
description
string
Description of what this webhook endpoint is used for.
events
string[]
Array of event types to subscribe to. If omitted or empty, the endpoint receives all events.

Response

Returns the created webhook endpoint including the signing secret.
{
  "success": true,
  "data": {
    "id": "wh_abc123",
    "organizationId": "org_cld2abc123def456",
    "url": "https://example.com/webhooks/bunship",
    "description": "Production webhook handler",
    "events": ["member.added", "member.removed"],
    "secret": "whsec_abc123def456...",
    "isActive": true,
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}

Example

curl -X POST https://api.bunship.com/api/v1/organizations/org_cld2abc123def456/webhooks \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/bunship",
    "description": "Production webhook handler",
    "events": ["member.added", "member.removed"]
  }'