Getting started

REST quickstart

Three curls against the v2 REST API.

REST quickstart

Three calls. No auth. All responses are JSON.

1. List schema versions

curl -s https://api.dtpr.io/api/v2/schemas
{
  "ok": true,
  "versions": [
    { "id": "ai@2026-04-16-beta", "status": "beta", "content_hash": "sha256-…", "aliases": ["ai@latest"] }
  ]
}

2. Fetch elements

curl -s "https://api.dtpr.io/api/v2/schemas/ai@2026-04-16-beta/elements?fields=all&limit=5"
{
  "ok": true,
  "version": "ai@2026-04-16-beta",
  "elements": [
    { "id": "purpose.example", "title": [...], "category_id": "purpose" }
  ],
  "meta": { "total": 127, "returned": 5, "next_cursor": "eyJvZmZzZXQiOjV9" }
}

Pass meta.next_cursor back as ?cursor=… to paginate.

3. Validate a datachain (with a deliberate warning)

curl -s https://api.dtpr.io/api/v2/schemas/ai@2026-04-16-beta/validate \
  -H 'content-type: application/json' \
  --data '{
    "schema_version": "ai@2026-04-16-beta",
    "elements": [
      { "element_id": "purpose.example", "category_id": "purpose", "label": "" }
    ]
  }'

The HTTP status is 200 in both valid and invalid cases; the semantic answer is in the body. With the empty label above, expect a warning such as placement_label_empty (non-blocking) or an ok:false envelope whose errors[] indicates missing required categories.

Next

Copyright © 2026