REST API (v2)

GET /schemas/:version/elements

Paginated element list with category filter, BM25 search, projection, and locale filtering.

GET /schemas/:version/elements

The default projection is ["id","title","category_id"]. Pass ?fields=all for full records.

Summary

Return elements in a schema version. Supports filtering by category_id, BM25 text search via query, opaque-cursor pagination, locale filtering, and field projection.

Request

GET https://api.dtpr.io/api/v2/schemas/:version/elements
ParamInDefaultDescription
versionpathCanonical version or alias.
category_idqueryRestrict to one category.
localequeryenLocale used for the query search.
localesqueryComma-separated codes retained in localized strings.
queryqueryBM25 search across title (boost 3) + description.
fieldsqueryid,title,category_idComma-separated field list or all.
limitquery50Integer in [1, 200].
cursorqueryOpaque cursor from a previous response's meta.next_cursor.

Response

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

{
  "ok": true,
  "version": "ai@2026-04-16-beta",
  "elements": [
    { "id": "purpose.example", "title": [{"locale":"en","value":"Example"}], "category_id": "purpose" }
  ],
  "meta": {
    "total": 127,
    "returned": 50,
    "next_cursor": "eyJvZmZzZXQiOjUwfQ=="
  }
}

meta.next_cursor is null on the last page.

Errors

CodeHTTPMeaning
bad_request400Malformed cursor, non-integer limit, limit > 200.
not_found404Version is not registered.

Example: cursor round-trip

# first page
curl -s "https://api.dtpr.io/api/v2/schemas/ai@2026-04-16-beta/elements?fields=all&limit=50"

# follow-up page
curl -s "https://api.dtpr.io/api/v2/schemas/ai@2026-04-16-beta/elements?fields=all&limit=50&cursor=eyJvZmZzZXQiOjUwfQ=="

See also

Copyright © 2026