Skip to main content
POST
/
inbound
/
courier
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: 'My API Key',
});

const response = await client.inbound.trackEvent({
  event: 'New Order Placed',
  messageId: '4c62c457-b329-4bea-9bfc-17bba86c393f',
  properties: { order_id: 123, total_orders: 5, last_order_id: 122 },
  type: 'track',
  userId: '1234',
});

console.log(response.messageId);
{
  "messageId": "1-65f240a0-47a6a120c8374de9bcf9f22c"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
event
string
required

A descriptive name of the event. This name will appear as a trigger in the Courier Automation Trigger node.

Example:

"New Order Placed"

messageId
string
required

A required unique identifier that will be used to de-duplicate requests. If not unique, will respond with 409 Conflict status

Example:

"4c62c457-b329-4bea-9bfc-17bba86c393f"

properties
object
required
type
enum<string>
required
Available options:
track
userId
string | null

The user id associatiated with the track

Response

messageId
string
required

A successful call returns a 202 status code along with a requestId in the response body.

Example:

"1-65f240a0-47a6a120c8374de9bcf9f22c"