Webhooks
Webhooks notify your application when events happen in Driftwood — contacts created, companies updated, activities logged, etc. Configure an HTTPS endpoint and select which events to subscribe to.
The Webhook Object
Section titled “The Webhook Object”| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier for the webhook endpoint |
account_id | uuid | ID of the account that owns the endpoint |
created_by | uuid | ID of the user who created the endpoint |
url | string | Destination URL that event payloads are POSTed to |
description | string | Free-form description of the endpoint |
secret_prefix | string | Non-sensitive prefix of the signing secret, shown for identification |
events | string[] | Event types this endpoint subscribes to; an empty list receives all events One of: contact.created, contact.updated, contact.deleted, company.created, company.updated, company.deleted, project.created, project.updated, project.deleted, deal.created, deal.updated, deal.deleted, partnership.created, partnership.updated, partnership.deleted, activity.created, activity.updated, activity.deleted, source.created, source.updated, source.archived |
is_active | bool | Whether the endpoint is active and will receive deliveries |
created_at | datetime | Timestamp the endpoint was created, ISO 8601 |
updated_at | datetime | Timestamp the endpoint was last updated, ISO 8601 |
Create a webhook endpoint
Section titled “Create a webhook endpoint”Endpoint: webhooks-create
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Destination URL that event payloads will be POSTed to; must start with http:// or https:// |
description | string | No | Free-form description of the endpoint |
events | string[] | Yes | Event types to subscribe to; an empty list subscribes to all events One of: contact.created, contact.updated, contact.deleted, company.created, company.updated, company.deleted, project.created, project.updated, project.deleted, deal.created, deal.updated, deal.deleted, partnership.created, partnership.updated, partnership.deleted, activity.created, activity.updated, activity.deleted, source.created, source.updated, source.archived |
curl -X POST https://api.driftwoodapp.com/api/webhooks-create \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "...", "events": []}'Delete a webhook endpoint
Section titled “Delete a webhook endpoint”Endpoint: webhooks-delete
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the webhook endpoint to delete |
curl -X POST https://api.driftwoodapp.com/api/webhooks-delete \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "..."}'List deliveries for a webhook endpoint
Section titled “List deliveries for a webhook endpoint”Endpoint: webhooks-deliveries
| Field | Type | Required | Description |
|---|---|---|---|
endpoint_id | string | Yes | ID of the webhook endpoint whose deliveries to list |
limit | int | No | Maximum number of delivery records to return |
curl -X POST https://api.driftwoodapp.com/api/webhooks-deliveries \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"endpoint_id": "..."}'Get a webhook endpoint by ID
Section titled “Get a webhook endpoint by ID”Endpoint: webhooks-get
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the webhook endpoint to retrieve |
curl -X POST https://api.driftwoodapp.com/api/webhooks-get \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "..."}'List webhook endpoints
Section titled “List webhook endpoints”Endpoint: webhooks-list
Update a webhook endpoint
Section titled “Update a webhook endpoint”Endpoint: webhooks-update
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the webhook endpoint to update |
url | string? | No | Updated destination URL; must start with http:// or https:// |
description | string? | No | Updated description of the endpoint |
events | string[] | No | Replacement list of subscribed event types One of: contact.created, contact.updated, contact.deleted, company.created, company.updated, company.deleted, project.created, project.updated, project.deleted, deal.created, deal.updated, deal.deleted, partnership.created, partnership.updated, partnership.deleted, activity.created, activity.updated, activity.deleted, source.created, source.updated, source.archived |
is_active | bool? | No | Whether the endpoint is active and should receive deliveries |
curl -X POST https://api.driftwoodapp.com/api/webhooks-update \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"id": "..."}'Error Codes
Section titled “Error Codes”| Code | Description |
|---|---|
webhooks.url_required | Url required |
webhooks.invalid_url | Invalid url |
webhooks.invalid_id | Invalid id |
webhooks.not_found | Not found |