Skip to content

Canonical POP API

Send POP events using the canonical (fixed) schema. Use this endpoint when your events match the standard POP structure.

Endpoint

http
POST /coatro/v1/pop/events

Description

Send canonical POP events using the fixed schema. You can send a single event or multiple events in one request.

Request Body

json
{
  "events": [
    {
      "eventId": "string",
      "screenId": "string",
      "siteId": "string",
      "campaignId": "string",
      "creativeId": "string",
      "playedAt": "string",
      "durationMs": 0,
      "impressions": {
        "ageBuckets": {
          "total": 0.0,
          "male": 0.0,
          "female": 0.0
        }
      },
      "context": {},
      "device": {}
    }
  ]
}

Request Schema

FieldTypeRequiredDescription
eventsarrayYesArray of POP event objects

POP Event Object

FieldTypeRequiredDescription
eventIdstringNoUnique identifier for the event
screenIdstringNoIdentifier for the screen
siteIdstringNoIdentifier for the site
campaignIdstringNoIdentifier for the campaign
creativeIdstringNoIdentifier for the creative
playedAtstringNoTimestamp when the content was played (ISO 8601 format)
durationMsintegerNoDuration in milliseconds
impressionsobjectNoImpression data with age buckets
contextobjectNoAdditional context data (any key-value pairs)
deviceobjectNoDevice information (any key-value pairs)

Impressions Object

FieldTypeDescription
ageBucketsobjectAge bucket data
ageBuckets.totalnumberTotal impressions
ageBuckets.malenumberMale impressions
ageBuckets.femalenumberFemale impressions

Example Request

bash
curl -X POST "http://localhost:8080/coatro/v1/pop/events" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "eventId": "evt-12345",
        "screenId": "screen-001",
        "siteId": "site-001",
        "campaignId": "campaign-001",
        "creativeId": "creative-001",
        "playedAt": "2025-01-27T10:00:00Z",
        "durationMs": 30000,
        "impressions": {
          "ageBuckets": {
            "total": 150.0,
            "male": 80.0,
            "female": 70.0
          }
        }
      }
    ]
  }'

Response

202 Accepted

Your events have been accepted and will be processed.

json
{
  "message": "Events accepted",
  "acceptedAt": "2025-01-27T10:00:00Z",
  "eventCount": 1
}

Response Schema

FieldTypeDescription
messagestringStatus message
acceptedAtstringTimestamp when events were accepted
eventCountintegerNumber of events accepted

Error Responses

  • 400 Bad Request - Invalid event data or missing required fields
  • 401 Unauthorized - Invalid or missing API key
  • 500 Internal Server Error - Server error

INFO

Canonical bulk ingestion endpoints will be available soon for processing large files with canonical POP events.