Customer events
Push business events (order.placed, subscription.upgraded, invoice.paid, …) from your backend to enrich a customer’s timeline. These events give agents valuable context when handling a ticket.
Endpoint
Section titled “Endpoint”POST /customer-events| Field | Type | Required | Description |
|---|---|---|---|
customerExternalId | string | ✅ | Customer’s externalId |
type | string | ✅ | Event name, snake.dot format (order.placed, trial.started) — [a-z0-9_.], 100 chars max |
payload | object | — | Free-form data for the event |
occurredAt | string (ISO-8601) | — | Event timestamp — default: now(). Allows antidating for historical imports |
Example
Section titled “Example”curl -X POST https://supportdesk.innovartx.com/api/v1/customer-events \ -H "X-API-Key: $SUPPORTDESK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "customerExternalId": "user_42", "type": "order.placed", "payload": { "orderId": "ord_9001", "total": 149.9, "currency": "USD" } }'await fetch('https://supportdesk.innovartx.com/api/v1/customer-events', { method: 'POST', headers: { 'X-API-Key': process.env.SUPPORTDESK_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ customerExternalId: 'user_42', type: 'order.placed', payload: { orderId: 'ord_9001', total: 149.9, currency: 'USD' }, }),});import os, requests
requests.post( 'https://supportdesk.innovartx.com/api/v1/customer-events', headers={'X-API-Key': os.environ['SUPPORTDESK_API_KEY']}, json={ 'customerExternalId': 'user_42', 'type': 'order.placed', 'payload': {'orderId': 'ord_9001', 'total': 149.9, 'currency': 'USD'}, },)$ch = curl_init('https://supportdesk.innovartx.com/api/v1/customer-events');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode([ 'customerExternalId' => 'user_42', 'type' => 'order.placed', 'payload' => ['orderId' => 'ord_9001', 'total' => 149.9, 'currency' => 'USD'], ]), CURLOPT_HTTPHEADER => [ 'X-API-Key: ' . getenv('SUPPORTDESK_API_KEY'), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true,]);curl_exec($ch);curl_close($ch);Response
Section titled “Response”{ "success": true, "data": { "id": "clzzzzz", "customerId": "clxxxxxx", "type": "order.placed", "payload": { "orderId": "ord_9001", "total": 149.9, "currency": "USD" }, "occurredAt": "2026-04-18T10:00:00Z", "createdAt": "2026-04-18T10:00:00Z" }, "timestamp": "2026-04-18T10:00:00Z"}Recommended conventions
Section titled “Recommended conventions”Using a consistent domain.action format keeps timelines readable:
order.placed,order.shipped,order.cancelledsubscription.started,subscription.upgraded,subscription.cancelledpayment.succeeded,payment.failedauth.signup,auth.login,auth.password_changed
Errors
Section titled “Errors”| HTTP code | Business code | Cause |
|---|---|---|
400 | VALIDATION_ERROR | Invalid type (forbidden chars, too long) or non-ISO occurredAt |
404 | CUSTOMER_NOT_FOUND | externalId matches no customer |
See Errors.