---
title: "Get context lines surrounding a specific log line"
method: GET
path: "/logs/context"
tags: ["Logs"]
---

# Get context lines surrounding a specific log line

`GET /logs/context`

## Request

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

## Query parameters

- `timestamp` string, required
- `container_id` string, required
- `line_id` string, required
- `lines` integer

## Response `200`

Context lines

- ContextLogsResponse
  - `lines` ContextLine[], required
    - `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
  - `target_index` integer, required

## Other responses

- `400`: Invalid parameters
- `401`: Unauthorized
- `404`: Line not found
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 4 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `404` status
  - removed the required property `extensions` from the response with the `500` status
- **2026-10-05** `4b228ebed583`: 4 breaking, 2 warning, 5 info
  - added the new required `query` request parameter `container_id`
  - added the new required `query` request parameter `line_id`
  - added the new required `query` request parameter `timestamp`
  - removed the required property `lines/items/line_offset` from the response with the `200` status
  - …7 more
- **2026-10-05** `63a80791dc58`: 3 breaking, 7 warning, 1 info
  - added the new required `query` request parameter `chunk_id`
  - added the new required `query` request parameter `line_offset`
  - removed the required property `lines/items/line_id` from the response with the `200` status
  - deleted the `query` request parameter `container_id`
  - …7 more
- **2026-09-23** `f4efc4d5c7b7`: 4 info
  - added the optional property `status` to the response with the `400` status
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `404` status
  - added the optional property `status` to the response with the `500` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/logs/context/get.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)
