Skip to content

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.

POST /customer-events
FieldTypeRequiredDescription
customerExternalIdstringCustomer’s externalId
typestringEvent name, snake.dot format (order.placed, trial.started) — [a-z0-9_.], 100 chars max
payloadobjectFree-form data for the event
occurredAtstring (ISO-8601)Event timestamp — default: now(). Allows antidating for historical imports
curl
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" }
}'
Node.js
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' },
}),
});
Python (requests)
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'},
},
)
PHP (curl)
$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);
{
"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"
}

Using a consistent domain.action format keeps timelines readable:

  • order.placed, order.shipped, order.cancelled
  • subscription.started, subscription.upgraded, subscription.cancelled
  • payment.succeeded, payment.failed
  • auth.signup, auth.login, auth.password_changed
HTTP codeBusiness codeCause
400VALIDATION_ERRORInvalid type (forbidden chars, too long) or non-ISO occurredAt
404CUSTOMER_NOT_FOUNDexternalId matches no customer

See Errors.