24Metrics API Documentation (1)

Introduction

The API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Authentication

All requests to the API must be authenticated using an API key. To authenticate, add a API-KEY header to your request that contains your API Key.

  • For network administrators you can create individual API keys and find your API keys under Organization > API Access.
  • For all users you can use your own API key by going to Profile > Security > Enable API Access.

Status Codes

Code Summary Description
200 OK Everything worked as expected.
400 Bad Request The request was unacceptable, often due to missing a required parameter.
401 Unauthorized No valid API key provided.
402 Request Failed The parameters were valid but the request failed.
403 Forbidden The API key doesn't have permissions to perform the request.
404 Not Found The requested resource doesn't exist.
429 Too Many Requests Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500, 502, 503, 504 Server Errors Something went wrong on Server's end. (These are rare.)

Errors

We use conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a wrong data type is provided to a json field). Codes in the 5xx range indicate an error with our servers (these are rare).

Filtering

To filter the result you can use the filter query parameter. Format:

filter[field_name][operator] = value
  • field_name - is the field or property name. To filter a property within an object use dots such as filter[outer_field.inner_field]
  • operator - the operators used. If omitted, the default operator is eq.

Sorting

You can sort the result by adding sort query params like sort=-type,name. - will act for descending

Pagination

The API in general is using numbered pages except for Reports.

To paginate the result you can provide the following:

  • page[number] is the number of the page.
  • page[size] is the size of the page. The API max limit is 100.

In the response, meta.total_count shows the number of total objects and meta.total_page shows the number of total pages.

{
  "meta": {
    "total_count": 1000,
    "total_page": 50
  }
}

Example:

Go to the first page:

GET /api/v2/coffees?page[size]=100&page[number]=1

Go to the second page:

GET /api/v2/coffees?page[size]=100&page[number]=2

FraudDetection

Manage Filter Groups for Fraud detection.

List all filter groups

You can list all filter groups within an integration.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

Responses

Response Schema: application/json
Array of objects (csapi.FilterGroup)
object (csapi.ListMeta)

Response samples

Content type
application/json
{
}

Create a filter group

You can create a filter group within an integration.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

Request Body schema: application/json
required

A JSON object containing filter group information

active
boolean

When inactive, this filter group is not going to used.

advertiser_ids
Array of strings unique

A list of database ID of Clickshield advertisers that can use this filter group.

click_filter_preset_id
integer

The FilterPreset ID which is used to automatically populate the click filters.

conversion_filter_preset_id
integer

The FilterPreset ID which is used to automatically populate the conversion filters.

description
string

Description of the filter group.

Array of objects (filters.Filter)

The list of Filters to be used by the Gateway.

integration
required
string

Integration ID parent of this filter group.

monitoring_mode
boolean

MonitoringMode at filter group level. This takes precedence over Integration MonitoringMode.

name
required
string

Friendly name of the filter group.

offer_ids
Array of strings unique

A list of Clickshield offers external ID or any offer ID that can use this filter group.

organization
required
string

Organization parent of this filter group and integration.

priority
required
integer

Priority used during matching in Gateway. An Integration can have multiple filter groups and if there are multiple equal matches score found by the Gateway, then priority is going to be considered. Priority value is unique from other Filter group instances.

publisher_ids
Array of strings unique

A list of database ID of Clickshield publishers that can use this filter group.

rtb_enabled
boolean

RTBEnabled at filter group level. This takes precedence over Integration RTBEnabled.

tags
Array of strings <= 50 items

A list of tags that is be used to categorize the filter group.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Bulk delete filter groups

You can bulk delete filter groups.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

query Parameters
organization
string

The Organization ID of the filter group.

Request Body schema: application/json
required

An array of filter group IDs to delete

data
Array of strings

Responses

Response Schema: application/json
object (service.svcBulkDeleteResponse)

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{ }

Bulk update filter groups

You can bulk update the filter groups value.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

query Parameters
organization
string

The Organization ID of the filter group.

Request Body schema: application/json
required

An array of filter group IDs to update

data
Array of strings
monitoring_mode
boolean

Responses

Response Schema: application/json
object (service.svcPatchResponse)

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{ }

Read a filter group

You can read a filter group within an integration.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

filterGroupID
required
string

The Filter Group ID

Responses

Response Schema: application/json
object (csapi.FilterGroup)

Response samples

Content type
application/json
{
}

Delete a filter group

You can delete a filter group within an integration.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

filterGroupID
required
string

The Filter Group ID

Responses

Response Schema: application/json
object (service.svcDeleteResponse)

Response samples

Content type
application/json
{ }

Update a filter group

You can update a filter group within an integration.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

filterGroupID
required
string

The Filter Group ID

Request Body schema: application/json
required

A JSON object containing filter group information

active
boolean
advertiser_ids
Array of strings
click_filter_preset_id
integer
conversion_filter_preset_id
integer
description
string
Array of objects (filters.Filter)
monitoring_mode
boolean
name
string
offer_ids
Array of strings
priority
integer
publisher_ids
Array of strings
rtb_enabled
boolean
tags
Array of strings

Responses

Response Schema: application/json
object (service.svcPatchResponse)

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{ }

Reports

Pagination

The Reports API page[size] limit is only 100. If you need to quickly and efficiently export a massive amount of data, we recommend to use the Download Center Export APIs.

Reports API methods use cursor-based pagination through the page[after] and page[before] parameters. Both parameters accept an existing value in transaction ID format which matches the objects real_tx_id field.

The values to use can be found under pageInfo.startCursor and pageInfo.endCursor from the response and return objects in reverse chronological order. The page[before] parameter returns objects listed before object.real_tx_id. The page[after] parameter returns objects listed after object.real_tx_id. These parameters are mutually exclusive. You can use either the page[after] or page[before] parameter, but not both simultaneously.

  • data.pageInfo.startCursor is the cursor of first object in the current page.
  • data.pageInfo.endCursor is the cursor of the last object in the current page.
  • data.pageInfo.hasNextPage shows you if there is a next page.
  • data.pageInfo.hasPreviousPage shows you if there is a previous page.
GET /api/v2/reports/v2/conversion-table?page[size]=25&integration_id={integrationID}&start_date=2025-02-01&end_date=2025-02-27

Example response:

{
  "data": {
    "data": [
      {
        "real_tx_id": "ABC"
      },
      {
        "real_tx_id": "............"
      },
      {
        "real_tx_id": "XYZ"
      }
    ],
    "pageInfo": {
      "startCursor": "ABC",
      "endCursor": "XYZ",
      "hasPreviousPage": true,
      "hasNextPage": true
    }
  }
}

Fetch the next page by adding &page[after]=XYZ in the request.

GET /api/v2/reports/v2/conversion-table?page[size]=25&integration_id={integrationID}&start_date=2025-02-01&end_date=2025-02-27&page[after]=XYZ'

Example response:

{
  "data": {
    "data": [
      {
        "real_tx_id": "{startCursor}"
      },
      {
        "real_tx_id": "............"
      },
      {
        "real_tx_id": "{endCursor}"
      }
    ],
    "pageInfo": {
      "startCursor": "{startCursor}",
      "endCursor": "{endCursor}",
      "hasPreviousPage": true,
      "hasNextPage": true
    }
  }
}

Sorting

Sorting is NOT SUPPORTED. Objects are always are sorted in reverse chronological order.

Download Clicks

Use Download Center to export Clicks to a CSV file. Use Reporting filters to narrow down the data.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

query Parameters
delimiter
string

Delimiter to be used in CSV. Default is comma.

start_date
string <date>

start date

end_date
string <date>

end date

fields
required
string

The columns to include in the CSV

extra_parameters
required
string

The extra parameters data that will be converted as columns in the CSV

Responses

Response Schema: application/json
object (csapi.Artifact)
created_at
string
error
string
object

new csapi fields

object (report.CSVExportFormat)
id
required
string
integration
required
string
last_updated_by
string
organization
required
string
object

nolint: lll

requested_by
string
object (report.ReportsResultsMeta)
status
required
string
Enum: "PENDING" "IN_PROGRESS" "ERROR" "CANCELED" "COMPLETED"
type
required
string
updated_at
string

Response samples

Content type
application/json
{
}

Download Conversions

Use Download Center to export Conversions to a CSV file. Use Reporting filters to narrow down the data.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

query Parameters
delimiter
string

Delimiter to be used in CSV. Default is comma.

start_date
string <date>

start date

end_date
string <date>

end date

fields
required
string

The columns to include in the CSV

extra_parameters
required
string

The extra parameters data that will be converted as columns in the CSV

Responses

Response Schema: application/json
object (csapi.Artifact)
created_at
string
error
string
object

new csapi fields

object (report.CSVExportFormat)
id
required
string
integration
required
string
last_updated_by
string
organization
required
string
object

nolint: lll

requested_by
string
object (report.ReportsResultsMeta)
status
required
string
Enum: "PENDING" "IN_PROGRESS" "ERROR" "CANCELED" "COMPLETED"
type
required
string
updated_at
string

Response samples

Content type
application/json
{
}

Download Impressions

Use Download Center to export Impressions to a CSV file. Use Reporting filters to narrow down the data.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
integrationID
required
string

The Integration ID

query Parameters
delimiter
string

Delimiter to be used in CSV. Default is comma.

start_date
string <date>

start date

end_date
string <date>

end date

fields
required
string

The columns to include in the CSV

extra_parameters
required
string

The extra parameters data that will be converted as columns in the CSV

Responses

Response Schema: application/json
object (csapi.Artifact)
created_at
string
error
string
object

new csapi fields

object (report.CSVExportFormat)
id
required
string
integration
required
string
last_updated_by
string
organization
required
string
object

nolint: lll

requested_by
string
object (report.ReportsResultsMeta)
status
required
string
Enum: "PENDING" "IN_PROGRESS" "ERROR" "CANCELED" "COMPLETED"
type
required
string
updated_at
string

Response samples

Content type
application/json
{
}

Get Click

Get a single click given the query parameters. An error is returned if there is no match.

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
integration_id
required
string

The Integration ID

request_date
required
string <date>

The Click Time

offer
required
string

The Offer

publisher
required
string

The Publisher

tx_id
required
string

The Transaction ID

Responses

Response Schema: application/json
object (report.Click)

Response samples

Content type
application/json
{
}

Get Conversion or Event

Get a single conversion or event given the query parameters. An error is returned if there is no match.

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
integration_id
required
string

The Integration ID

request_date
required
string <date>

The Conversion Time

offer
required
string

The Offer

publisher
required
string

The Publisher

hash
required
string

The Hash

Responses

Response Schema: application/json
object (report.Conversion)

Response samples

Content type
application/json
{
}

Click Report

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
integration_id
required
string

The Integration ID

start_date
required
string <date>

Fetch data where request_time is starting from this date

end_date
required
string <date>

Fetch data where request_time is until this date

page[size]
required
integer

The number of items to return

page[before]
string

Fetch the previous data before this cursor

page[after]
string

Fetch the next data after this cursor

Responses

Response Schema: application/json
object (report.ClickTable)

Response samples

Content type
application/json
{
}

Conversion Report

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
integration_id
required
string

The Integration ID

start_date
required
string <date>

Fetch data where conversion_time is starting from this date

end_date
required
string <date>

Fetch data where conversion_time is until this date

page[size]
required
integer

The number of items to return

page[before]
string

Fetch the previous data before this cursor

page[after]
string

Fetch the next data after this cursor

Responses

Response Schema: application/json
object (report.ConversionTable)

Response samples

Content type
application/json
{
}

Impression Report

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
integration_id
required
string

The Integration ID

start_date
required
string <date>

Fetch data where request_time is starting from this date

end_date
required
string <date>

Fetch data where request_time is until this date

page[size]
required
integer

The number of items to return

page[before]
string

Fetch the previous data before this cursor

page[after]
string

Fetch the next data after this cursor

Responses

Response Schema: application/json
object (report.ImpressionTable)

Response samples

Content type
application/json
{
}

DownloadCenter

Get Download Center Export URL

Get the signed url for a download center file. You need this URL in order to download the file.

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
artifact_name
required
string

The Download Export object artifact name

Responses

Response Schema: application/json
url
string

Response samples

Content type
application/json
{
}

List Download Center Exports

List all the Download Center exports.

Authorizations:
ApiKeyAuthBearerAuth
query Parameters
filter[reports_query_option.filters.offer_id.equalvalues]
Array of strings

The offer IDs filter used in the exported data.

filter[reports_query_option.filters.publisher.equalvalues]
Array of strings

The publishers filter used in the exported data.

filter[reports_query_option.filters.advertiser.equalvalues]
Array of strings

The advertisers filter used in the exported data.

filter[reports_query_option.filters.integration_id.equalvalues]
Array of strings

The integration ID filter used in the exported data.

filter[reports_query_option.start_date]
string <date>

The start date filter used in the exported data. This is a string and date range logic does not apply. Use this if you know the exact start date filter used during the export.

filter[reports_query_option.end_date]
string <date>

The end date filter used in the exported data. This is a string and date range logic does not apply. Use this if you know the exact end date filter used during the export.

filter[status]
string
Enum: "UNKNOWN" "PENDING" "IN_PROGRESS" "ERROR" "CANCELED"

The report export status

filter[type]
string
Enum: "conversion_logs" "click_logs"

The report type

filter[results_meta.total][gte]
integer

Greater than or equals to the total number of rows of exported data.

filter[results_meta.total][lte]
integer

Less than or equals to the total number of rows of exported data.

filter[results_meta.duration_seconds][gte]
integer

Greater than or equals to the export completion time in seconds.

filter[results_meta.duration_seconds][lte]
integer

Less than or equals to the export completion time in seconds.

Responses

Response Schema: application/json
Array of objects (report.DownloadCenterExport)
object (csapi.ListMeta)

Response samples

Content type
application/json
{
}

Get Download Center Export

Get the Download Center export object.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
exportID
required
string

The Export ID

Responses

Response Schema: application/json
object (report.DownloadCenterExport)

Response samples

Content type
application/json
{
}

Delete Download Center Export

Delete the Download Center export object and the associated file.

Authorizations:
ApiKeyAuthBearerAuth
path Parameters
exportID
required
string

The Export ID

Responses

Response Schema: application/json
object (service.svcDeleteResponse)

Response samples

Content type
application/json
{ }