---
title: "Cancel a deep search"
method: POST
path: "/deepSearch/{id}/cancel"
tags: ["Deep Search"]
---

# Cancel a deep search

`POST /deepSearch/{id}/cancel`

## Request

- Base URL: `https://api.cloudglue.dev/v1`
- URL: `https://api.cloudglue.dev/v1/deepSearch/{id}/cancel`
- Auth: HTTP bearer

Cancel a background deep search that is in progress. If the deep search is already completed, failed, or cancelled, this returns the deep search as-is.

## Path parameters

- `id` string, uuid, required

## Response `200`

Deep search cancelled or current status returned

- DeepSearch
  - `id` string, uuid: Deep search ID
  - `object` 'deep_search': Object type identifier
  - `status` 'in_progress' | 'completed' | 'failed' | 'cancelled': Current status of the deep search
  - `created_at` number: Unix timestamp of when the deep search was created
  - `query` string: The original search query
  - `scope` 'segment' | 'file', nullable: The scope the caller requested. Null when the request omitted scope (auto: the planner chose scopes per search plan, so results may mix segment and file types).
  - `text` string, nullable: LLM-generated synthesis text summarizing the results
  - `results` DeepSearchResult[], nullable: Array of search results
    - `type` 'segment' | 'file': The type of result
    - `id` string, uuid: Result ID
    - `file_id` string, uuid: The file ID this result belongs to
    - `collection_id` string, uuid: The collection ID this result belongs to. Present when using `collections` source; omitted for `files` and `default` sources.
    - `score` number: Relevance score
    - `context` string: LLM-generated context explaining why this result is relevant
    - `segment_id` string, uuid: Segment ID (present when type is 'segment')
    - `start_time` number: Start time in seconds (present when type is 'segment')
    - `end_time` number: End time in seconds (present when type is 'segment')
    - `title` string, nullable: Segment title
    - `filename` string, nullable: Original filename
    - `thumbnail_url` string, nullable: URL to a thumbnail image
    - `metadata` object, nullable: Additional metadata
    - `summary` string, nullable: File summary (present when type is 'file')
    - `generated_title` string, nullable: Generated title (present when type is 'file')
  - `total` integer: Total number of results
  - `limit` integer: Maximum number of results requested
  - `search_queries` DeepSearchSearchQueryPlan[], nullable: Intermediate search query plans (included when requested via include=['search_queries'])
    - `query` string: The search query
    - `search_modalities` string[]: Modalities used for this search
    - `scope` string: Search scope
    - `filter` object, nullable: Optional filter applied
    - `result_count` integer: Number of results returned for this query
  - `usage` DeepSearchUsage
    - `input_tokens` integer: Number of input tokens used
    - `output_tokens` integer: Number of output tokens used
    - `total_tokens` integer: Total number of tokens used
    - `search_calls` integer: Number of search calls made
  - `error` object, nullable: Error details if the deep search failed
    - `message` string
    - `type` string
    - `code` string

## Other responses

- `404`: Deep search not found
- `500`: An unexpected error occurred on the server

## Changes

- **2026-10-30** `23d3f240819f`: 2 info
  - added the optional property `code` to the response with the `404` status
  - added the optional property `code` to the response with the `500` status
- **2026-08-12** `725b9736a231`: 1 breaking
  - the response property `scope` became nullable for the status `200`
- **2026-03-16** `9dc639e1d66c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cloudglue/apis/cloudglue-api/changes/deepSearch/:id/cancel/post.md)

---

[API](https://skmtc.dev/cloudglue/apis/cloudglue-api.md) - [All operations](https://skmtc.dev/cloudglue/apis/cloudglue-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudglue/apis/cloudglue-api/revisions/23d3f240819f?raw)
