Webhooks
Overview
Captain.AI has the capability to send your application notifications any time certain events happens on your account. This happens in the form of a HTTP request being sent to an endpoint on your server when something on the system happens. They all have a common shape which is documented on the 'Common Data' page.
Supported Events
Event | Event Identifier | Description |
---|---|---|
Drivers - Locations | agent.radar_locations.created | Triggered every minute, only if driver movement is detected. |
Drivers - ETA updates | agent_eta_updated | Triggered whenever a driver's ETA is recalculated. |
Deliveries - Assigned | order_assigned | Triggered whenever a delivery is assigned to a driver. |
Deliveries - Unassigned from Driver | order_unassigned | Triggered whenever a delivery is unassigned from a driver. |
Deliveries - Delivery Status Update | job_delivery_status_updated | Triggered when a delivery's status changes, e.g. when it is accepted by the driver, picked up, completed, etc. |
Deliveries - Order Status Update | order_status_updated | Triggered every time the status of an order changes. |
Items - Status Update | item_status_updated | Triggered every time the preparation status of an item changes. |
Analytics - Report Ready | analytics_report_ready | Triggered when you request a report via the API and it has finished generating. |
Setup Guide
Please contact your account manager to have webhooks setup for your account.
We only support one URL for all webhooks, with one exception being the "Item - Status Update" webhook (item_status_updated
). This should be a dedicated endpoint on your system that is set up to receive webhook notifications and it must support HTTPS/SSL. Please ensure your server is correctly set up for this and can receive messages from external sources.
Responding to a webhook correctly
To acknowledge receipt of a webhook, your endpoint should return a 2xx HTTP status code
. All response codes outside this range, including 3xx codes
, will indicate to Captain that you did not receive the webhook. Captain will ignore any other information returned in the request headers or request body.
Retry Policy
The webhooks will retry up to 15 times with an exponential backoff.