Docs Open org

API reference

Tasks API

Tasks and entries: the queue, workflow actions, refile and archive

GET /orgs/{org}/entries/{ref}

Any entry (a heading or an inline task).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe entry's short ID or UUID.

Responses

200
OK. EntryView application/json

GET /orgs/{org}/tasks

Tasks you can read that match, ranked (§7.10) unless the query sorts.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
qquerystringA query (§9.1).
matchquerystringOrg match syntax (+work-someday/TODO).
statusquerystringA queue status: ready, blocked, claimed, review, …
ownerquerystringAn owner handle, me or none.
limitqueryinteger (int32)Page size.
cursorquerystringCursor.
tzquerystringThe viewer's IANA zone for floating times and relative dates (default: the account's).

Responses

200
OK. Paged_TaskView application/json
422
Invalid. ProblemBody application/json

POST /orgs/{org}/tasks

Creates a task: on the named page (and heading, or date tree), else in the owner's inbox, else yours (§7.3).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.

Request body

application/json, TaskInput.

FieldTypeDescription
bodystring | nullBody (Markdown).
createdstring (date-time) | nullThe original creation time (created::).
deadlinestring | nulldeadline::
dependsstring[]depends:: short IDs.
effortstring | nullEffort (30m, 1:30).
external_idstring | nullexternal_id::, unique per source.
keywordstring | nullThe TODO keyword (default: the first of the page's first sequence; "" for none).
ownerstring | nullowner:: handle.
prioritystring | nullPriority letter.
propertiesmap of stringOther properties.
scheduledstring | nullscheduled:: (a timestamp, date or RFC 3339 instant).
sourcestring | nullImport provenance (source::), for upserts.
tagsstring[]Tags.
targetnull | TargetInput
title requiredstringTitle.

Responses

201
Created. TaskView application/json
404
Not found. ProblemBody application/json

GET /orgs/{org}/tasks/{ref}

A task.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.

Responses

200
OK. TaskView application/json
404
Not found. ProblemBody application/json

PATCH /orgs/{org}/tasks/{ref}

Edits a task's fields. Contract fields are locked while a live claim holds them (409 contract_locked).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.
If-Matchheaderstring | nullThe task's containing page's strong ETag. If supplied, it must match the current revision; a mismatch returns 409 revision_conflict.

Request body

application/json, PatchTask.

FieldTypeDescription
acceptancestring | nullacceptance::
base_revisioninteger (int64) | nullThe revision the edit was based on.
bodystring | nullBody.
deadlinestring | nulldeadline::
dependsstring[] | nulldepends:: short IDs.
effortstring | nullEffort (30m; "" clears).
ownerstring | nullowner::
prioritystring | nullPriority letter.
propertiesmap of string | nullOther properties (null removes).
scheduledstring | nullscheduled::
tagsstring[] | nullTags.
titlestring | nullTitle.

Responses

200
OK. TaskView application/json
409
Conflict. ProblemBody application/json

POST /orgs/{org}/tasks/{ref}/actions/{action}

Runs a workflow action (§7.5–§7.8): the text, task_coord and events commit together.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task.
action requiredpathstringclaim, renew, release, submit, approve, reject, cancel, reopen, complete, set_state, clock_in, clock_out or note.
If-Matchheaderstring | nullThe task's containing page's strong ETag. If supplied, it must match the current revision independently of base_revision; a mismatch returns 409 revision_conflict.

Request body

application/json, ActionBody.

FieldTypeDescription
base_revisioninteger (int64) | nullThe page revision the action was based on.
claim_idstring (uuid) | nullThe claim (claims are idempotent per claim_id; one is minted if absent).
completion_sourceCompletionSourceCompletion attribution (complete, or set_state to done); defaults to performed.
evidencestring | nullEvidence (submit, approve, reject).
keywordstring | nullThe keyword (set_state).
lease_minutesinteger (int32) | nullLease length (1–240 minutes).
notestring | nullA note (release, complete, set_state, note), or the reason (cancel, reopen).
override_claimbooleanA human overriding someone else's claim.
reasonstring | nullThe reason (cancel, reopen).

Responses

200
OK. ActionResponse application/json
409
Conflict. ProblemBody application/json

POST /orgs/{org}/tasks/{ref}/archive

Archives a task (§7.12): to the page's archive: target (created on demand) with the archive_* metadata, else archived:: true in place.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.

Responses

200
OK. TaskView application/json

GET /orgs/{org}/tasks/{ref}/context

The context packet (§15.4): the task, its ancestors, linked pages, backlinks, decisions, attachments and secret names.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.
detailqueryDetailsummary (default) or full.

Responses

200
OK. ContextPacket application/json

POST /orgs/{org}/tasks/{ref}/refile

Moves a task's subtree (children, id::s and logbook included) under a heading or to the end of a page, atomically across both pages.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.

Request body

application/json, RefileBody.

FieldTypeDescription
base_revisioninteger (int64) | nullThe revision of the task's page the move was based on.
headingstring | nullA heading on it (default: the end of the page).
page requiredstringThe target page (short ID, id or title).

Responses

200
OK. TaskView application/json

POST /orgs/{org}/tasks:batch

Creates or upserts up to 500 tasks in one transaction (§23.2).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.

Request body

application/json, BatchBody.

FieldTypeDescription
dry_runbooleanReport what would happen, writing nothing.
import_idstring (uuid) | nullRecord the items in this import (so it can be undone as a unit).
items requiredTaskInput[]The tasks. Items with source and external_id upsert.
sourcestring | nullThe default source for items.

Responses

200
OK. BatchResult application/json