{% extends "docs/base.html" %} {% block docs_content %}
Manage stored rate-limit rules. All endpoints require staff access.
| Method | Path | Result |
|---|---|---|
GET | /api/v1/rate-limits | Paginated rules |
POST | /api/v1/rate-limits | Create a rule |
GET | /api/v1/rate-limits/{uuid} | One rule |
PUT | /api/v1/rate-limits/{uuid} | Update a rule |
DELETE | /api/v1/rate-limits/{uuid} | Delete a rule |
Scopes identify instrumented operations such as api:ping-user. Scope names must be unique, and request and window values must be positive integers.
curl --request POST \
--header "Authorization: Bearer $PEARING_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{"scope":"api:ping-user","max_requests":10,"window_seconds":60,"is_enabled":true}' \
"$PEARING_API_URL/v1/rate-limits"
201 Created returns the stored rule with its uuid, timestamps, and configured values.
Updates are partial. Omitted fields keep their current values.
curl --request PUT \
--header "Authorization: Bearer $PEARING_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{"max_requests":20,"window_seconds":120}' \
"$PEARING_API_URL/v1/rate-limits/$RATE_LIMIT_UUID"
DELETE returns 204 No Content.
A rule is enforced only when both the rule and the site-wide rate_limits_enabled setting are enabled. Exceeded API limits return 429 Too Many Requests with retry information.