---
title: "Update Task Route"
method: PATCH
path: "/api/crm/tasks/{task_id}"
tags: ["CRM"]
---

# Update Task Route

`PATCH /api/crm/tasks/{task_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/crm/tasks/{task_id}`
- Auth: HTTP bearer

PATCH a scheduled task.

Auth model is identical to the rest of /api/crm: workspace member
can edit any task in their workspace. Status transitions are
restricted to ``pending → cancelled`` and ``pending → done`` — the
scheduler owns ``failed``, and re-opening a terminal task is not
supported (clients should create a new one).

## Path parameters

- `task_id` string, required

## Headers

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

## Request body

- UpdateTaskRequest: PATCH a scheduled task. All fields optional — only fields explicitly present in the JSON are touched. ``action_payload`` is a sentinel field: send the key as ``null`` to clear it, omit it to leave it alone.
  - `next_run_at` string, date-time, nullable
  - `recurrence_rule` string, nullable
  - `action_kind` 'reminder' | 'send_template' | 'next_action_recompute', nullable
  - `action_payload` object, nullable
  - `status` 'done' | 'cancelled', nullable

## Response `200`

Successful Response

- TaskOut
  - `id` string, required
  - `conversation_id` string, required
  - `title` string, required
  - `due_at` string, date-time, nullable
  - `completed_at` string, date-time, nullable
  - `assignee_user_id` string, nullable
  - `recurring_rule_text` string, nullable
  - `created_at` string, date-time, required
  - `status` 'pending' | 'done' | 'cancelled' | 'failed'
  - `next_run_at` string, date-time, nullable
  - `action_kind` 'reminder' | 'send_template' | 'next_action_recompute'
  - `action_payload` object, nullable
  - `attempt_count` integer
  - `error_message` string, nullable

## 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)
