Live-Event-Ad-Playbook

IAB Tech Lab

Live Event Ad Playbook (LEAP)

Common API Conventions Reference

Table of Contents


Overview

This document establishes common conventions and standards applicable to all Live Event Ad Playbook (LEAP) APIs. API-specific details, including endpoints, query parameters, and examples, are documented in separate API specification files.


Cross-API Identity Correlation

Purpose

The Forecast API supports pre-event planning, and the Concurrent Streams API reports near-real-time stream counts. Implementers may correlate the same live event across these APIs, OpenRTB transactions, and downstream reporting by preserving a consistent, agreed identifier.

Equally Valid Correlation Methods

Either of the following may serve as the cross-API join key; neither is inherently preferred:

  1. Content ID — content.id: Match the same publisher-provided Content ID across the Forecast API, Concurrent Streams API, and OpenRTB when its assignment and scope are understood and the value is consistently preserved. A Content ID is not automatically universal across unrelated publishers or sellers.

  2. Extended Content ID — content.data[].cids[]: Match an Extended Content ID together with the associated data[].name identifying its source. Comparing only the CID string without its originating source can create false matches. This approach is useful when participants have different local content.id values but recognize the same external content identifier.

Both methods may appear in a response; neither requires the other to be present. When both are supplied but identify different content, implementers should resolve the discrepancy rather than silently treating the records as equivalent.

Example Field Paths

Context Content ID Extended Content ID
Forecast API events[].content.id events[].content.data[].cids[]
Concurrent Streams API streamsdata[].mediastreams[].content.id streamsdata[].mediastreams[].content.data[].cids[]
OpenRTB app app.content.id app.content.data[].cids[]
OpenRTB site site.content.id site.content.data[].cids[]

For Extended Content IDs, the corresponding data[].name must also be used to identify the source. The paths above describe existing content objects, not new LEAP fields.

Illustrative Matching Values

{
  "id": "event-content-12345",
  "data": [
    {
      "name": "id-provider.example",
      "cids": ["shared-content-id-12345"]
    }
  ]
}

This represents the content object portion of an illustrative API response or bid request. Either identifier may support correlation independently, provided the participating systems preserve it consistently.

Additional Implementation Considerations

Naming Conventions

Establishes foundational naming rules for resources, fields, and parameters across all APIs.

Resource Naming

Field Naming


HTTP Methods

Defines how HTTP verbs map to operations on API resources.

GET - Retrieve resources (idempotent, safe)

POST - Create resources (non-idempotent)

PUT - Replace entire resource (idempotent)

PATCH - Partial update (idempotent)

DELETE - Remove resource (idempotent)


Authentication

Specifies security mechanisms for API access and authorization.

Authentication protocol is left to the discretion of the event creator or API provider and should be discussed with API users before implementation. OAuth 2.0 is a common way to support secure API access and is recommended for consideration, but it is not required or prescribed by this guidance.


Request and Response Formats

Defines data structure, encoding, and format conventions for API communication.

Content Type

application/json; charset=utf-8

Date/Time Format

API field timestamps follow their specs (Unix milliseconds); ISO 8601 may be used only for human-readable rendering unless an API explicitly defines otherwise.

Field Conventions

Response Headers

Content-Type: application/json; charset=utf-8
X-Request-ID: {uuid}
X-RateLimit-Limit: {number}
X-RateLimit-Remaining: {number}
X-RateLimit-Reset: {timestamp}

Collection Response Structure

Illustrative, not the LEAP API response schema

{
  "data": [ ... ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 1234,
    "hasmore": true
  }
}

Status Codes

Follow standard HTTP status codes per RFC 7231.

Success (2xx)

Client Errors (4xx)

Server Errors (5xx)


Error Handling

Defines standardized error response structure and common error codes.

Standard Error Response

{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "field": "string",
        "issue": "string"
      }
    ],
    "requestid": "string"
  }
}

Common Error Codes

Best Practices


Pagination

Defines standard approach for handling large result sets.

Query Parameters

Response Structure

Illustrative, not the LEAP API response schema

{
  "data": [ ... ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 1234,
    "hasmore": true
  }
}

Pagination Fields


Versioning

Defines API evolution and backward compatibility strategy.

Strategy

URI-based versioning with major version in base path (e.g., /v1/, /v2/).

Version Policy


Rate Limiting

Defines request throttling policies to protect API resources and ensure fair usage.

Default Thresholds

Response Headers

X-RateLimit-Limit: {number}
X-RateLimit-Remaining: {number}
X-RateLimit-Reset: {timestamp}

429 Response

{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Retry after {seconds} seconds.",
    "requestid": "..."
  }
}

Includes Retry-After: {seconds} header.

Best Practices


Sorting

Defines standard approach for ordering result sets.

Query Parameters

Example

GET /resources?sort=createddate&order=desc