---
title: "POST /entities/query/subgraph"
method: POST
path: "/entities/query/subgraph"
tags: ["Graph", "Entity"]
---

# POST /entities/query/subgraph

`POST /entities/query/subgraph`

## Headers

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

## Request body

- union
  - object
    - `conversions` QueryConversion[]
      - `dataTypeId` string, uri, required — The versioned URL of a Block Protocol ontology type (the $id of the schema). It should be of the form `${baseUrl}v/${versionNumber}`
      - `path` PropertyPathElement[], required
        - union — An element in a property path that identifies a specific property location. [`PropertyPathElement`] represents a single step in navigating a property hierarchy, addressing either: - A specific property by its type URL (for object properties) - A specific index (for array properties) These elements can be chained together to form a [`PropertyPath`] that addresses deeply nested properties within the property hierarchy.
          - string, uri — 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.
          - integer — An array index that addresses a specific element in an array property.
    - `cursor` object[]
    - `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
              - …
    - `includeDrafts` boolean, required
    - `includeEntityTypes` 'closed' | 'resolved' | 'resolvedWithDataTypeChildren'
    - `includePermissions` boolean, required
    - `limit` integer, nullable
    - `sortingPaths` EntityQuerySortingRecord[], nullable
      - `nulls` 'first' | 'last', required
      - `ordering` 'ascending' | 'descending', required
      - `path` union[], required
        - union
          - 'uuid' | 'archived' | 'label' | 'editionCreatedAtTransactionTime' | 'editionCreatedAtDecisionTime' | 'createdAtTransactionTime' | 'createdAtDecisionTime' | 'typeTitle'
          - string
          - number
    - `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
  - object
    - `conversions` QueryConversion[]
      - `dataTypeId` string, uri, required — The versioned URL of a Block Protocol ontology type (the $id of the schema). It should be of the form `${baseUrl}v/${versionNumber}`
      - `path` PropertyPathElement[], required
        - union — An element in a property path that identifies a specific property location. [`PropertyPathElement`] represents a single step in navigating a property hierarchy, addressing either: - A specific property by its type URL (for object properties) - A specific index (for array properties) These elements can be chained together to form a [`PropertyPath`] that addresses deeply nested properties within the property hierarchy.
          - string, uri — 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.
          - integer — An array index that addresses a specific element in an array property.
    - `cursor` object[]
    - `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
              - …
    - `includeDrafts` boolean, required
    - `includeEntityTypes` 'closed' | 'resolved' | 'resolvedWithDataTypeChildren'
    - `includePermissions` boolean, required
    - `limit` integer, nullable
    - `sortingPaths` EntityQuerySortingRecord[], nullable
      - `nulls` 'first' | 'last', required
      - `ordering` 'ascending' | 'descending', required
      - `path` union[], required
        - union
          - 'uuid' | 'archived' | 'label' | 'editionCreatedAtTransactionTime' | 'editionCreatedAtDecisionTime' | 'createdAtTransactionTime' | 'createdAtDecisionTime' | 'typeTitle'
          - string
          - number
    - `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

## Response `200`

A subgraph rooted at entities that satisfy the given query, each resolved to the requested depth.

- QueryEntitySubgraphResponse
  - `closedMultiEntityTypes` object
  - `cursor` object[]
  - `definitions` EntityTypeResolveDefinitions
    - `dataTypes` object, required
    - `entityTypes` object, required
    - `propertyTypes` object, required
  - `entityPermissions` object
  - `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

---

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