How it works
- Create a webhook via
POST /api/v2/webhooks. You receive a plaintext HMAC secret in the response — save it securely, it is returned only once. - Link one or more alert configurations to the webhook (via
alertIdson creation, or later viaPOST /api/v2/webhooks/{id}/link-alert). Alternatively, setisGlobal: trueto receive all alerts for your company. - When a linked alert fires, Telemax sends an HTTP
POSTto your URL with a signed JSON payload.
Payload shape
| Field | Type | Description |
|---|---|---|
| alertType | string | Human-readable alert type label |
| vehicleId | integer | Legacy vehicle ID |
| vehicleName | string | Vehicle display name |
position.lat / position.lng | number | GPS coordinates at trigger |
| direction | integer | Heading in degrees (0–359) |
| timestamp | datetime | UTC trigger time |
| address | object | null | Reverse-geocoded location |
| data | object | null | Type-specific payload (see below) |
Type-specific data payloads
The data field carries additional context depending on alertType:
Geofence
data is null.
Supported alert types
Webhooks can be linked to alert configurations with the following type IDs (as returned byGET /api/v2/companies/{id}/alerts): 1, 2, 5, 8, 9, 10. A maximum of 50 alert configurations can be linked to a single webhook.
Request headers
Every delivery includes two headers:| Header | Description |
|---|---|
| X-Telemax-Signature | sha256=<hex> — HMAC-SHA256 signature of the raw request body |
| X-Telemax-Delivery | UUID uniquely identifying this delivery attempt |
Verifying the signature
ComputeHMAC-SHA256(secret, rawBody) and compare the hex digest to the value after sha256= in X-Telemax-Signature. Always compare using a constant-time function to prevent timing attacks.
Global vs alert-scoped webhooks
Global (isGlobal: true) | Alert-scoped | |
|---|---|---|
| Fires for | All alert types across the company and sub-companies | Only the linked alert configurations |
alertIds required | No | Yes (at least one) |
| Mixed payload types | Yes — data shape varies per alert | Predictable if only one type is linked |
When multiple alert types are linked to one webhook,
data will have different structures per delivery. The alertType field tells you which shape to expect. Consider using one webhook per alert type for simpler integration.Delivery retries
Telemax retries failed deliveries (non-2xx response or connection error) with exponential backoff. Respond with a2xx status as quickly as possible — perform any heavy processing asynchronously. Idempotency is guaranteed via X-Telemax-Delivery: the same UUID will not be delivered more than once per attempt window.
Managing webhooks
Create
POST /api/v2/webhooks
List
GET /api/v2/webhooks
Get
GET /api/v2/webhooks/
Update
PUT /api/v2/webhooks/
Delete
DELETE /api/v2/webhooks/
Link alert
POST /api/v2/webhooks//link-alert