Webhook Responses
Affinity webhooks allow you to be notified of events that happen in your Affinity instance. Below are some example responses for each type of webhook.
Note: Payload responses are formatted the same for each webhook event (created, updated, deleted) except for ones noted.
Organization
Note: Organization merged webhook has a different response.
{ "type": "organization.created", "body": { "id": 64779194, "name": "Affinity", "domain": "affinity.co", "domains": [ "affinity.co" ], "crunchbase_uuid": null, "global": true }, "sent_at": 1636645351 }
Organization Merged
{ "type": "organization.merged", "body": { "changer": { "id": 38706, "type": 1, "first_name": "John", "last_name": "Doe", "primary_email": "john@affinity.co", "emails": [] }, "removed_company": { "id": 64779194, "name": "Affinity", "domain": "affinity.co", "domains": [ "affinity.co" ], "crunchbase_uuid": null, "global": true }, "company": { "id": 64779195, "name": "Affinity 2", "domain": "affinity.co", "domains": [ "affinity.co" ], "crunchbase_uuid": null, "global": false }, "merged_at": "2021-11-15 13:45:16 -0800" }, "sent_at": 1637012717 }
Person
Note:organization_ids
is not returned when an Person
is deleted.
{ "type": "person.created", "body": { "id": 38706, "type": 0, "first_name": "John", "last_name": "Doe", "primary_email": "john@affinity.co", "emails": [], "organization_ids": [] }, "sent_at": 1636645209 }
Opportunity
Note: organization_ids
and person_ids
is not returned when an Opportunity
is deleted.
{ "type": "opportunity.created", "body": { "id": 7460748, "name": "Amazon - Project A", "person_ids": [], "organization_ids": [] }, "sent_at": 1636645558 }
List
{ "type": "list.created", "body": { "id": 450, "ip_address": "208.253.143.17" }, "sent_at": 1636642627 }
List Entry
{ "type": "list_entry.created", "body": { "id": 16367, "list_id": 450, "creator_id": 38706, "entity_id": 287125, "entity_type": 1, "created_at": "2021-11-11 06:58:31 -0800", "entity": { "id": 84547971, "type": 1, "first_name": "John", "last_name": "Doe", "primary_email": "jdoe@jdoe.com", "emails": [ "jdoe@jdoe.com", "jdoe2@jdoe2.com" ] } }, "sent_at": 1636642712 }
Field
{ "type": "field.created", "body": { "id": 59, "name": "Deals Amount", "list_id": 11, "value_type": 3, "allows_multiple": false, "track_changes": false, "dropdown_options": [], "ip_address": "206.253.143.17" }, "sent_at": 1636644238 }
Field Value
{ "type": "field_value.created", "body": { "id": 250616, "field_id": 337, "list_entry_id": null, "entity_type": 38706, "value_type": 5, "entity_id": 91407761, "value": { "city": "San Francisco", "state": "California", "country": "United States", "continent": null, "street_address": null }, "field": { "id": 318500, "name": "Location", "list_id": null, "value_type": 5, "allows_multiple": false, "track_changes": false, "dropdown_options": [] } }, "sent_at": 1636635565 }
Notes
{ "type": "note.created", "body": { "id": 22984, "creator_id": 860197, "person_ids": [ 38706, 89734 ], "is_meeting": false, "organization_ids": [], "opportunity_ids": [], "parent_id": null, "content": "Had a lunch meeting with Jane and John today.", "created_at": "2021-11-11 07:21:10 -0800", "ip_address": "206.253.143.17" }, "sent_at": 1636644072 }
File
{ "type": "file.created", "body": { "id": 43212, "name": "JohnDoeFriends.csv", "size": 993, "person_id": 10, "organization_id": null, "opportunity_id": null, "created_at": "2021-11-11 07:54:36 -0800", "uploader_id": 64056952, }, "sent_at": 1636646078 }