---
title: "POST /data-types"
method: POST
path: "/data-types"
tags: ["Graph", "DataType"]
---

# POST /data-types

`POST /data-types`

## Headers

- `X-Authenticated-User-Actor-Id` string, uuid, required

## Request body

- CreateDataTypeRequest
  - `conversions` object, required
  - `provenance` ProvidedOntologyEditionProvenance, required — User-provided provenance information for an ontology type edition. Contains information provided by the client about the creation context, including the acting entity's type and the origin of the creation action.
    - `actorType` 'user' | 'machine' | 'ai', required — Types of individual actors in the system. Represents the different categories of entities that can perform actions.
    - `origin` union, required
      - object
        - `apiKeyPublicId` string
        - `deviceId` string
        - `environment` string
        - `id` string
        - `semanticVersion` string
        - `sessionId` string
        - `type` 'web-app', required
        - `userAgent` string
        - `version` string — The origin version, in whatever format the origin natively provides.
      - object
        - `apiKeyPublicId` string
        - `deviceId` string
        - `environment` string
        - `id` string
        - `semanticVersion` string
        - `sessionId` string
        - `type` 'mobile-app', required
        - `userAgent` string
        - `version` string — The origin version, in whatever format the origin natively provides.
      - object
        - `apiKeyPublicId` string
        - `deviceId` string
        - `environment` string
        - `id` string
        - `semanticVersion` string
        - `sessionId` string
        - `type` 'browser-extension', required
        - `userAgent` string
        - `version` string — The origin version, in whatever format the origin natively provides.
      - object
        - `apiKeyPublicId` string
        - `deviceId` string
        - `environment` string
        - `id` string
        - `semanticVersion` string
        - `sessionId` string
        - `type` 'api', required
        - `userAgent` string
        - `version` string — The origin version, in whatever format the origin natively provides.
      - object
        - `apiKeyPublicId` string
        - `deviceId` string
        - `environment` string
        - `id` string
        - `semanticVersion` string
        - `sessionId` string
        - `stepIds` string[]
        - `type` 'flow', required
        - `userAgent` string
        - `version` string — The origin version, in whatever format the origin natively provides.
      - object
        - `apiKeyPublicId` string
        - `deviceId` string
        - `environment` string
        - `id` string
        - `semanticVersion` string
        - `sessionId` string
        - `type` 'migration', required
        - `userAgent` string
        - `version` string — The origin version, in whatever format the origin natively provides.
    - `sources` SourceProvenance[]
      - `authors` string[] — The people or organizations that authored the material.
      - `entityId` string
      - `firstPublished` string, date-time
      - `lastUpdated` string, date-time
      - `loadedAt` string, date-time
      - `location` Location — A location where the source material can be found.
        - `description` string — Encapsulates a message intended to be read by the end user.
        - `name` string — A string containing the name of the location.
        - `uri` string, uri — A string containing a valid relative or absolute URI.
      - `type` 'webpage' | 'document' | 'integration', required — The type of source material which was used to produce a value.
  - `schema` union, required
    - DataType — unresolved $ref
    - DataType[] — unresolved $ref

## Response `200`

The metadata of the created data type

- union
  - union
    - object
      - `conversions` object
      - `provenance` OntologyProvenance, required — Provenance information for an ontology type. Contains tracking information about the creation, modification, and origin of an ontology type.
        - `edition` OntologyEditionProvenance, required — Provenance information for a specific edition of an ontology type. Contains comprehensive tracking of who created and potentially archived this edition, along with user-provided context about the creation process.
          - `actorType` 'user' | 'machine' | 'ai', required — Types of individual actors in the system. Represents the different categories of entities that can perform actions.
          - `origin` union, required
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `sources` SourceProvenance[]
            - `authors` string[] — The people or organizations that authored the material.
            - `entityId` string
            - `firstPublished` string, date-time
            - `lastUpdated` string, date-time
            - `loadedAt` string, date-time
            - `location` Location — A location where the source material can be found.
              - …
            - `type` 'webpage' | 'document' | 'integration', required — The type of source material which was used to produce a value.
          - `archivedById` string, uuid
          - `createdById` string, uuid, required
      - `recordId` OntologyTypeRecordId, required — An identifier for an ontology type record consisting of a base URL and version. This type provides a structured representation of an ontology type identifier that can be used in database records and type definitions. It contains the same components as a [`VersionedUrl`] but in a structured form rather than a string. # Examples ``` use std::str::FromStr; use type_system::ontology::id::{ BaseUrl, OntologyTypeRecordId, OntologyTypeVersion, VersionedUrl, }; // Create from individual components let base_url = BaseUrl::new("https://example.com/types/data-type/text/".to_owned())?; let version = OntologyTypeVersion::from_str("1")?; let record_id = OntologyTypeRecordId { base_url, version }; // Convert between VersionedUrl and OntologyTypeRecordId let url = VersionedUrl::from_str("https://example.com/types/data-type/text/v/1")?; let record_id = OntologyTypeRecordId::from(url.clone()); let url2 = VersionedUrl::from(record_id); assert_eq!(url, url2); # Ok::<(), Box<dyn core::error::Error>>(()) ```
        - `baseUrl` string, uri, required — The base URL of a Block Protocol ontology type (the $id of the schema, without the versioned suffix). It should be a valid URL, with a trailing slash.
        - `version` string, required
      - `temporalVersioning` OntologyTemporalMetadata, required
        - `transactionTime` LeftClosedTemporalInterval, required
          - `end` union, required
            - object
              - …
            - object
              - …
          - `start` ClosedTemporalBound, required
            - `kind` 'inclusive', required
            - `limit` string, date-time, required
      - `webId` string, uuid, required
    - object
      - `conversions` object
      - `fetchedAt` string, date-time, required
      - `provenance` OntologyProvenance, required — Provenance information for an ontology type. Contains tracking information about the creation, modification, and origin of an ontology type.
        - `edition` OntologyEditionProvenance, required — Provenance information for a specific edition of an ontology type. Contains comprehensive tracking of who created and potentially archived this edition, along with user-provided context about the creation process.
          - `actorType` 'user' | 'machine' | 'ai', required — Types of individual actors in the system. Represents the different categories of entities that can perform actions.
          - `origin` union, required
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `sources` SourceProvenance[]
            - `authors` string[] — The people or organizations that authored the material.
            - `entityId` string
            - `firstPublished` string, date-time
            - `lastUpdated` string, date-time
            - `loadedAt` string, date-time
            - `location` Location — A location where the source material can be found.
              - …
            - `type` 'webpage' | 'document' | 'integration', required — The type of source material which was used to produce a value.
          - `archivedById` string, uuid
          - `createdById` string, uuid, required
      - `recordId` OntologyTypeRecordId, required — An identifier for an ontology type record consisting of a base URL and version. This type provides a structured representation of an ontology type identifier that can be used in database records and type definitions. It contains the same components as a [`VersionedUrl`] but in a structured form rather than a string. # Examples ``` use std::str::FromStr; use type_system::ontology::id::{ BaseUrl, OntologyTypeRecordId, OntologyTypeVersion, VersionedUrl, }; // Create from individual components let base_url = BaseUrl::new("https://example.com/types/data-type/text/".to_owned())?; let version = OntologyTypeVersion::from_str("1")?; let record_id = OntologyTypeRecordId { base_url, version }; // Convert between VersionedUrl and OntologyTypeRecordId let url = VersionedUrl::from_str("https://example.com/types/data-type/text/v/1")?; let record_id = OntologyTypeRecordId::from(url.clone()); let url2 = VersionedUrl::from(record_id); assert_eq!(url, url2); # Ok::<(), Box<dyn core::error::Error>>(()) ```
        - `baseUrl` string, uri, required — The base URL of a Block Protocol ontology type (the $id of the schema, without the versioned suffix). It should be a valid URL, with a trailing slash.
        - `version` string, required
      - `temporalVersioning` OntologyTemporalMetadata, required
        - `transactionTime` LeftClosedTemporalInterval, required
          - `end` union, required
            - object
              - …
            - object
              - …
          - `start` ClosedTemporalBound, required
            - `kind` 'inclusive', required
            - `limit` string, date-time, required
  - DataTypeMetadata[]
    - union
      - object
        - `conversions` object
        - `provenance` OntologyProvenance, required — Provenance information for an ontology type. Contains tracking information about the creation, modification, and origin of an ontology type.
          - `edition` OntologyEditionProvenance, required — Provenance information for a specific edition of an ontology type. Contains comprehensive tracking of who created and potentially archived this edition, along with user-provided context about the creation process.
            - `actorType` 'user' | 'machine' | 'ai', required — Types of individual actors in the system. Represents the different categories of entities that can perform actions.
            - `origin` union, required
              - …
            - `sources` SourceProvenance[]
              - …
            - `archivedById` string, uuid
            - `createdById` string, uuid, required
        - `recordId` OntologyTypeRecordId, required — An identifier for an ontology type record consisting of a base URL and version. This type provides a structured representation of an ontology type identifier that can be used in database records and type definitions. It contains the same components as a [`VersionedUrl`] but in a structured form rather than a string. # Examples ``` use std::str::FromStr; use type_system::ontology::id::{ BaseUrl, OntologyTypeRecordId, OntologyTypeVersion, VersionedUrl, }; // Create from individual components let base_url = BaseUrl::new("https://example.com/types/data-type/text/".to_owned())?; let version = OntologyTypeVersion::from_str("1")?; let record_id = OntologyTypeRecordId { base_url, version }; // Convert between VersionedUrl and OntologyTypeRecordId let url = VersionedUrl::from_str("https://example.com/types/data-type/text/v/1")?; let record_id = OntologyTypeRecordId::from(url.clone()); let url2 = VersionedUrl::from(record_id); assert_eq!(url, url2); # Ok::<(), Box<dyn core::error::Error>>(()) ```
          - `baseUrl` string, uri, required — The base URL of a Block Protocol ontology type (the $id of the schema, without the versioned suffix). It should be a valid URL, with a trailing slash.
          - `version` string, required
        - `temporalVersioning` OntologyTemporalMetadata, required
          - `transactionTime` LeftClosedTemporalInterval, required
            - `end` union, required
              - …
            - `start` ClosedTemporalBound, required
              - …
        - `webId` string, uuid, required
      - object
        - `conversions` object
        - `fetchedAt` string, date-time, required
        - `provenance` OntologyProvenance, required — Provenance information for an ontology type. Contains tracking information about the creation, modification, and origin of an ontology type.
          - `edition` OntologyEditionProvenance, required — Provenance information for a specific edition of an ontology type. Contains comprehensive tracking of who created and potentially archived this edition, along with user-provided context about the creation process.
            - `actorType` 'user' | 'machine' | 'ai', required — Types of individual actors in the system. Represents the different categories of entities that can perform actions.
            - `origin` union, required
              - …
            - `sources` SourceProvenance[]
              - …
            - `archivedById` string, uuid
            - `createdById` string, uuid, required
        - `recordId` OntologyTypeRecordId, required — An identifier for an ontology type record consisting of a base URL and version. This type provides a structured representation of an ontology type identifier that can be used in database records and type definitions. It contains the same components as a [`VersionedUrl`] but in a structured form rather than a string. # Examples ``` use std::str::FromStr; use type_system::ontology::id::{ BaseUrl, OntologyTypeRecordId, OntologyTypeVersion, VersionedUrl, }; // Create from individual components let base_url = BaseUrl::new("https://example.com/types/data-type/text/".to_owned())?; let version = OntologyTypeVersion::from_str("1")?; let record_id = OntologyTypeRecordId { base_url, version }; // Convert between VersionedUrl and OntologyTypeRecordId let url = VersionedUrl::from_str("https://example.com/types/data-type/text/v/1")?; let record_id = OntologyTypeRecordId::from(url.clone()); let url2 = VersionedUrl::from(record_id); assert_eq!(url, url2); # Ok::<(), Box<dyn core::error::Error>>(()) ```
          - `baseUrl` string, uri, required — The base URL of a Block Protocol ontology type (the $id of the schema, without the versioned suffix). It should be a valid URL, with a trailing slash.
          - `version` string, required
        - `temporalVersioning` OntologyTemporalMetadata, required
          - `transactionTime` LeftClosedTemporalInterval, required
            - `end` union, required
              - …
            - `start` ClosedTemporalBound, required
              - …

## Other responses

- `409` — Unable to create data type in the store as the base data type URL already exists
- `422` — Provided request body is invalid
- `500` — Store error occurred

---

[API](https://skmtc.dev/hashintel/apis/graph.md) · [All operations](https://skmtc.dev/hashintel/apis/graph/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hashintel/graph/revisions/ba95e69ddba8/schema)
