Skip to content
Context docs
Tasks API

Task roots

Serverhttps://context.example.com/api/v1

Read, rename and cancel top-level tasks, including tasks started in the app rather than through this API.


List root conversations

GET
https://context.example.com/api/v1
/tasks/roots
Bearer (tsk_<prefix>_<secret>)

Pages through the top-level tasks the key can read, most recently updated first, without their subtasks. Pass the returned cursor back as cursor for the next page.

List root conversations › query Parameters

cursor
​string · minLength: 1
limit
​integer · max: 100
Default: 50

List root conversations › Responses

A page of root conversations.

​object[] · required
nextCursor
​string | null · required

Get a root conversation

GET
https://context.example.com/api/v1
/tasks/roots/{taskId}
Bearer (tsk_<prefix>_<secret>)

Returns the metadata of one top-level task: its title, agent, workspace and lifecycle status. A subtask or a task the key cannot read answers 404.

Get a root conversation › path Parameters

taskId
​string · required

The task's id.

Get a root conversation › Responses

The root conversation.

Root task metadata
taskId
​string · minLength: 1 · required

Root task.id, never a dispatch or runtime run ID

title
​string | null · required
orgId
​string · minLength: 1 · required
agentId
​string | null · minLength: 1 · required
workspaceId
​string | null · minLength: 1 · required
workspaceName
​string | null · required

The workspace's display name; null when the task is in no workspace

status
​string · enum · required

Persisted root lifecycle status, not runtime execution status

Enum values:
planned
active
completed
failed
archived
createdAt
​string · date-time · required
updatedAt
​string · date-time · required

Update a root conversation

PATCH
https://context.example.com/api/v1
/tasks/roots/{taskId}
Bearer (tsk_<prefix>_<secret>)

Renames a top-level task, or clears its title with null. The key must act as the task's owner; a service account key names the owner with ownerUserId or ownerUserEmail.

Update a root conversation › path Parameters

taskId
​string · required

The task's id.

Update a root conversation › Request Body

Rename or clear a root title; explicit service-key owner delegation is authorized separately
title
​string | null · minLength: 1 · maxLength: 280 · required
ownerUserId
​string · minLength: 1
ownerUserEmail
​string · email

Update a root conversation › Responses

The updated root conversation.

Root task metadata
taskId
​string · minLength: 1 · required

Root task.id, never a dispatch or runtime run ID

title
​string | null · required
orgId
​string · minLength: 1 · required
agentId
​string | null · minLength: 1 · required
workspaceId
​string | null · minLength: 1 · required
workspaceName
​string | null · required

The workspace's display name; null when the task is in no workspace

status
​string · enum · required

Persisted root lifecycle status, not runtime execution status

Enum values:
planned
active
completed
failed
archived
createdAt
​string · date-time · required
updatedAt
​string · date-time · required

Cancel a root conversation

POST
https://context.example.com/api/v1
/tasks/roots/{taskId}/cancel
Bearer (tsk_<prefix>_<secret>)

The body is optional.

Cancel a root conversation › path Parameters

taskId
​string · required

The task's id.

Cancel a root conversation › Request Body optional

ownerUserId
​string · minLength: 1
ownerUserEmail
​string · email

Cancel a root conversation › Responses

What the cancellation did (outcome).

anyOf
At least one variant must match. Multiple variants may match simultaneously.

Decision Table

VariantMatching Criteria
type = object · requires: taskId, dispatchRunId, outcome
type = object · requires: taskId, dispatchRunId, outcome +1 more
type = object · requires: taskId, dispatchRunId, outcome
type = object · requires: taskId, dispatchRunId, outcome
type = object · requires: taskId, taskRunId, outcome +1 more
type = object · requires: taskId, outcome
Properties for Variant 1:
taskId
​string · minLength: 1 · required
dispatchRunId
​string · minLength: 1 · required
outcome
​string · enum · required
Enum values:
cancelled-before-execution
taskRunId
​string · minLength: 1