Skip to main content
POST
/
v2
/
events
Report events
curl --request POST \
  --url https://api.topsort.com/v2/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "impressions": [
    {
      "occurredAt": "2023-11-07T05:31:56Z",
      "opaqueUserId": "<string>",
      "id": "<string>",
      "resolvedBidId": "<string>",
      "entity": {
        "id": "<string>",
        "type": "product"
      },
      "placement": {
        "path": "<string>",
        "position": 2,
        "page": 2,
        "pageSize": 2,
        "productId": "<string>",
        "categoryIds": [
          "<string>"
        ],
        "searchQuery": "<string>"
      },
      "additionalAttribution": {
        "id": "<string>",
        "type": "product"
      },
      "page": {
        "type": "home",
        "pageId": "<string>",
        "value": "electronics"
      },
      "object": {
        "type": "listing",
        "assetId": "<string>",
        "clickType": "product"
      },
      "externalCampaignId": "<string>",
      "externalVendorId": "<string>",
      "deviceType": "desktop",
      "channel": "onsite"
    }
  ],
  "clicks": [
    {
      "occurredAt": "2023-11-07T05:31:56Z",
      "opaqueUserId": "<string>",
      "id": "<string>",
      "resolvedBidId": "<string>",
      "entity": {
        "id": "<string>",
        "type": "product"
      },
      "placement": {
        "path": "<string>",
        "position": 2,
        "page": 2,
        "pageSize": 2,
        "productId": "<string>",
        "categoryIds": [
          "<string>"
        ],
        "searchQuery": "<string>"
      },
      "additionalAttribution": {
        "id": "<string>",
        "type": "product"
      },
      "page": {
        "type": "home",
        "pageId": "<string>",
        "value": "electronics"
      },
      "object": {
        "type": "listing",
        "assetId": "<string>",
        "clickType": "product"
      },
      "clickType": "product",
      "externalCampaignId": "<string>",
      "externalVendorId": "<string>",
      "deviceType": "desktop",
      "channel": "onsite"
    }
  ],
  "purchases": [
    {
      "occurredAt": "2023-11-07T05:31:56Z",
      "opaqueUserId": "<string>",
      "items": [
        {
          "productId": "<string>",
          "unitPrice": 123,
          "quantity": 1,
          "vendorId": "<string>"
        }
      ],
      "id": "<string>",
      "deviceType": "desktop",
      "channel": "onsite"
    }
  ],
  "pageviews": [
    {
      "page": {
        "type": "home",
        "pageId": "<string>",
        "value": "electronics"
      },
      "occurredAt": "2023-11-07T05:31:56Z",
      "opaqueUserId": "<string>",
      "id": "<string>",
      "deviceType": "desktop",
      "channel": "onsite"
    }
  ]
}
'
{
  "errCode": "bad_request",
  "docUrl": "<string>",
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Body

application/json

Event data including impressions, clicks, purchases, and page views.

A batch request containing multiple events to be reported to Topsort.

impressions
Impression · object[]

An array of impression events

Maximum array length: 50
clicks
Click · object[]

An array of click events

Maximum array length: 50
purchases
Purchase · object[]

An array of purchase events

Maximum array length: 50
pageviews
Page View · object[]

An array of page views

Maximum array length: 50

Response

All events were reported successfully.