GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelogLog In
Guides

API Response

Introduction

Our APIs respond with data, errors, and metadata blocks where appropriate. For example:

  • metadata appears only for paginated responses,

  • A response expected to return multiple entities may contain both data and errors blocks,

  • Entity IDs are unique across all Retail Media entities.

Response example

{
    "data": [
        {
            "type": "{entityType}",
            "id": "{entityId}",
            "attributes": {
                "{fieldName}": {numericValue},
                "{fieldName}": "{stringValue}",
                // ...
            }
        },
   
        // ...
   
        {...}
    ],
    "errors": [
        {
            "traceId": "{traceId}",
            "type": "{errorType}",
            "code": "{errorCode}",
            "instance": "{uri}",
            "title": "{errorTitle}",
            "detail": "{errorDetail}",
            "source": {
                "{fieldName}": "{fieldPath}",
                // ...
            }
        },
 
        // ...
         
        {...}
    ],
    "metadata": {
        "totalItemsAcrossAllPages": {numberOfEntities},
        "currentPageSize": {pageSize},
        "currentPageIndex": {pageIndex},
        "totalPages": {numberOfPages},
        "nextPage": "https://{endpoint}?pageIndex={pageIndex}&pageSize={pageSize}",
        "previousPage": "https://{endpoint}?pageIndex={pageIndex}&pageSize={pageSize}"
    }
}

Data Attributes

AttributeTypeDescription
idstringUnique ID for the entity. Entity IDs are unique across all Retail Media entities
typestringType of entity
attributesobjectEntity attributes - may be omitted entirely if an entity does not have additional attributes

Error Attributes

AttributeTypeDescription
traceIdstringUnique ID for the error response
typestringType of error; machine-readable (e.g. validation)
codestringShort machine-readable string for the error (e.g. required-field)
instancestringURI referencing the endpoint that caused the error
titlestringShort human-readable string that summarizes the issue
detailstringHuman-readable explanation of the issue
sourceobjectObject referencing the field that caused the error

Pagination

  • Pagination is supported via query parameters for a subset of endpoints that list multiple entities.

  • Results are returned in ascending order by id

  1. List all Accounts associated with your API credentials

  2. List all Brands associated with the Account

  3. List all Retailers associated with the Account

  4. List all Campaigns within the Account

  5. List all Line Items within the Campaign

  6. List all Promoted Products on the Line Item

  7. List all Balances on the Account

  8. List all Campaigns on the Balance

Query ParametersTypeDescription
pageIndexintegerReturns the specified page of results given a pageSize; pages are 0-indexed
pageSizeintegerSpecifies the maximum number of entities returned in a single page; defaults to 25 entities per page
limitToIdintegerLimits results to the entity IDs specified; parameter key is repeated, e.g. limitToId=1&limitToId=2

HTTP Response Codes

ResponseDescription
🔵 200 OKRequest successful
🔵 201 CreatedThe new entity was successfully created
🔵 204 No ContentRequest succeeded and no returned content should be expected
🟡 207 Multi-StatusThis may occur when operating on multiple entities, such as the call resulting in some successes but also some failures
🔴 400 Bad RequestFor improper syntax, check your call structure
🔴 401 UnauthorizedIf unauthenticated, refresh your access token
🔴 403 ForbiddenInsufficient rights to perform this action
🔴 404 Not FoundResource not found, check your entity IDs in the call
🔴 408 TimeoutRequest timed out
🔴 409 ConflictRequest conflicts with something, such as a campaign name that already exists
🔴 429 Too Many RequestsToo many requests
🔴 5xxSomething's wrong on Criteo's end...