Throttle
GET/api/v1/throttle/plans
Authorization
bearer_token In: header
Query Parameters
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Full-text search over this list's searchable fields.
1 <= length <= 200Comma-separated sort keys, - for descending, at most 1. Keys: updated_at, created_at. Default: -created_at.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
Response Body
application/json
curl -X GET "https://example.com/api/v1/throttle/plans"{ "page": { "has_more": true, "next_cursor": "string", "page": 0, "total": 0 }, "plans": [ { "actions": { "property1": { "cost": 0 }, "property2": { "cost": 0 } }, "created_at": "2019-08-24T14:15:22Z", "default_enforcement": "soft", "description": "string", "headers_mode": "standard", "limits": { "max_requests": 0, "window_seconds": 0 }, "owner_id": "string", "plan_id": "string", "refund_window_seconds": 0, "subject_namespaces": [ "string" ], "tags": [ "string" ], "updated_at": "2019-08-24T14:15:22Z" } ]}POST/api/v1/throttle/plans
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Create a throttle plan.
Use internal IDs only; do not pass email addresses, phone numbers, or other PII as subject identifiers.
Response Body
application/json
curl -X POST "https://example.com/api/v1/throttle/plans" \ -H "Content-Type: application/json" \ -d '{ "limits": { "max_requests": 0, "window_seconds": 0 }, "plan_id": "string" }'{ "actions": { "property1": { "cost": 0 }, "property2": { "cost": 0 } }, "created_at": "2019-08-24T14:15:22Z", "default_enforcement": "soft", "description": "string", "headers_mode": "standard", "limits": { "max_requests": 0, "window_seconds": 0 }, "owner_id": "string", "plan_id": "string", "refund_window_seconds": 0, "subject_namespaces": [ "string" ], "tags": [ "string" ], "updated_at": "2019-08-24T14:15:22Z"}GET/api/v1/throttle/plans/{plan_id}
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/throttle/plans/string"{ "actions": { "property1": { "cost": 0 }, "property2": { "cost": 0 } }, "created_at": "2019-08-24T14:15:22Z", "default_enforcement": "soft", "description": "string", "headers_mode": "standard", "limits": { "max_requests": 0, "window_seconds": 0 }, "owner_id": "string", "plan_id": "string", "refund_window_seconds": 0, "subject_namespaces": [ "string" ], "tags": [ "string" ], "updated_at": "2019-08-24T14:15:22Z"}PATCH/api/v1/throttle/plans/{plan_id}
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Partial update for a throttle plan.
Response Body
application/json
curl -X PATCH "https://example.com/api/v1/throttle/plans/string" \ -H "Content-Type: application/json" \ -d '{}'{ "actions": { "property1": { "cost": 0 }, "property2": { "cost": 0 } }, "created_at": "2019-08-24T14:15:22Z", "default_enforcement": "soft", "description": "string", "headers_mode": "standard", "limits": { "max_requests": 0, "window_seconds": 0 }, "owner_id": "string", "plan_id": "string", "refund_window_seconds": 0, "subject_namespaces": [ "string" ], "tags": [ "string" ], "updated_at": "2019-08-24T14:15:22Z"}DELETE/api/v1/throttle/plans/{plan_id}
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X DELETE "https://example.com/api/v1/throttle/plans/string"{ "message": "string", "plan_id": "string"}POST/api/v1/throttle/plans/{plan_id}/check
Authorization
bearer_token In: header
Path Parameters
Query Parameters
Override the plan default enforcement: hard returns 429 on denial
Value in
- "soft"
- "hard"
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Check + consume against a plan bucket.
Response Body
application/json
curl -X POST "https://example.com/api/v1/throttle/plans/string/check" \ -H "Content-Type: application/json" \ -d '{ "subject": "string" }'{ "allowed": true, "consume_token": "string", "limit": 0, "reason": "string", "remaining": 0, "reset_after_seconds": 0, "reset_at": 0, "retry_after_seconds": 0}POST/api/v1/throttle/plans/{plan_id}/peek
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Read-only bucket inspection.
Response Body
application/json
curl -X POST "https://example.com/api/v1/throttle/plans/string/peek" \ -H "Content-Type: application/json" \ -d '{ "subject": "string" }'{ "limit": 0, "remaining": 0, "reset_after_seconds": 0, "reset_at": 0}POST/api/v1/throttle/plans/{plan_id}/refund
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Refund a prior consume by its token.
Response Body
application/json
curl -X POST "https://example.com/api/v1/throttle/plans/string/refund" \ -H "Content-Type: application/json" \ -d '{ "consume_token": "string", "subject": "string" }'{ "cost_refunded": 0, "refunded": true}POST/api/v1/throttle/plans/{plan_id}/reset
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Administratively reset a subject bucket to full capacity.
Response Body
application/json
curl -X POST "https://example.com/api/v1/throttle/plans/string/reset" \ -H "Content-Type: application/json" \ -d '{ "subject": "string" }'{ "message": "string"}GET/api/v1/throttle/plans/{plan_id}/stats
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/throttle/plans/string/stats"{ "plan_id": "string", "total_allowed": 0, "total_checks": 0, "total_denied": 0, "total_refunded": 0}