Create a webhook
POST /webhooks
/webhooksRegisters a URL of yours to be called whenever one of the chosen events happens in an audience (marketing scope) or in the CRM of the account (crm scope). Each delivery is signed with the secret you give.
Scope: A webhook is either marketing or crm. A marketing webhook receives the events of one audience (members, campaigns, automations and SMS) and needs audience. A crm webhook receives the events of contacts, companies and opportunities of the whole account and has no audience. The two kinds of events are never mixed in one webhook, and scope cannot change after the webhook is created.
When to use: To keep another system in sync with an audience, for example to learn when someone subscribes, unsubscribes or opens a campaign; or with the CRM, to learn when a contact, company or opportunity is created, updated or deleted.
When not to use: To change an existing webhook use update_webhook.
Side effects: From now on, every matching event in the audience (or, for crm, in the account) is sent to the URL. A failed delivery is attempted up to 3 times in total, with growing waits between attempts.
Permissions: Requires the manager role or higher, or the account.integrations.manage capability.
Value for the X-Auth-Token header parameter.
In: header
The new Webhook resource
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/webhooks" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "scope": "marketing", "title": "string", "event_types": [ "member_subscribed" ], "url": "http://example.com", "secret": "string", "active": true, "audience": "/entity/1" }'{ "id": 0, "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "scope": "marketing", "title": "string", "event_types": [ "member_subscribed" ], "url": "http://example.com", "secret": "string", "active": true, "audience": "/entity/1", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}