V1

Categories

Full schema documentation for DTPR Category API responses.

Categories

Endpoint:GET /api/dtpr/v1/categories/:datachain_type

Overview

The DTPR Category schema defines the structure for categories that organize and group elements within datachains. Categories provide semantic grouping (e.g., "Technology", "Purpose", "Data") and define shared variables that elements within the category can use.

Parameters

ParameterInTypeRequiredDescription
datachain_typepathstringyesMust be device or ai
localesquerystringnoComma-separated locale codes (e.g., en,fr,es)

Response structure

The endpoint returns an array of category objects, sorted by the order field (categories without an order value appear at the end). Each object contains:

  • schema — Metadata about the schema specification
  • category — The core category definition

Schema section

"schema": {
  "name": "DTPR Category",
  "id": "dtpr_category",
  "version": "0.1",
  "namespace": "https://dtpr.io/schemas/category/v0.1"
}
PropertyTypeRequiredDescription
namestringyesSchema specification name ("DTPR Category")
idstringyesUnique schema identifier
versionstringyesDTPR schema version
namespacestringyesURL identifying this schema version

Category section

Basic identification

"id": "device__tech",
"order": 0,
"required": true,
"version": "2024-06-11T00:00:00Z"
PropertyTypeRequiredDescription
idstringyesUnique category identifier (format: {datachain_type}__{category_name})
orderintegernoDisplay order (0-based, lower = first)
requiredbooleannoWhether this category must have at least one element
versionstringyesISO 8601 timestamp of the latest update

Localized content

"name": [{"locale": "en", "value": "Technology"}],
"description": [{"locale": "en", "value": "Describes the data collection technologies being used"}],
"prompt": [{"locale": "en", "value": "What technologies are collecting data?"}]
PropertyTypeRequiredDescription
namelocale arrayyesDisplay name of the category
descriptionlocale arrayyesExplanation of what the category represents
promptlocale arrayyesQuestion helping users understand what elements belong here

Element variables

Categories can define variables available to all elements within the category:

"element_variables": [
  {
    "id": "duration",
    "label": [{"locale": "en", "value": "Retention Duration"}],
    "required": true
  }
]
PropertyTypeRequiredDescription
idstringyesUnique variable identifier within the category
requiredbooleanyesWhether elements must provide a value
labellocale arrayyesLocalized label for the variable

These variables are inherited by all elements in the category and can be referenced using {{variable_id}} syntax in element descriptions.

Standard categories

Category IDDescription
techTechnologies and sensors used for data collection
purposeWhy data is being collected
dataWhat types of data are collected
processHow data is processed
storageWhere and how data is stored
accessWho can access the data
retentionHow long data is kept
accountableWho is responsible for the data

Locale filtering

When the locales query parameter is provided, the API filters all localized content:

  • name array is filtered
  • description array is filtered
  • prompt array is filtered
  • element_variables[].label arrays are filtered

Example

Request: GET /api/dtpr/v1/categories/device?locales=en

[
  {
    "schema": {
      "name": "DTPR Category",
      "id": "dtpr_category",
      "version": "0.1",
      "namespace": "https://dtpr.io/schemas/category/v0.1"
    },
    "category": {
      "id": "device__tech",
      "order": 0,
      "required": true,
      "name": [{"locale": "en", "value": "Technology"}],
      "description": [
        {"locale": "en", "value": "Describes the specific technologies, sensors, and devices used to collect data"}
      ],
      "prompt": [{"locale": "en", "value": "What technologies are collecting data?"}],
      "version": "2024-06-11T00:00:00Z",
      "element_variables": [
        {
          "id": "additional_description",
          "label": [{"locale": "en", "value": "Additional Description"}],
          "required": false
        }
      ]
    }
  }
]

Full response example (multiple locales)

[
  {
    "schema": {
      "name": "DTPR Category",
      "id": "dtpr_category",
      "version": "0.1",
      "namespace": "https://dtpr.io/schemas/category/v0.1"
    },
    "category": {
      "id": "device__tech",
      "order": 0,
      "required": true,
      "name": [
        {"locale": "en", "value": "Technology"},
        {"locale": "fr", "value": "Technologie"}
      ],
      "description": [
        {"locale": "en", "value": "Describes the specific technologies, sensors, and devices used to collect data"},
        {"locale": "fr", "value": "D\u00e9crit les technologies, capteurs et appareils sp\u00e9cifiques utilis\u00e9s pour collecter des donn\u00e9es"}
      ],
      "prompt": [
        {"locale": "en", "value": "What technologies are collecting data?"},
        {"locale": "fr", "value": "Quelles technologies collectent des donn\u00e9es?"}
      ],
      "version": "2024-06-11T00:00:00Z",
      "element_variables": [
        {
          "id": "additional_description",
          "label": [
            {"locale": "en", "value": "Additional Description"},
            {"locale": "fr", "value": "Description suppl\u00e9mentaire"}
          ],
          "required": false
        }
      ]
    }
  },
  {
    "schema": {
      "name": "DTPR Category",
      "id": "dtpr_category",
      "version": "0.1",
      "namespace": "https://dtpr.io/schemas/category/v0.1"
    },
    "category": {
      "id": "device__purpose",
      "order": 1,
      "required": true,
      "name": [
        {"locale": "en", "value": "Purpose"},
        {"locale": "fr", "value": "Objectif"}
      ],
      "description": [
        {"locale": "en", "value": "Explains why data is being collected and how it will be used"},
        {"locale": "fr", "value": "Explique pourquoi les donn\u00e9es sont collect\u00e9es et comment elles seront utilis\u00e9es"}
      ],
      "prompt": [
        {"locale": "en", "value": "Why is data being collected?"},
        {"locale": "fr", "value": "Pourquoi les donn\u00e9es sont-elles collect\u00e9es?"}
      ],
      "version": "2024-06-11T00:00:00Z",
      "element_variables": []
    }
  }
]
Copyright © 2026