---
title: "POST /entity-types/query"
method: POST
path: "/entity-types/query"
tags: ["Graph", "EntityType"]
---

# POST /entity-types/query

`POST /entity-types/query`

## Headers

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

## Request body

- QueryEntityTypesParams
  - `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
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `notEqual` FilterExpression[], required
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `exists` PathExpression, required
        - `path` union[], required
          - union
            - 'baseUrl' | 'version' | 'versionedUrl' | 'webId' | 'title' | 'description' | 'type' | 'inheritsFrom' | 'children' | 'editionProvenance' | 'embedding' — A single token in a [`DataTypeQueryPath`].
            - 'baseUrl' | 'version' | 'versionedUrl' | 'webId' | 'title' | 'description' | 'editionProvenance' | 'dataTypes' | 'propertyTypes' | 'embedding' — A single token in a [`DataTypeQueryPath`].
            - 'baseUrl' | 'version' | 'versionedUrl' | 'webId' | 'title' | 'description' | 'properties' | 'required' | 'labelProperty' | 'icon' | 'editionProvenance' | 'links' | 'linkDestinations' | 'inheritsFrom' | 'children' | 'embedding' — A single token in a [`EntityTypeQueryPath`].
            - 'uuid' | 'editionId' | 'draftId' | 'archived' | 'webId' | 'type' | 'properties' | 'label' | 'createdById' | 'editionCreatedById' | 'createdAtTransactionTime' | 'createdAtDecisionTime' | 'provenance' | 'editionProvenance' | 'embedding' | 'incomingLinks' | 'outgoingLinks' | 'leftEntity' | 'rightEntity' — A single token in an [`EntityQueryPath`].
            - '*'
            - 'convert'
            - string
            - number
    - object
      - `greater` FilterExpression[]
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `greaterOrEqual` FilterExpression[]
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `less` FilterExpression[]
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `lessOrEqual` FilterExpression[]
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `startsWith` FilterExpression[], required
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `endsWith` FilterExpression[], required
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
    - object
      - `containsSegment` FilterExpression[], required
        - union
          - PathExpression
            - `path` union[], required
              - …
          - ParameterExpression
            - `convert` object
              - …
            - `parameter` unknown, required
  - `includeCount` boolean
  - `includeEditionCreatedByIds` boolean
  - `includeWebIds` 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
            - object
              - …
            - object
              - …
          - `start` union, required
            - object
              - …
            - object
              - …
            - object
              - …
    - 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
            - object
              - …
            - object
              - …
          - `start` union, required
            - object
              - …
            - object
              - …
            - object
              - …
  - `includeEntityTypes` 'closed' | 'resolved' | 'resolvedWithDataTypeChildren'

## Response `200`

Gets a a list of entity types that satisfy the given query.

- QueryEntityTypesResponse
  - `closedEntityTypes` ClosedEntityType[] — unresolved $ref
  - `count` integer
  - `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}`
  - `definitions` EntityTypeResolveDefinitions
    - `dataTypes` object, required
    - `entityTypes` object, required
    - `propertyTypes` object, required
  - `editionCreatedByIds` object
  - `entityTypes` EntityTypeWithMetadata[], required
    - `metadata` union, required
      - 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
        - `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
              - …
    - `schema` EntityType, required — unresolved $ref
  - `webIds` object

## Other responses

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

## Changes

- **2026-07-10** `0f1f205334eb` — 40 info
  - added the new `createdAtDecisionTime` enum value to the request property `allOf[#/components/schemas/CommonQueryEntityTypesParams]/filter/oneOf[subschema #10: LessOrEqualFilter]/lessOrEqual/items/oneOf[subschema #1: PathExpression]/path/items/oneOf[#/components/schemas/EntityQueryToken]/`
  - added the new `createdAtDecisionTime` enum value to the request property `allOf[#/components/schemas/CommonQueryEntityTypesParams]/filter/oneOf[subschema #11: StartsWithFilter]/startsWith/items/oneOf[subschema #1: PathExpression]/path/items/oneOf[#/components/schemas/EntityQueryToken]/`
  - added the new `createdAtDecisionTime` enum value to the request property `allOf[#/components/schemas/CommonQueryEntityTypesParams]/filter/oneOf[subschema #12: EndsWithFilter]/endsWith/items/oneOf[subschema #1: PathExpression]/path/items/oneOf[#/components/schemas/EntityQueryToken]/`
  - added the new `createdAtDecisionTime` enum value to the request property `allOf[#/components/schemas/CommonQueryEntityTypesParams]/filter/oneOf[subschema #13: ContainsSegmentFilter]/containsSegment/items/oneOf[subschema #1: PathExpression]/path/items/oneOf[#/components/schemas/EntityQueryToken]/`
  - …36 more
- **2026-06-29** `88cca4a72bed` — 1 breaking
  - removed `subschema #11: CosineDistanceFilter` from the `allOf[#/components/schemas/CommonQueryEntityTypesParams]/filter` request property `oneOf` list
- …earlier changes not shown

[Full history](https://skmtc.dev/hashintel/apis/graph/changes/entity-types/query/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)
