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

# Search

`POST /api/search`

Search your organization's connected content and return ranked document results with cursor pagination. Use `GET /api/search/filters` to discover datasource identifiers and common filter fields. Built-in filter names are validated; other field names are accepted as custom filters and behavior depends on your Glean configuration and connected sources.
Errors: HTTP 422 `unprocessable_query` returns no `results` or `next_cursor`. See `warnings` on the response for non-blocking issues such as partially available results. Not every query issue produces a warning or error.

## Request body

- PlatformSearchRequest
  - `query` string, required — The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
  - `page_size` integer — Number of results to return per page.
  - `cursor` string, nullable — Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request.
  - `datasources` string[] — Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type.
  - `filters` PlatformFilter[] — Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources.
    - `field` string, required — Filter field name. Built-in names (case-sensitive, lowercase only): `type`, `owner`, `from`, `author`, `channel`, `status`, `assignee`, `reporter`, `component`, `mentions`, and `collection`. Built-ins accept only `EQUALS` and `NOT_EQUALS`. Any other nonblank name is accepted as a custom filter without spelling, existence, or type checks; behavior depends on your connected sources.
    - `values` string[], required — One or more values to match. Prefer values returned by filter discovery unchanged. For people (`USER`) fields, values may be email addresses or display names.
    - `operator` 'EQUALS' | 'NOT_EQUALS' | 'GT' | 'GTE' | 'LT' | 'LTE' — Supported filter operator.
  - `time_range` PlatformTimeRange — Filter results to those last updated within this range.
    - `start` string, date-time — Inclusive lower bound in ISO 8601 format.
    - `end` string, date-time — Exclusive upper bound in ISO 8601 format.

## Response `200`

Successful response.

- PlatformSearchResponse
  - `results` PlatformResult[], required — Ordered list of ranked document results. People cards, Q&A blocks, and other UI-only result types are not included.
    - `url` string, uri, required — Canonical URL of the result.
    - `title` string, required — Result title.
    - `snippets` string[] — Query-relevant plain-text excerpts from the result body.
    - `datasource` string, required — The datasource this result originates from.
    - `document_type` string, nullable — The document type within the datasource.
    - `creator` PlatformPersonReference — A lightweight reference to a person, used where a payload merely points at someone.
      - `id` string — Opaque Glean person ID.
      - `name` string, required — Display name.
    - `owner` PlatformPersonReference — A lightweight reference to a person, used where a payload merely points at someone.
      - `id` string — Opaque Glean person ID.
      - `name` string, required — Display name.
    - `updated_at` string, date-time, nullable — When the result was last modified.
    - `created_at` string, date-time, nullable — When the result was created.
  - `has_more` boolean, required — Indicates whether additional pages of results are available.
  - `next_cursor` string, nullable, required — Opaque token to pass as `cursor` in the next request.
  - `request_id` string, required — Platform-generated request ID for support correlation.
  - `warnings` PlatformWarning[], required — Non-blocking warnings for this response. Required; use `[]` when there are none. Clients must tolerate unknown warning codes. `results_incomplete` means some results may be unavailable for the requested datasource scope while `results`, `has_more`, and `next_cursor` remain present. Warning messages are generic and do not include query text or internal identifiers.
    - `code` string, required — Open snake_case warning code. Clients must tolerate unknown values; the set of codes is not a closed enum.
    - `message` string, required — Human-readable warning message.

## Other responses

- `400` — Invalid request (malformed JSON, invalid parameter values, unknown fields).
- `401` — Missing or invalid authentication token.
- `403` — Token valid but lacks permission for the requested operation.
- `404` — Resource not found.
- `408` — Backend did not respond within the timeout window.
- `413` — Request body exceeds the maximum allowed size.
- `422` — Syntactically valid but semantically incorrect request.
- `429` — Rate limit exceeded. Includes Retry-After header.
- `500` — Unexpected server-side failure.
- `503` — Backend temporarily unavailable.

## Changes

> 68 revisions in range; 12 could not be searched.

- **2026-07-02** `8d67513963e9` — 16 warning, 1 info
  - added the new `request_too_large` enum value to the `code` response property for the response status `400`
  - added the new `request_too_large` enum value to the `code` response property for the response status `401`
  - added the new `request_too_large` enum value to the `code` response property for the response status `403`
  - added the new `request_too_large` enum value to the `code` response property for the response status `404`
  - …13 more
- **2026-07-01** `affb3c2f206c` — 8 info
  - added the optional property `errors` to the response with the `400` status
  - added the optional property `errors` to the response with the `401` status
  - added the optional property `errors` to the response with the `403` status
  - added the optional property `errors` to the response with the `404` status
  - …4 more
- **2026-06-19** `80c92120eee4` — 2 warning, 4 info
  - removed the optional property `results/items/creator/email` from the response with the `200` status
  - removed the optional property `results/items/owner/email` from the response with the `200` status
  - added the optional property `results/items/creator/id` to the response with the `200` status
  - added the optional property `results/items/owner/id` to the response with the `200` status
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/gleanwork/apis/glean-platform-api/changes/api/search/post.md)

---

[API](https://skmtc.dev/gleanwork/apis/glean-platform-api.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-platform-api/revisions/46c121f70527/schema)
