Webhooks

Webhooks

Webhooks are a way to subscribe to events that happen in the system. Currently the following events are supported:

Event NameDescription
proposal_acceptedRaised when a proposal is accepted
proposal_archivedRaised when a proposal is archived
proposal_createdRaised when a proposal is created
proposal_callbackRaised when a callback is requested on a proposal
proposal_liveRaised when a proposal is published
proposal_payment_intent_succeededRaised when a payment intent is confirmed by Stripe Connect
proposal_viewedRaised when a proposal is viewed
proposal_restoredRaised 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"}'