Taxonomy
Getting started

REST quickstart

Three curls against the v2 REST API.
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": "dtpr@2026-09-01-beta", "status": "beta", "created_at": "2026-08-26T00:00:00.000Z", "content_hash": "sha256-…" }
  ]
}

2. Fetch elements

curl -s "https://api.dtpr.io/api/v2/schemas/dtpr@2026-09-01-beta/elements?fields=all&limit=5"
{
  "ok": true,
  "version": "dtpr@2026-09-01-beta",
  "elements": [
    { "id": "employment", "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

An instance needs id, schema_version, created_at, and at least one element from every required category (purpose, accountable, affected). The accountable and affected elements additionally require title and description variables.

curl -s https://api.dtpr.io/api/v2/schemas/dtpr@2026-09-01-beta/validate \
  -H 'content-type: application/json' \
  --data '{
    "id": "acme-resume-screener",
    "schema_version": "dtpr@2026-09-01-beta",
    "created_at": "2026-09-01T00:00:00Z",
    "elements": [
      { "element_id": "employment" },
      { "element_id": "organization", "context_type_id": "deployer", "variables": [
        { "id": "title", "value": [{ "locale": "en", "value": "Acme Corp" }] },
        { "id": "description", "value": [{ "locale": "en", "value": "Runs the screener." }] }] },
      { "element_id": "people", "context_type_id": "subject", "variables": [
        { "id": "title", "value": [{ "locale": "en", "value": "Job applicants" }] },
        { "id": "description", "value": [{ "locale": "en", "value": "Anyone who submits a resume." }] }] },
      { "element_id": "recommends", "context_type_id": "human_decides" }
    ]
  }'

Returns {"ok":true,"warnings":[]}. The HTTP status is 200 in both valid and invalid cases; the semantic answer is in the body. Drop the employment placement and the same call returns ok:false with a REQUIRED_CATEGORY_MISSING error carrying a fix_hint.

Next