Create a webhook
Create a webhook and associated subscriptions.
Required scopes: webhook:read-write
.
curl --request POST \
--url https://api.attio.com/v2/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"target_url": "https://example.com/webhook",
"subscriptions": [
{
"event_type": "note.created",
"filter": {
"$and": [
{
"field": "parent_object_id",
"operator": "equals",
"value": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
}
]
}
}
]
}
}'
{
"data": {
"target_url": "https://example.com/webhook",
"subscriptions": [
{
"event_type": "note.created",
"filter": {
"$and": [
{
"field": "parent_object_id",
"operator": "equals",
"value": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
}
]
}
}
],
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"webhook_id": "23e42eaf-323a-41da-b5bb-fd67eebda553"
},
"status": "active",
"created_at": "2023-04-27T13:22:49.061281000Z",
"secret": "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
}
}
Authorizations
This API uses OAuth 2.0 with the authorization code grant flow.
Body
URL where the webhook events will be delivered to.
"https://example.com/webhook"
One or more events the webhook is subscribed to.
Type of event the webhook is subscribed to.
comment.created
, comment.resolved
, comment.unresolved
, comment.deleted
, list.created
, list.updated
, list.deleted
, list-attribute.created
, list-attribute.updated
, list-entry.created
, list-entry.updated
, list-entry.deleted
, object-attribute.created
, object-attribute.updated
, note.created
, note.updated
, note.deleted
, record.created
, record.merged
, record.updated
, record.deleted
, task.created
, task.updated
, task.deleted
, workspace-member.created
"note.created"
Filters to determine whether the webhook event should be sent. If null, the filter always passes.
{
"$and": [
{
"field": "parent_object_id",
"operator": "equals",
"value": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
}
]
}
Response
Success
URL where the webhook events will be delivered to.
"https://example.com/webhook"
One or more events the webhook is subscribed to.
Type of event the webhook is subscribed to.
comment.created
, comment.resolved
, comment.unresolved
, comment.deleted
, list.created
, list.updated
, list.deleted
, list-attribute.created
, list-attribute.updated
, list-entry.created
, list-entry.updated
, list-entry.deleted
, object-attribute.created
, object-attribute.updated
, note.created
, note.updated
, note.deleted
, record.created
, record.merged
, record.updated
, record.deleted
, task.created
, task.updated
, task.deleted
, workspace-member.created
"note.created"
Filters to determine whether the webhook event should be sent. If null, the filter always passes.
{
"$and": [
{
"field": "parent_object_id",
"operator": "equals",
"value": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
}
]
}
The state of the webhook. Webhooks marked as active and degraded will receive events, inactive ones will not. If a webhook remains in the degraded state for 7 days, it will be marked inactive.
active
, degraded
, inactive
"active"
When the webhook was created.
"2023-04-27T13:22:49.061281000Z"
The key which is used to sign the webhook events. This is only shown when setting up the webhook initially.
"ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
Was this page helpful?
curl --request POST \
--url https://api.attio.com/v2/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"target_url": "https://example.com/webhook",
"subscriptions": [
{
"event_type": "note.created",
"filter": {
"$and": [
{
"field": "parent_object_id",
"operator": "equals",
"value": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
}
]
}
}
]
}
}'
{
"data": {
"target_url": "https://example.com/webhook",
"subscriptions": [
{
"event_type": "note.created",
"filter": {
"$and": [
{
"field": "parent_object_id",
"operator": "equals",
"value": "97052eb9-e65e-443f-a297-f2d9a4a7f795"
}
]
}
}
],
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"webhook_id": "23e42eaf-323a-41da-b5bb-fd67eebda553"
},
"status": "active",
"created_at": "2023-04-27T13:22:49.061281000Z",
"secret": "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
}
}