---
title: "POST /logs/global/search"
method: POST
path: "/logs/global/search"
tags: ["Logs"]
---

# POST /logs/global/search

`POST /logs/global/search`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/logs/global/search`
- Auth: HTTP bearer

## Request body

- GlobalLogSearchRequest: Filter body shared by `/logs/global/search` and `/logs/global/facets`. Both endpoints take the identical filter set so a facet count always describes the search the user is actually looking at.
  - `attrs` string[]: Attribute predicates (ADR-047 §5): `<key><op><value>` with `op` one of `=`, `!=`, `^=` (prefix), `>`, `<`, or `<key>?` for "exists". Requires the line index; when combined with `text`, the text filter is applied in memory over the lines the index already matched (the index holds no message bytes, so it cannot answer `text` on its own).
  - `container_ids` string[]: Docker container IDs.
  - `cursor` string, nullable: Opaque cursor from the previous page's `next_cursor`.
  - `deploy_id` integer, nullable
  - `end_time` string, required
  - `envs` string[]
  - `external_services` string[]: Database/service IDs or names, not container service labels.
  - `levels` LogLevel[]
  - `node_ids` integer[]
  - `page_size` integer, nullable: Defaults to 200, server-capped at 1000.
  - `projects` string[]: Match project ID, slug or name. Empty selects all authorized projects.
  - `scopes` string[]: Explicit resource identities, e.g. `application:12` or `service:34`.
  - `services` string[]: Container service labels (the `service` column), e.g. `web`, `worker`.
  - `source` 'collected' | 'application' | 'service': Which family of log sources a query covers.
  - `start_time` string, required
  - `text` string, nullable: Case-insensitive substring match over the message.

## Response `200`

- GlobalLogSearchResponse: A page of global search results.
  - `lines` GlobalLogLine[], required: Newest first, ordered by `(timestamp, container_id, line_id)`.
    - `container_id` string: Container this line came from — lets the UI tag/group lines by container in a combined ("show all") multi-container view, and is the second component of the line's identity.
    - `context` LineContext, nullable: Raw surrounding lines for a single match (grep -C style).
      - `after` ContextLine[], required: Lines immediately after the match, oldest-first.
        - `fields` unknown
        - `is_match` boolean, required: Whether this line matched the original search
        - `level` 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR', required: Normalized log level
        - `line_id` string, required: Decimal string form of this line's `line_id` — see [`LogSearchLine`].
        - `message` string, required
        - `timestamp` string, required
      - `before` ContextLine[], required: Lines immediately before the match, oldest-first.
        - `fields` unknown
        - `is_match` boolean, required: Whether this line matched the original search
        - `level` 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR', required: Normalized log level
        - `line_id` string, required: Decimal string form of this line's `line_id` — see [`LogSearchLine`].
        - `message` string, required
        - `timestamp` string, required
    - `deploy_id` integer, nullable
    - `fields` unknown
    - `level` 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR', required: Normalized log level
    - `line_id` string, required: Decimal string form of the line's `line_id`. See the type docs.
    - `message` string, required
    - `node_id` integer, nullable: Worker node the line came from (`None` = control-plane-local).
    - `node_name` string, nullable: Human-readable node name for display.
    - `service` string, required
    - `stream` 'stdout' | 'stderr', required: stdout or stderr.
    - `timestamp` string, required
    - `env` string, required
    - `external_service_id` integer, nullable
    - `owner` string, required: Display name of the owning project or external service.
    - `project_id` integer, nullable: `None` for external-service lines.
  - `next_cursor` string, nullable: Opaque cursor for the next (older) page, or `None` on the last page. This is a keyset position over the store's own sort order, so page 40 costs what page 1 costs. Stays populated on a partial page too — that is the whole point: the user can press Next to keep searching.
  - `partial` boolean, required: `true` when the store's time/byte budget ran out before this page could be proven complete (`scanned_back_to` explains how far).
  - `scanned_back_to` string, nullable: Set when `partial` is `true`: every chunk ending after this timestamp has been searched, nothing older has yet.

## Other responses

- `400`
- `403`
- `408`

## Changes

- **2026-11-09** `12896146b193`: 3 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `408` status
- **2026-10-05** `4b228ebed583`: 7 breaking, 13 info
  - removed the required property `lines/items/allOf[#/components/schemas/LogSearchLine]/chunk_id` from the response with the `200` status
  - removed the required property `lines/items/allOf[#/components/schemas/LogSearchLine]/context/oneOf[#/components/schemas/LineContext]/after/items/line_offset` from the response with the `200` status
  - removed the required property `lines/items/allOf[#/components/schemas/LogSearchLine]/context/oneOf[#/components/schemas/LineContext]/before/items/line_offset` from the response with the `200` status
  - removed the required property `lines/items/allOf[#/components/schemas/LogSearchLine]/line_offset` from the response with the `200` status
  - …16 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/logs/global/search/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
