API reference
Sync rules
Fetch active pre-call rules for a Pylva SDK runtime.
The SDK uses this endpoint to keep its local rule cache current. Direct use is possible, but most teams should let the SDK call it automatically.
This endpoint is SDK rule sync only. Use the dashboard to create, review, activate, disable, or roll back rules. For the control rollout path, see Controls Workflow.
Authentication
Use your API key inX-Pylva-Key.
curl https://api.pylva.com/api/v1/rules \
-H "X-Pylva-Key: $PYLVA_API_KEY"
Response
{
"rules": [
{
"id": "00000000-0000-0000-0000-000000000000",
"builder_id": "11111111-1111-1111-1111-111111111111",
"type": "budget_limit",
"enforcement": "pre_call",
"name": "Daily customer budget",
"enabled": true,
"config": {
"limit_usd": 25,
"period": "day",
"hard_stop": true,
"scope": "per_customer"
},
"customer_id": null,
"status": "active",
"activated_at": "2026-06-11T00:00:00.000Z",
"last_triggered_at": null,
"last_error": null,
"created_at": "2026-06-11T00:00:00.000Z",
"updated_at": "2026-06-11T00:00:00.000Z"
}
],
"ttl_seconds": 60,
"fetched_at": "2026-06-11T10:00:00.000Z"
}
Notes
- The endpoint returns active, enabled, pre-call rules only.
- Cache the response for
ttl_seconds. - The endpoint does not accept query parameters.
- Use the dashboard for rule mutations and the custom-pricing endpoints for pricing mutations.