Skip to main content

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

EventEvent Identifier Description 
Drivers - Locationsagent.radar_locations.createdTriggered every minute, only if driver movement is detected.
Drivers - ETA updatesagent_eta_updatedTriggered whenever a driver's ETA is recalculated.
Deliveries - Assignedorder_assignedTriggered whenever a delivery is assigned to a driver.
Deliveries - Unassigned from Driverorder_unassignedTriggered whenever a delivery is unassigned from a driver.
Deliveries - Delivery Status Updatejob_delivery_status_updatedTriggered when a delivery's status changes, e.g. when it is accepted by the driver, picked up, completed, etc.
Deliveries - Order Status Updateorder_status_updatedTriggered every time the status of an order changes.
Items - Status Updateitem_status_updatedTriggered every time the preparation status of an item changes.
Analytics - Report Readyanalytics_report_readyTriggered 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.