API Reference

Policies

Ledger-wide access rules that define which signers (via circles) can perform which operations on which record types.

List policies

GET
/policies

Authorization

BearerAuth LedgerHeader
AuthorizationBearer <token>

Access token obtained from POST /oauth/token

In: header

x-ledger<token>

Handle of the target ledger (e.g. demo-co)

In: header

Query Parameters

limit?integer

Maximum records to return

Default25
Rangevalue <= 100
offset?integer

Records to skip

Default0

Response Body

application/json

curl -X GET "https://demo-co.ldg-stg.one/api/v2/policies"
{
  "data": [
    {
      "handle": "hub-owner-access",
      "schema": "access",
      "record": "any",
      "values": [
        {
          "action": "any",
          "record": "any",
          "signer": {
            "$circle": "owner"
          },
          "bearer": {
            "$signer": {
              "$circle": "services"
            }
          }
        }
      ],
      "custom": {}
    }
  ],
  "meta": {
    "total": 4,
    "limit": 25,
    "offset": 0
  }
}

Create policy

POST
/policies

Authorization

BearerAuth LedgerHeader
AuthorizationBearer <token>

Access token obtained from POST /oauth/token

In: header

x-ledger<token>

Handle of the target ledger (e.g. demo-co)

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://demo-co.ldg-stg.one/api/v2/policies" \  -H "Content-Type: application/json" \  -d '{    "data": {      "handle": "hub-owner-access",      "schema": "access",      "record": "any",      "values": [        {          "action": "any",          "record": "any",          "signer": {            "$circle": "owner"          }        },        {          "action": {            "$in": [              "read",              "query"            ]          },          "record": "any",          "bearer": {            "$signer": {              "$circle": "owner"            }          }        }      ]    }  }'
{
  "data": {
    "handle": "hub-owner-access",
    "schema": "access",
    "record": "any",
    "values": [
      {
        "action": "any",
        "record": "any",
        "signer": {
          "$circle": "owner"
        },
        "bearer": {
          "$signer": {
            "$circle": "services"
          }
        }
      }
    ],
    "custom": {}
  }
}

Get policy

GET
/policies/{handle}

Authorization

BearerAuth LedgerHeader
AuthorizationBearer <token>

Access token obtained from POST /oauth/token

In: header

x-ledger<token>

Handle of the target ledger (e.g. demo-co)

In: header

Path Parameters

handle*string

Record handle

Response Body

application/json

application/json

curl -X GET "https://demo-co.ldg-stg.one/api/v2/policies/pay-20260608-001"
{
  "data": {
    "handle": "hub-owner-access",
    "schema": "access",
    "record": "any",
    "values": [
      {
        "action": "any",
        "record": "any",
        "signer": {
          "$circle": "owner"
        },
        "bearer": {
          "$signer": {
            "$circle": "services"
          }
        }
      }
    ],
    "custom": {}
  }
}
{
  "error": {
    "code": "not-found",
    "message": "Wallet not found"
  }
}

On this page

No Headings