> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pylva.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync rules

> Fetch active pre-call rules for a Pylva SDK runtime.

The SDK uses this Agent SDK 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](/concepts/controls-workflow).

## Authentication

Use an Agent SDK key in `X-Pylva-Key`.

```bash theme={null}
curl https://api.pylva.com/api/v1/rules \
  -H "X-Pylva-Key: $PYLVA_API_KEY"
```

## Response

```json theme={null}
{
  "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 Admin API custom-pricing endpoints for pricing mutations.
