---
title: "Search sessions"
method: GET
path: "/sessions/search"
tags: ["Sessions"]
---

# Search sessions

`GET /sessions/search`

Search for sessions using SQL LIKE queries across title, summary, and query fields.
Only returns "normal" leaf sessions (not archived, not draft, not discarded, no children).
Returns top sessions ordered by last_activity_at descending.
Limited to 20 most recently modified sessions for performance.

## Query parameters

- `query` string
- `limit` integer

## Response `200`

Search results

- SessionSearchResponse
  - `data` Session[], required
    - `id` string, required — Unique session identifier
    - `run_id` string, required — Unique run identifier
    - `claude_session_id` string — Claude's internal session ID
    - `parent_session_id` string — Parent session ID if this is a forked session
    - `status` 'draft' | 'starting' | 'running' | 'completed' | 'failed' | 'interrupting' | 'interrupted' | 'waiting_input' | 'discarded', required — Current status of the session
    - `query` string, required — Initial query that started the session
    - `summary` string — AI-generated summary of the session
    - `title` string — User-editable session title
    - `model` string — Model used for this session
    - `model_id` string — Full model identifier
    - `working_dir` string — Working directory for the session
    - `additional_directories` string[] — Additional directories Claude can access
    - `created_at` string, date-time, required — Session creation timestamp
    - `last_activity_at` string, date-time, required — Last activity timestamp
    - `completed_at` string, date-time, nullable — Session completion timestamp
    - `error_message` string — Error message if session failed
    - `cost_usd` number, float, nullable — Total cost in USD
    - `input_tokens` integer, nullable — Number of input tokens
    - `output_tokens` integer, nullable — Number of output tokens
    - `cache_creation_input_tokens` integer, nullable — Number of cache creation input tokens
    - `cache_read_input_tokens` integer, nullable — Number of cache read input tokens
    - `effective_context_tokens` integer, nullable — Total tokens counting toward context window limit
    - `context_limit` integer, nullable — Context window limit for the model
    - `duration_ms` integer, nullable — Session duration in milliseconds
    - `auto_accept_edits` boolean — Whether edit tools are auto-accepted
    - `dangerously_skip_permissions` boolean — When true, all tool calls are automatically approved without user consent
    - `dangerously_skip_permissions_expires_at` string, date-time, nullable — ISO timestamp when dangerously skip permissions mode expires (optional)
    - `archived` boolean — Whether session is archived
    - `proxy_enabled` boolean — Whether proxy is enabled for this session
    - `proxy_base_url` string — Base URL of the proxy server
    - `proxy_model_override` string — Model to use with the proxy
    - `editor_state` string, nullable — JSON blob of editor state for draft sessions

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

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