Webhooks
Webhooks
Webhooks are a way to subscribe to events that happen in the system. Currently the following events are supported:
Event Name | Description |
---|---|
proposal_accepted | Raised when a proposal is accepted |
proposal_archived | Raised when a proposal is archived |
proposal_created | Raised when a proposal is created |
proposal_callback | Raised when a callback is requested on a proposal |
proposal_live | Raised when a proposal is published |
proposal_payment_intent_succeeded | Raised when a payment intent is confirmed by Stripe Connect |
proposal_viewed | Raised when a proposal is viewed |
proposal_restored | Raised when an archived proposal is restored |
Webhooks require authorization headers as per the authorization section.
Creating a webhook subscription is done by sending a POST request to the /api/webhook
endpoint. The body of the request should be a json object with an event
and a hookUrl
e.g:
curl -X POST https://example.api.pxmo.com/api/webhook \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-type: application/json' \ -H 'Accept: application/json' \ -d '{"event": "proposal_accepted", "hookUrl": "https://example.com/my-webhook-endpoint"}'
Deleting a webhook subscription is done by sending a DELETE request to the /api/webhook
endpoint. The body of the request should be a json object with an event
and a hookUrl
e.g:
curl -X DELETE https://example.api.pxmo.com/api/webhook \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-type: application/json' \ -H 'Accept: application/json' \ -d '{"event": "proposal_accepted", "hookUrl": "https://example.com/my-webhook-endpoint"}'