Skip to content
API Reference

List policy schemas

GET/zones/{zone_id}/policy-schemas

List policy schemas

Path ParametersExpand Collapse
zone_id: string
Query ParametersExpand Collapse
after: optional string

Return items after this cursor (forward pagination). Use after_cursor from a previous response. Mutually exclusive with before.

before: optional string

Return items before this cursor (backward pagination). Use before_cursor from a previous response. Mutually exclusive with after.

expand: optional array of "total_count"

Opt-in to additional response fields

format: optional "cedar" or "json"

Schema representation format. cedar returns human-readable Cedar syntax in cedar_schema, json returns Cedar JSON schema object in cedar_schema_json.

Accepts one of the following:
"cedar"
"json"
is_default: optional boolean

Filter schemas by default status. When true, returns only the zone's default schema. When false, returns only non-default schemas. Omit to return all schemas.

limit: optional number

Maximum number of items to return

maximum100
minimum1
order: optional "asc" or "desc"

Sort direction. Default is desc (newest first).

Accepts one of the following:
"asc"
"desc"
sort: optional "created_at"

Field to sort by.

Header ParametersExpand Collapse
"X-API-Version": optional string
"X-Client-Request-ID": optional string
formatuuid
ReturnsExpand Collapse
items: array of SchemaVersionWithZoneInfo { is_default }
is_default: boolean

Whether this is the zone's default schema. Clients use this to pre-select which schema to write policies against. Has no effect on evaluation.

List policy schemas

curl https://api.keycard.ai/zones/$ZONE_ID/policy-schemas
{
  "items": [
    {
      "created_at": "2019-12-27T18:11:19.117Z",
      "status": "active",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "version": "version",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "cedar_schema": "cedar_schema",
      "cedar_schema_json": {},
      "deprecated_at": "2019-12-27T18:11:19.117Z",
      "is_default": true
    }
  ],
  "pagination": {
    "after_cursor": "after_cursor",
    "before_cursor": "before_cursor",
    "total_count": 0
  }
}
Returns Examples
{
  "items": [
    {
      "created_at": "2019-12-27T18:11:19.117Z",
      "status": "active",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "version": "version",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "cedar_schema": "cedar_schema",
      "cedar_schema_json": {},
      "deprecated_at": "2019-12-27T18:11:19.117Z",
      "is_default": true
    }
  ],
  "pagination": {
    "after_cursor": "after_cursor",
    "before_cursor": "before_cursor",
    "total_count": 0
  }
}