---
title: "Search documents"
method: POST
path: "/api/datasphere/documents/search"
tags: ["Documents"]
---

# Search documents

`POST /api/datasphere/documents/search`

Search Datasphere Documents.

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _DataSphere_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

## Request body

- DatasphereDocumentSearchRequest
  - `tags` string[] — Document tags.
  - `document_id` string, uuid — Universal Unique Identifier.
  - `query_string` string, required — Search term.
  - `distance` number — Specifies how closely related the query is to the document. Low distance means high relevance and similarity. High distance means low relevance and similarity.
  - `count` integer — Specifies number of returned Chunks.
  - `language` string — Language of the Document.
  - `pos_to_expand` string[] — Part of Speech considered for expansion or analysis.
  - `max_synonyms` integer — Maximum number of synonyms to consider.

## Response `200`

The request has succeeded.

- DatasphereSearchResponse
  - `chunks` DatasphereChunk[], required — A list of search result chunks.
    - `text` string, required — A search result.
    - `document_id` string, uuid, required — Universal Unique Identifier.

## Other responses

- `400` — The request is invalid.
- `401` — Access is unauthorized.
- `422` — The request contains invalid parameters. See errors for details.
- `500` — An internal server error occurred.

---

[API](https://skmtc.net/signalwire/apis/signalwire-rest-api.md) · [All operations](https://skmtc.net/signalwire/apis/signalwire-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/signalwire/signalwire-rest-api/versions/05c5164b85c7/schema)
