Skip to content
API Reference

Create a new policy

POST/zones/{zone_id}/policies

Create a new policy

Path ParametersExpand Collapse
zone_id: string
Header ParametersExpand Collapse
"X-API-Version": optional string
"X-Client-Request-ID": optional string
formatuuid
Body ParametersJSONExpand Collapse
name: string
description: optional string
ReturnsExpand Collapse
Policy = object { id, created_at, created_by, 9 more }
id: string
created_at: string
formatdate-time
created_by: string
name: string
owner_type: "platform" or "customer"

Who manages this policy:

  • "platform" — managed by the Keycard platform (system policies).
  • "customer" — managed by the tenant (custom policies).
Accepts one of the following:
"platform"
"customer"
updated_at: string
formatdate-time
zone_id: string
archived_at: optional string
formatdate-time
description: optional string
latest_version: optional number

Human-readable version number of the latest version (e.g., 1, 2, 3)

latest_version_id: optional string
updated_by: optional string

Create a new policy

curl https://api.keycard.ai/zones/$ZONE_ID/policies \
    -H 'Content-Type: application/json' \
    -d '{
          "name": "name"
        }'
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by"
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by"
}