Skip to main content
The catalog stores rulesets so you can reference them by name@version on /v1/evaluate instead of sending the body inline every time.

Endpoints

MethodPathPurpose
POST/v1/rulesetsCreate a new (name, version).
GET/v1/rulesetsList rulesets (paginated).
GET/v1/rulesets/{name}Get the latest version.
GET/v1/rulesets/{name}/{version}Get a specific version.

Create

curl -X POST https://api-attestly.code4source.com/v1/rulesets \
  -H "Authorization: Bearer atk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "br-rural-credit",
    "version": 1,
    "sets":   { ... },
    "checks": [ ... ]
  }'
version is an integer. Omit it to let the API assign the next free version. (name, version) pairs are immutable — re-POSTing the same pair returns 409 RULESET_ALREADY_EXISTS.

Response

{
  "data": {
    "ruleset": "br-rural-credit",
    "version": 1,
    "body": { ... },
    "body_hash": "8a3c...",
    "created_at": "2026-05-05T12:00:00Z",
    "created_by": "org_01HX...",
    "display_name": null,
    "description": null,
    "tags": [],
    "resolved_colors": {
      "ruleset": "#3b82f6",
      "checks": { "no_indigenous_overlap": "#dc2626" },
      "outcomes": {
        "compliant": "#16a34a",
        "warning": "#f59e0b",
        "non_compliant": "#dc2626",
        "degraded": "#6b7280"
      }
    }
  }
}

List

GET /v1/rulesets?page=1&page_size=25
GET /v1/rulesets?tag=preset
GET /v1/rulesets?tag=preset&tag=brazil
Query paramNotes
page1-indexed. Defaults to 1.
page_sizeItems per page. Defaults to 25, max 200.
tagRepeat to require multiple tags (AND). Use tag=preset for curated official rulesets.
Returns a paginated metadata listing:
{
  "data": {
    "items": [
      {
        "ruleset": "br-rural-credit",
        "version": 1,
        "body_hash": "8a3c...",
        "created_at": "2026-05-05T12:00:00Z",
        "created_by": "org_01HX...",
        "display_name": null,
        "description": null,
        "tags": [],
        "color": "#3b82f6"
      }
    ],
    "pagination": { "page": 1, "page_size": 25, "total_count": 42, "total_pages": 2 }
  }
}

Get

GET /v1/rulesets/br-rural-credit          # latest version
GET /v1/rulesets/br-rural-credit/1        # pinned version
Both return the same shape as the POST response above.