---
title: "Update Plan"
method: PATCH
path: "/api/discovery-plans/{plan_id}"
tags: ["Discovery"]
---

# Update Plan

`PATCH /api/discovery-plans/{plan_id}`

## Request

- Base URL: `https://api.kolens.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolens.ai/api/discovery-plans/{plan_id}`
- Auth: HTTP bearer

## Path parameters

- `plan_id` string, required

## Headers

- `x-kolens-user-id` string, nullable

## Request body

- DiscoveryPlanUpdate
  - `name` string, nullable
  - `keyword` string, nullable
  - `platform` string, nullable
  - `interval_hours` integer, nullable
  - `max_videos_per_run` integer, nullable
  - `region` string, nullable: ISO-3166 alpha-2 country code. Send an empty string to clear the plan's region back to the global default.
  - `filters` DiscoveryFilters: Filters applied to scraped KOLs before auto-adding to target_list.
    - `min_followers` integer, nullable
    - `max_followers` integer, nullable
    - `min_avg_views` integer, nullable
    - `min_engagement_rate` number, nullable
    - `require_email` boolean
    - `roles_in` string[], nullable: Only auto-add authors whose dominant role is in this list. Allowed values: KOL, Seller, Customer, Passenger.
  - `target_list_id` string, nullable
  - `status` 'draft' | 'active' | 'disabled', nullable
  - `data_source` string, nullable

## Response `200`

Successful Response

- DiscoveryPlanOut
  - `id` string, required
  - `name` string, required
  - `keyword` string, required
  - `platform` string, required
  - `interval_hours` integer, required
  - `max_videos_per_run` integer, required
  - `region` string, nullable
  - `filters` object, nullable, required
  - `target_list_id` string, nullable, required
  - `status` 'draft' | 'active' | 'disabled', required
  - `effective_status` 'draft' | 'active' | 'disabled' | 'queued' | 'running' | 'failed', required
  - `data_source` string, required
  - `last_run_at` string, nullable, required
  - `next_run_at` string, nullable, required
  - `last_job_id` string, nullable, required
  - `last_job_status` string, nullable
  - `last_error` string, nullable
  - `created_at` string, required
  - `updated_at` string, required
  - `query_plan` QueryPlanEcho: Display-only echo of how the NL query planner interpreted a typed intent sentence (Phase 1). Returned on the create / search-submit response so the UI can show "Interpreted as: [terms] · filters". Only present when the planner flag is ON *and* the planner produced a real (non-passthrough) interpretation — null otherwise so existing clients ignore it. An editable confirm step is Phase 2.
    - `raw_query` string, required
    - `search_terms` string[]
    - `filters` object
    - `market` string, nullable
    - `language` string, nullable
    - `notes` string

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kolens/apis/kolens-api.md) · [All operations](https://skmtc.dev/kolens/apis/kolens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kolens/apis/kolens-api/revisions/5d6865ab0a24?raw)
