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
| Param | In | Default | Description |
|---|---|---|---|
version | path | — | Canonical version or alias. |
category_id | query | — | Restrict to one category. |
locale | query | en | Locale used for the query search. |
locales | query | — | Comma-separated codes retained in localized strings. |
query | query | — | BM25 search across title (boost 3) + description. |
fields | query | id,title,category_id | Comma-separated field list or all. |
limit | query | 50 | Integer in [1, 200]. |
cursor | query | — | Opaque 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
| Code | HTTP | Meaning |
|---|---|---|
bad_request | 400 | Malformed cursor, non-integer limit, limit > 200. |
not_found | 404 | Version 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=="
GET /api/v2/schemas/ai@2026-04-16-beta/elements?category_id=purpose&query=camera&locales=en&limit=25 HTTP/1.1
Host: api.dtpr.io