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

# POST /data-types/query/subgraph

`POST /data-types/query/subgraph`

## Headers

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

## Request body

- union
  - object
    - `after` string, uri — The versioned URL of a Block Protocol ontology type (the $id of the schema). It should be of the form `${baseUrl}v/${versionNumber}`
    - `filter` union, required
      - object
        - `all` Filter[], required
      - object
        - `any` Filter[], required
      - object
        - `not` Filter, required — recursive
      - object
        - `equal` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `notEqual` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `exists` PathExpression, required
          - `path` union[], required
            - union
              - …
      - object
        - `greater` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `greaterOrEqual` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `less` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `lessOrEqual` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `startsWith` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `endsWith` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `containsSegment` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
    - `includeCount` boolean
    - `limit` integer
    - `temporalAxes` union, required — Defines the two possible combinations of pinned/variable temporal axes that are used in queries that return [`Subgraph`]s. The [`VariableTemporalAxisUnresolved`] is optionally bounded, in the absence of provided bounds an inclusive bound at the timestamp at point of resolving is assumed. [`Subgraph`]: crate::subgraph::Subgraph
      - object
        - `pinned` object, required
          - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `timestamp` string, date-time, nullable, required
        - `variable` object, required
          - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `interval` UnresolvedRightBoundedTemporalInterval, required
            - `end` union, required
              - …
            - `start` union, required
              - …
      - object
        - `pinned` object, required
          - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `timestamp` string, date-time, nullable, required
        - `variable` object, required
          - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `interval` UnresolvedRightBoundedTemporalInterval, required
            - `end` union, required
              - …
            - `start` union, required
              - …
    - `traversalPaths` TraversalPath[], required
      - `edges` TraversalEdge[], required
        - union
          - object
            - `kind` 'inherits-from', required
          - object
            - `kind` 'constrains-values-on', required
          - object
            - `kind` 'constrains-properties-on', required
          - object
            - `kind` 'constrains-links-on', required
          - object
            - `kind` 'constrains-link-destinations-on', required
          - object
            - `kind` 'is-of-type', required
          - object
            - `direction` 'incoming' | 'outgoing', required
            - `kind` 'has-left-entity', required
          - object
            - `direction` 'incoming' | 'outgoing', required
            - `kind` 'has-right-entity', required
  - object
    - `after` string, uri — The versioned URL of a Block Protocol ontology type (the $id of the schema). It should be of the form `${baseUrl}v/${versionNumber}`
    - `filter` union, required
      - object
        - `all` Filter[], required
      - object
        - `any` Filter[], required
      - object
        - `not` Filter, required — recursive
      - object
        - `equal` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `notEqual` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `exists` PathExpression, required
          - `path` union[], required
            - union
              - …
      - object
        - `greater` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `greaterOrEqual` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `less` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `lessOrEqual` FilterExpression[]
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `startsWith` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `endsWith` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
      - object
        - `containsSegment` FilterExpression[], required
          - union
            - PathExpression
              - …
            - ParameterExpression
              - …
    - `includeCount` boolean
    - `limit` integer
    - `temporalAxes` union, required — Defines the two possible combinations of pinned/variable temporal axes that are used in queries that return [`Subgraph`]s. The [`VariableTemporalAxisUnresolved`] is optionally bounded, in the absence of provided bounds an inclusive bound at the timestamp at point of resolving is assumed. [`Subgraph`]: crate::subgraph::Subgraph
      - object
        - `pinned` object, required
          - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `timestamp` string, date-time, nullable, required
        - `variable` object, required
          - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `interval` UnresolvedRightBoundedTemporalInterval, required
            - `end` union, required
              - …
            - `start` union, required
              - …
      - object
        - `pinned` object, required
          - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `timestamp` string, date-time, nullable, required
        - `variable` object, required
          - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
          - `interval` UnresolvedRightBoundedTemporalInterval, required
            - `end` union, required
              - …
            - `start` union, required
              - …
    - `graphResolveDepths` GraphResolveDepths, required
      - `constrainsLinkDestinationsOn` integer
      - `constrainsLinksOn` integer
      - `constrainsPropertiesOn` integer
      - `constrainsValuesOn` integer
      - `inheritsFrom` integer
      - `isOfType` boolean
    - `traversalPaths` EntityTraversalPath[], required
      - `edges` EntityTraversalEdge[], required
        - union
          - object
            - `direction` 'incoming' | 'outgoing', required
            - `kind` 'has-left-entity', required
          - object
            - `direction` 'incoming' | 'outgoing', required
            - `kind` 'has-right-entity', required

## Response `200`

Gets a subgraph rooted at all data types that satisfy the given query, each resolved to the requested depth.

- QueryDataTypeSubgraphResponse
  - `cursor` string, uri — The versioned URL of a Block Protocol ontology type (the $id of the schema). It should be of the form `${baseUrl}v/${versionNumber}`
  - `subgraph` Subgraph, required
    - `edges` Edges, required
    - `roots` GraphElementVertexId[], required
      - union
        - DataTypeVertexId
          - `baseId` 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.
          - `revisionId` string, required
        - PropertyTypeVertexId
          - `baseId` 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.
          - `revisionId` string, required
        - EntityTypeVertexId
          - `baseId` 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.
          - `revisionId` string, required
        - EntityVertexId
          - `baseId` string, required
          - `revisionId` string, date-time, required
    - `temporalAxes` SubgraphTemporalAxes, required
      - `initial` union, required — Defines the two possible combinations of pinned/variable temporal axes that are used in queries that return [`Subgraph`]s. The [`VariableTemporalAxisUnresolved`] is optionally bounded, in the absence of provided bounds an inclusive bound at the timestamp at point of resolving is assumed. [`Subgraph`]: crate::subgraph::Subgraph
        - object
          - `pinned` object, required
            - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `timestamp` string, date-time, nullable, required
          - `variable` object, required
            - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `interval` UnresolvedRightBoundedTemporalInterval, required
              - …
        - object
          - `pinned` object, required
            - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `timestamp` string, date-time, nullable, required
          - `variable` object, required
            - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `interval` UnresolvedRightBoundedTemporalInterval, required
              - …
      - `resolved` union, required — Defines the two possible combinations of pinned/variable temporal axes that are used in responses to queries that return [`Subgraph`]s. When querying the Graph, temporal data is returned. The Graph is implemented as a bitemporal data store, which means the knowledge data contains information about the time of when the knowledge was inserted into the Graph, the [`TransactionTime`], and when the knowledge was decided to be inserted, the [`DecisionTime`]. In order to query data from the Graph, only one of the two time axes can be used. This is achieved by using a `TemporalAxes`. The `TemporalAxes` pins one axis to a specified [`Timestamp`], while the other axis can be a [`Interval`]. The pinned axis is called the [`PinnedTemporalAxis`] and the other axis is called the [`VariableTemporalAxis`]. The returned data will then only contain temporal data that is contained in the [`Interval`] of the [`VariableTemporalAxis`] for the given [`Timestamp`] of the [`PinnedTemporalAxis`]. [`Subgraph`]: crate::subgraph::Subgraph [`Interval`]: hash_graph_temporal_versioning::Interval
        - object
          - `pinned` object, required
            - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `timestamp` string, date-time, required
          - `variable` object, required
            - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `interval` RightBoundedTemporalInterval, required
              - …
        - object
          - `pinned` object, required
            - `axis` 'decisionTime', required — Time axis for the decision time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `timestamp` string, date-time, required
          - `variable` object, required
            - `axis` 'transactionTime', required — Time axis for the transaction time. This is used as the generic argument to time-related structs and can be used as tag value.
            - `interval` RightBoundedTemporalInterval, required
              - …
    - `vertices` Vertices, required

## Other responses

- `422` — Provided query is invalid
- `500` — Store error occurred

## Changes

- **2026-07-10** `0f1f205334eb` — 2 breaking, 11 info
  - removed `subschema #1, subschema #2` from the request body `oneOf` list
  - the `subgraph/vertices/additionalProperties/additionalProperties/oneOf[#/components/schemas/KnowledgeGraphVertex]/oneOf[subschema #1: EntityVertex]/inner/metadata/provenance` response's property type/format changed from ``/`` to `object`/`` for status `200`
  - added `subschema #1, subschema #2` to the request body `oneOf` list
  - added the optional property `subgraph/vertices/additionalProperties/additionalProperties/oneOf[#/components/schemas/KnowledgeGraphVertex]/oneOf[subschema #1: EntityVertex]/inner/metadata/provenance/deletedAtDecisionTime` to the response with the `200` status
  - …9 more
- **2026-06-29** `88cca4a72bed` — 1 breaking, 1 info
  - removed `subschema #1, subschema #2` from the request body `oneOf` list
  - added `subschema #1, subschema #2` to the request body `oneOf` list
- **2026-06-27** `9bba37c8461a` — 1 info
  - added the optional property `subgraph/vertices/additionalProperties/additionalProperties/oneOf[#/components/schemas/KnowledgeGraphVertex]/oneOf[subschema #1: EntityVertex]/inner/metadata/readOnly` to the response with the `200` status
- **2026-06-25** `d94249d1f3aa` — 1 breaking, 1 info
  - removed `subschema #1, subschema #2` from the request body `oneOf` list
  - added `subschema #1, subschema #2` to the request body `oneOf` list
- …earlier changes not shown

[Full history](https://skmtc.dev/hashintel/apis/graph/changes/data-types/query/subgraph/post.md)

---

[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)
