CC matchers cc-matches
Conditions that identify requests in CC protection; reusable across rule groups.
Pick an endpoint to see its example call on the right.
Authentication
Send the X-API-Key header (create a key on the API Keys page; the key is shown only once at creation). An Authorization: Bearer token obtained by logging in also works.
X-API-Key
Authentication failures return 401; forbidden returns 403 (code such as insufficient_scope).
Conventions
Paging uses page (from 1) and page_size; sort with sort=field or sort=-field.
Times are RFC 3339 (UTC); amounts are in cents.
Writes return 200/201/204 on success; duplicates of a unique key return 409.
/api/v2/cc-matchesList CC matchers
Authentication: User (some parameters admin only)
Query parameters
| Field | Type | Description |
|---|---|---|
page | integer | Page number, starting from 1 |
page_size | integer | Items per page |
sort | string | Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id` |
tenant_id | integer | Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data |
name | string | Filter by name substring. |
owner | string | platform = platform objects only; tenant = tenant objects only. |
/api/v2/cc-matchesCreate CC matcher
Authentication: User (some parameters admin only)
Request body application/json
| Field | Type | Description |
|---|---|---|
des | string | Remark; empty if omitted (omitting it on update also clears it, since the update replaces the whole object). |
nameRequired | string | Name |
when | object | Rule DSL condition: a combination of all/any/not, or a leaf {f, op, v, set, neg}; validated by the server and errors are returned as 422 (field is a JSON Pointer, code is the lowercase DSL error code). null = match everything. |
/api/v2/cc-matches/replayReplay a CC matcher draft
Authentication: User (some parameters admin only)
Request body application/json
| Field | Type | Description |
|---|---|---|
site_id | integer | Count this site's traffic only; omitted = every site visible to the caller. |
when | object | Rule DSL condition: a combination of all/any/not, or a leaf {f, op, v, set, neg}; validated by the server and errors are returned as 422 (field is a JSON Pointer, code is the lowercase DSL error code). null = match everything. |
/api/v2/cc-matches/{id}Get CC matcher
Authentication: User (some parameters admin only)
/api/v2/cc-matches/{id}Update CC matcher
Authentication: User (some parameters admin only)
Request body application/json
| Field | Type | Description |
|---|---|---|
des | string | Remark; empty if omitted (omitting it on update also clears it, since the update replaces the whole object). |
nameRequired | string | Name |
when | object | Rule DSL condition: a combination of all/any/not, or a leaf {f, op, v, set, neg}; validated by the server and errors are returned as 422 (field is a JSON Pointer, code is the lowercase DSL error code). null = match everything. |
/api/v2/cc-matches/{id}Delete CC matcher
Authentication: User (some parameters admin only)
CC matchers object
| Field | Type | Description |
|---|---|---|
builtin | boolean | Built-in object; cannot be deleted. |
created_at | string | Created at |
des | string | Remark; empty if omitted (omitting it on update also clears it, since the update replaces the whole object). |
hits | integer | Requests matched in the window (restored by sample_weight). |
id | integer | Record ID |
ips | integer | Distinct client IPs among the matched requests (a distinct count, not restored by sample weight). |
name | string | Name |
reason | string | Explanation when supported=false. |
sampled | boolean | Some rows in the window were sampled (sample_weight > 1); hits and total are estimates. |
site_id | integer | Count this site's traffic only; omitted = every site visible to the caller. |
sites | integer | Distinct sites among the matched requests (a distinct count, not restored by sample weight). |
supported | boolean | false = the condition uses something access_log does not hold (request headers, accept_language, named sets), so nothing was replayed; see reason. |
tenant_id | integer | Owning tenant; null = platform object (built-in or created by an admin, read-only for tenants). |
top_ips | CcMatchReplayIp[] | Client IPs with the most matched requests, at most 20, sorted by requests descending; empty when supported=false or nothing matched. |
top_urls | CcMatchReplayUrl[] | URLs (without the query string) with the most matched requests, at most 5, sorted by requests descending; empty when supported=false or nothing matched. |
total | integer | Total requests in the window (also restored). |
updated_at | string | Updated at |
when | object | Rule DSL condition: a combination of all/any/not, or a leaf {f, op, v, set, neg}; validated by the server and errors are returned as 422 (field is a JSON Pointer, code is the lowercase DSL error code). null = match everything. |
window_hours | integer | Replay window in hours (fixed at 24). |
Responses and errors
Success returns the resource JSON directly (HTTP 2xx); failures return application/problem+json (code, detail, plus errors on validation failures); lists carry items + total.
{
"id": 1,
"name": "example"
}{
"items": [
{
"id": 1
}
],
"page": 1,
"page_size": 20,
"total": 1
}{
"code": "validation_failed",
"detail": "Invalid request parameters",
"errors": [
{
"code": "required",
"field": "/name",
"message": "name is required"
}
],
"request_id": "0123456789abcdef",
"status": 422,
"title": "Unprocessable Entity",
"type": "about:blank"
}