Taxonomy
REST API (v2)

POST /schemas/:version/resolve

Compose a thin DatachainInstance plus the pinned schema slice into a ResolvedDatachainInstance.

POST /schemas/:version/resolve

Resolve runs validate first (R7). On semantic failure, the response is HTTP 200 with { "ok": false, "errors": [...] } mirroring the /validate envelope.

Summary

Compose a thin DatachainInstance and the pinned schema's lean subset (datachain_type + referenced categories + referenced elements) into a single self-contained ResolvedDatachainInstance. Downstream consumers can render the snapshot offline, ship it to signage / PDFs / admin UIs, or persist it as an audit artifact — no further schema fetch required.

ResolvedDatachainInstance is a strict structural superset of DatachainInstance. Stripping schema_snapshot, suggested_elements, and authoring_provenance returns a thin instance equivalent (post-parse) to the input.

Request

POST https://api.dtpr.io/api/v2/schemas/:version/resolve
Content-Type: application/json

{ "schema_version": "ai@2026-04-16-beta", "elements": [{"element_id":"accept_deny"}] }
ParamInDescription
versionpathCanonical version or alias.
(body)JSONA DatachainInstance.

Response — success

HTTP/1.1 200 OK
Content-Type: application/json
DTPR-Content-Hash: sha256-…
Cache-Control: no-store

{
  "id": "…",
  "schema_version": "ai@2026-04-16-beta",
  "elements": [{"element_id":"accept_deny"}],
  "schema_snapshot": {
    "datachain_type": { "id": "ai", "categories": ["ai__decision"], "subchains": [], … },
    "categories": [{ "id": "ai__decision", … }],
    "elements": [{ "id": "accept_deny", … }]
  },
  "suggested_elements": []
}

Response — semantic failure (R7)

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ok": false,
  "errors": [
    { "code": "INSTANCE_ELEMENT_UNKNOWN", "message": "…", "path": "elements[0]" }
  ]
}

Response — payload too large

When the resolved bundle exceeds the 512 KB cap, the response is 413 Payload Too Large:

HTTP/1.1 413 Payload Too Large
Content-Type: application/json

{
  "ok": false,
  "errors": [
    {
      "code": "payload_too_large",
      "message": "Resolved bundle exceeds 524288-byte cap (got 612904).",
      "fix_hint": "Reduce locales/elements/categories pinned by the schema, or fetch the schema content separately."
    }
  ]
}

Limits

LimitValueSource
Rate limit15 req / 60 sRL_RESOLVE binding (shared with validate_resolved).
Wall-clock5000 msPer-route timeout middleware.
CPU500 msWorker-wide ceiling (limits.cpu_ms in wrangler.jsonc).
Response cap512 KBMeasured against the canonical (sorted-key) serialization.

Errors

CodeHTTPMeaning
bad_request400Invalid JSON body or malformed :version.
not_found404Version is not registered.
parse_error200Datachain shape failed Zod validation.
payload_too_large413Resolved bundle exceeds 512 KB cap.
Semantic validator codes200Shape-valid but semantically wrong (R7 — validate runs before resolve).

See also