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

# POST /entity-types/search

`POST /entity-types/search`

## Headers

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

## Request body

- SearchEntityTypesRequest — Request body for the entity type embedding search endpoint. Exactly one of `embedding` or `semanticString` must be provided. `semanticString` is converted into an embedding by the server, which requires an embedding client to be configured.
  - `embedding` number[]
  - `limit` integer, nullable
  - `maximumSemanticDistance` number, double, required
  - `semanticString` string

## Response `200`

Entity types ordered by ascending cosine distance to the query embedding.

- SearchEntityTypesResponse — Response for [`EntityTypeStore::search_entity_types`].
  - `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

## Other responses

- `400` — 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)
