API reference / Operations by tag
caps
Click, conversion and revenue caps with alerts and reconciliation.
11 operations. Base URL https://api.metrixed.com/v1; see authentication, errors and pagination.
Operations
| Method | Path | Summary |
|---|---|---|
| GET | /caps | List Caps |
| POST | /caps | Create Cap |
| GET | /caps/{id} | Get Cap |
| PATCH | /caps/{id} | Update Cap |
| DELETE | /caps/{id} | Delete Cap |
| POST | /caps/bulk/apply | Bulk edit apply |
| POST | /caps/bulk/preview | Bulk edit preview |
| GET | /caps/reconciliations | Redis vs ClickHouse cap reconciliation log |
| GET | /caps/report | Cap usage per cap x period (Redis live + ClickHouse reconciliation) |
| POST | /caps/search | Search Caps (advanced) |
| GET | /caps/status | Live cap usage and reset timers |
GET /caps
List Caps
Operation getCaps. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | |
page_size | query | integer | no | |
sort | query | string | no | field or -field |
include | query | string | no | comma-separated relationships |
filter | query | object (free-form) | no | |
q | query | string | no | free-text search |
curl 'https://api.metrixed.com/v1/caps?page=1&page_size=50' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"data": [
{}
],
"page": {}
}
POST /caps
Create Cap
Operation postCaps. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): CapCreate
| Field | Type | Flags | Description |
|---|---|---|---|
entity_type | enum: offer, offer_group, advertiser, partner, smartlink, goal, landing_page, tenant | required | |
entity_id | string | required | |
metric | enum: conversions, approved_conversions, pending_conversions, clicks, unique_clicks, gross_clicks, impressions, payout, pending_payout, revenue, pending_revenue, gross_revenue, ... | required | |
per_minute | string | decimal string | |
hourly | string | decimal string | |
daily | string | decimal string | |
weekly | string | decimal string | |
monthly | string | decimal string | |
lifetime | string | decimal string | |
partner_ids | array of string | ||
partner_cap_mode | enum: each, group | ||
is_apply_all_partners | boolean | ||
goal_id | string | ||
landing_page_ids | array of string | ||
geo | array of string | ||
visibility | enum: public, private | ||
on_reached | enum: redirect_blank, fallback_link, fail_traffic, pause_entity, block, notify | ||
is_soft_cap | boolean | ||
timezone | string | ||
is_enforce_caps | boolean | ||
date_valid_from | string (date) | ||
date_valid_to | string (date) | ||
status | string | ||
name | string | ||
fail_traffic_target | object (free-form) | type offer|offer_url|offer_group|smartlink, routing_value, reason_categories[] | |
alert_thresholds | array of integer | ||
notify_channels | array of string |
curl -X POST 'https://api.metrixed.com/v1/caps' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"entity_type":"offer","entity_id":"","metric":"conversions"}'
Example 201 response:
{
"external_ref": ""
}
GET /caps/{id}
Get Cap
Operation getCapsId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
curl 'https://api.metrixed.com/v1/caps/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"external_ref": ""
}
PATCH /caps/{id}
Update Cap
Operation patchCapsId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (application/json, required): CapUpdate
| Field | Type | Flags | Description |
|---|---|---|---|
entity_type | enum: offer, offer_group, advertiser, partner, smartlink, goal, landing_page, tenant | ||
entity_id | string | ||
metric | enum: conversions, approved_conversions, pending_conversions, clicks, unique_clicks, gross_clicks, impressions, payout, pending_payout, revenue, pending_revenue, gross_revenue, ... | ||
per_minute | string | decimal string | |
hourly | string | decimal string | |
daily | string | decimal string | |
weekly | string | decimal string | |
monthly | string | decimal string | |
lifetime | string | decimal string | |
partner_ids | array of string | ||
partner_cap_mode | enum: each, group | ||
is_apply_all_partners | boolean | ||
goal_id | string | ||
landing_page_ids | array of string | ||
geo | array of string | ||
visibility | enum: public, private | ||
on_reached | enum: redirect_blank, fallback_link, fail_traffic, pause_entity, block, notify | ||
is_soft_cap | boolean | ||
timezone | string | ||
is_enforce_caps | boolean | ||
date_valid_from | string (date) | ||
date_valid_to | string (date) | ||
status | string | ||
name | string | ||
fail_traffic_target | object (free-form) | type offer|offer_url|offer_group|smartlink, routing_value, reason_categories[] | |
alert_thresholds | array of integer | ||
notify_channels | array of string |
curl -X PATCH 'https://api.metrixed.com/v1/caps/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"entity_type":"offer","entity_id":"","metric":"conversions","per_minute":""}'
Example 200 response:
{
"external_ref": ""
}
DELETE /caps/{id}
Delete Cap
Operation deleteCapsId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
curl -X DELETE 'https://api.metrixed.com/v1/caps/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 204 response:
{
"ok": false
}
POST /caps/bulk/apply
Bulk edit apply
Operation postCapsBulkApply. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): BulkPatch
| Field | Type | Flags | Description |
|---|---|---|---|
ids | array of string | required | |
patches | array of object | required |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json BulkPreview |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/caps/bulk/apply' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"ids":[""],"patches":[{"field":"","value":{}}]}'
Example 200 response:
{
"affected": 0,
"changes": [
{}
],
"warnings": [
""
],
"token": ""
}
POST /caps/bulk/preview
Bulk edit preview
Operation postCapsBulkPreview. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): BulkPatch
| Field | Type | Flags | Description |
|---|---|---|---|
ids | array of string | required | |
patches | array of object | required |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json BulkPreview |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/caps/bulk/preview' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"ids":[""],"patches":[{"field":"","value":{}}]}'
Example 200 response:
{
"affected": 0,
"changes": [
{}
],
"warnings": [
""
],
"token": ""
}
GET /caps/reconciliations
Redis vs ClickHouse cap reconciliation log
Operation getCapsReconciliations. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | |
page_size | query | integer | no | |
sort | query | string | no | field or -field |
include | query | string | no | comma-separated relationships |
filter | query | object (free-form) | no | |
q | query | string | no | free-text search |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json LogSearchResult |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/caps/reconciliations?page=1&page_size=50' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"rows": [
{}
],
"next_cursor": "",
"has_more": false
}
GET /caps/report
Cap usage per cap x period (Redis live + ClickHouse reconciliation) Cap usage per cap x period (Redis live + ClickHouse reconciliation). WP-67: q matches the cap name or entity id; the whole usage snapshot is returned unless page is given; capped/cap when more than 10000 caps.
Operation getCapsReport. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
entity_type | query | string | no | |
entity_id | query | string | no | |
metric | query | string | no | |
q | query | string | no | |
page | query | string | no | |
page_size | query | string | no |
curl 'https://api.metrixed.com/v1/caps/report?page=1&page_size=50' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"data": [
{}
],
"timezone": "",
"generated_at": "1970-01-01T00:00:00.000Z"
}
POST /caps/search
Search Caps (advanced)
Operation postCapsSearch. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): SearchRequest
| Field | Type | Flags | Description |
|---|---|---|---|
filters | array of object | ||
search | string | ||
sort | array of object (free-form) | ||
page | integer | ||
page_size | integer | ||
include | array of string |
curl -X POST 'https://api.metrixed.com/v1/caps/search' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"filters":[{}],"search":"","sort":[{}],"page":0}'
Example 200 response:
{
"data": [
{}
],
"page": {}
}
GET /caps/status
Live cap usage and reset timers Live cap usage and reset timers. WP-67: q matches the cap name or entity id; the whole usage snapshot is returned unless page is given; capped/cap when more than 10000 caps.
Operation getCapsStatus. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | |
page_size | query | integer | no | |
sort | query | string | no | field or -field |
include | query | string | no | comma-separated relationships |
filter | query | object (free-form) | no | |
q | query | string | no | free-text search |
curl 'https://api.metrixed.com/v1/caps/status?page=1&page_size=50' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"data": [
{}
],
"timezone": "",
"generated_at": "1970-01-01T00:00:00.000Z"
}