Skip to Content
TimeToCargo

Create webhook

Download OpenAPI
POST
/v2/webhooks

Creates a webhook for your account.

The response data includes a signing secret (22 characters from the base64url alphabet: A–Z, a–z, 0–9, -, _). The secret is shown only in this response and is not returned when the webhook is read later, so store it securely immediately.

For each delivery, TimeToCargo sends a POST request to your callback_url. The request contains a WebhookOutgoingPayload JSON object and these headers:

  • x-timetocargo-signature — HMAC SHA-256 signature of timestamp + '.' + rawBody, prefixed with sha256=;
  • x-timetocargo-timestamp — Unix timestamp used to generate the signature;
  • x-timetocargo-event-id — unique event ID matching payload.id;
  • x-timetocargo-delivery-id — unique delivery attempt ID.

Authorization

api_key
queryapi_key<token>

Request Body

application/json
  1. body
callback_url*string

URL where TimeToCargo will send webhooks

Formaturi
is_active?boolean

Whether the webhook receives regular events. You can send a test delivery to an inactive webhook.

Defaulttrue
event_types?array<>

Event types to deliver. If omitted, the webhook receives all public event types. tracking.test is always available for test deliveries.

Items1 <= items

Response Body

OK

application/json
  1. response
success*boolean

Whether processing succeeded. For tracking results, also check status: success=true does not mean data was found.

data*|null
status*string

Request execution status

Value in"OK""WRONG_PARAMS""UNEXPECTED_ERROR""INFO_NOT_FOUND""LINE_IS_UNDER_MAINTENANCE""LINE_NO_RESPONSE""API_KEY_WRONG""API_KEY_LIMIT_REACHED""API_KEY_RATE_LIMIT""LOW_BALANCE""SERVICE_UNAVAILABLE""NOT_FOUND"
status_description*|

Status description

Example Request
curl -X POST 'https://tracking.timetocargo.com/v2/webhooks' \  -H 'Content-Type: application/json' \  -d '{  "callback_url": "https://example.com/webhooks/timetocargo",  "is_active": true,  "event_types": [    "tracking.eta_update",    "tracking.history_update",    "tracking.info_found",    "tracking.info_not_found",    "tracking.auto_archiving",    "tracking.delivered"  ]}'
{  "success": true,  "data": {    "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",    "callback_url": "https://example.com/webhooks/timetocargo",    "is_active": true,    "event_types": [      "tracking.eta_update",      "tracking.history_update",      "tracking.info_found",      "tracking.info_not_found",      "tracking.auto_archiving",      "tracking.delivered"    ],    "created_at": "2026-07-08T09:39:36.311Z",    "updated_at": "2026-07-08T13:10:43.554Z",    "secret": "AaBbCcDdEe-_0123456789"  },  "status": "OK",  "status_description": "Request completed successfully"}