Skip to content

API Reference

Interactive reference for the OpenTask REST API, auto-generated from the OpenAPI 3.1 specification.

REST API for OpenTask, a self-hosted task management application.

Authentication

All endpoints (except /api/health and /api/openapi) require authentication
via one of:

  • Bearer tokenAuthorization: Bearer <token> header
  • Reverse proxy header — configured via OPENTASK_PROXY_AUTH_HEADER env var
  • Session cookie — set by the web UI login flow

Bearer tokens are created via POST /api/tokens or the db:create-token CLI command.

Response format

Success: { "data": { ... } }

Error: { "error": "message", "code": "ERROR_CODE", "details": { ... } }

Servers

https://tasks.example.comYour OpenTask server

System


Health check

GET
/api/health

Responses

Server is running

application/json
JSON
{
"status": "running"
}

Samples


OpenAPI specification

GET
/api/openapi

Responses

OpenAPI 3.1 YAML specification

text/yaml
JSON
"string"

Samples


List tasks

GET
/api/tasks

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Parameters

Query Parameters

done

Filter by completion status (default false)

Type
boolean
project_id
Type
integer
label

Filter by label name

Type
string
search

Search in title and notes

Type
string
trashed
Type
boolean
archived
Type
boolean
overdue
Type
boolean
recurring
Type
boolean
one_off
Type
boolean
limit
Type
integer
Default
200
offset
Type
integer
Default
0

Responses

List of tasks

application/json
JSON
{
"data": [
{
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
]
}

Samples


Create task

POST
/api/tasks

Send a raw title string for AI enrichment, or provide structured fields
to bypass enrichment. AI enrichment triggers when only title is provided
(no due_at, priority=0, no labels, no rrule).

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"title": "string",
"due_at": "string",
"priority": 0,
"rrule": "string",
"recurrence_mode": "from_due",
"labels": [
"string"
],
"notes": "string",
"project_id": 0,
"auto_snooze_minutes": 0
}

Responses

Created task

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
}

Samples


Get task

GET
/api/tasks/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Task details

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
}

Samples


Delete task (soft delete to trash)

DELETE
/api/tasks/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Trashed task

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
}

Samples


Update task

PATCH
/api/tasks/{id}

PATCH semantics — only fields present in the body are updated.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"title": "string",
"due_at": "string",
"priority": 0,
"rrule": "string",
"recurrence_mode": "string",
"labels": [
"string"
],
"notes": "string",
"project_id": 0,
"auto_snooze_minutes": 0
}

Responses

Updated task with change metadata

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true,
"fields_changed": [
"string"
],
"description": "string"
}
}

Samples


Mark task done

POST
/api/tasks/{id}/done

For recurring tasks, advances due_at to the next occurrence.
For one-off tasks, sets done=true and archives.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Completed task

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true,
"was_recurring": true,
"next_due_at": "string"
}
}

Samples


Mark task undone (reopen)

POST
/api/tasks/{id}/undone

Only works for one-off tasks. For recurring tasks, use undo.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Reopened task

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
}

Samples


Snooze task

POST
/api/tasks/{id}/snooze

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"until": "string"
}

Responses

Snoozed task

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true,
"previous_due_at": "string",
"description": "string"
}
}

Samples


Restore task from trash

POST
/api/tasks/{id}/restore

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Restored task

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
}

Samples


Retry AI enrichment

POST
/api/tasks/{id}/reprocess

Re-runs AI enrichment using the original_title.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Task queued for reprocessing

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
}

Samples


Mark multiple tasks done

POST
/api/tasks/bulk/done

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"task_ids": [
0
]
}

Responses

Bulk operation result

application/json
JSON
{
"tasks_affected": 0
}

Samples


Snooze multiple tasks

POST
/api/tasks/bulk/snooze

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"task_ids": [
0
],
"until": "string"
}

Responses

Bulk operation result

application/json
JSON
{
"tasks_affected": 0
}

Samples


Snooze all overdue tasks

POST
/api/tasks/bulk/snooze-overdue

Snoozes all overdue P0-P3 tasks. P4 (Urgent) tasks are always excluded.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"until": "string",
"exclude_task_ids": [
0
]
}

Responses

Bulk operation result

application/json
JSON
{
"tasks_affected": 0
}

Samples


Edit multiple tasks

POST
/api/tasks/bulk/edit

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"task_ids": [
0
],
"changes": {
"priority": 0,
"labels": [
"string"
],
"project_id": 0
}
}

Responses

Bulk operation result

application/json
JSON
{
"tasks_affected": 0
}

Samples


Soft-delete multiple tasks

POST
/api/tasks/bulk/delete

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"task_ids": [
0
]
}

Responses

Bulk operation result

application/json
JSON
{
"tasks_affected": 0
}

Samples


List projects

GET
/api/projects

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

List of projects with task counts

application/json
JSON
{
"data": [
{
"id": 0,
"name": "string",
"owner_id": 0,
"shared": true,
"sort_order": 0,
"color": "string",
"active_count": 0,
"overdue_count": 0,
"created_at": "string"
}
]
}

Samples


Create project

POST
/api/projects

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"name": "string",
"color": "string"
}

Responses

Created project

application/json
JSON
{
"data": {
"id": 0,
"name": "string",
"owner_id": 0,
"shared": true,
"sort_order": 0,
"color": "string",
"active_count": 0,
"overdue_count": 0,
"created_at": "string"
}
}

Samples


Get project

GET
/api/projects/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Project details

application/json
JSON
{
"data": {
"id": 0,
"name": "string",
"owner_id": 0,
"shared": true,
"sort_order": 0,
"color": "string",
"active_count": 0,
"overdue_count": 0,
"created_at": "string"
}
}

Samples


Delete project

DELETE
/api/projects/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Deletion result

application/json
JSON
{
"data": {
"deleted": true
}
}

Samples


Update project

PATCH
/api/projects/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"name": "string",
"color": "string"
}

Responses

Updated project

application/json
JSON
{
"data": {
"id": 0,
"name": "string",
"owner_id": 0,
"shared": true,
"sort_order": 0,
"color": "string",
"active_count": 0,
"overdue_count": 0,
"created_at": "string"
}
}

Samples


Undo


Undo last action

POST
/api/undo

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Undo result

application/json
JSON
{
"data": {
"undone_action": "string",
"description": "string",
"tasks_affected": 0
}
}

Samples


Redo last undone action

POST
/api/redo

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Redo result

application/json
JSON
{
"data": {
"undone_action": "string",
"description": "string",
"tasks_affected": 0
}
}

Samples


Trash


List trashed tasks

GET
/api/trash

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Parameters

Query Parameters

limit
Type
integer
Default
200

Responses

Trashed tasks

application/json
JSON
{
"data": [
{
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
]
}

Samples


Empty trash (permanent delete)

DELETE
/api/trash

Permanently deletes all trashed tasks. Cannot be undone.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Number of tasks permanently deleted

application/json
JSON
{
"data": {
"deleted_count": 0
}
}

Samples


Export


Export user data

GET
/api/export

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Parameters

Query Parameters

format
Type
string
Valid values
"json""csv"
Default
"json"
type

Required for CSV format. Each table is a separate file.

Type
string
Valid values
"tasks""projects"

Responses

Exported data

JSON
{
"data": {
"tasks": [
{
"id": 0,
"user_id": 0,
"project_id": 0,
"title": "string",
"original_title": "string",
"done": true,
"done_at": "string",
"priority": 0,
"due_at": "string",
"rrule": "string",
"recurrence_mode": "string",
"anchor_time": "string",
"anchor_dow": 0,
"anchor_dom": 0,
"original_due_at": "string",
"auto_snooze_minutes": 0,
"deleted_at": "string",
"archived_at": "string",
"labels": [
"string"
],
"notes": "string",
"completion_count": 0,
"snooze_count": 0,
"first_completed_at": "string",
"last_completed_at": "string",
"created_at": "string",
"updated_at": "string",
"is_recurring": true,
"is_snoozed": true
}
],
"projects": [
{
"id": 0,
"name": "string",
"owner_id": 0,
"shared": true,
"sort_order": 0,
"color": "string",
"active_count": 0,
"overdue_count": 0,
"created_at": "string"
}
],
"completions": [
{
"id": 0,
"task_id": 0,
"user_id": 0,
"completed_at": "string",
"due_at_was": "string",
"due_at_next": "string"
}
],
"exported_at": "string"
}
}

Samples


List webhooks

GET
/api/webhooks

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

User's webhooks (secrets excluded)

application/json
JSON
{
"data": {
"webhooks": [
{
"id": 0,
"user_id": 0,
"url": "string",
"events": [
"string"
],
"active": true,
"created_at": "string",
"updated_at": "string"
}
]
}
}

Samples


Create webhook

POST
/api/webhooks

Creates a webhook with an auto-generated HMAC secret.
The secret is returned in this response only — store it securely.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"url": "string",
"events": [
"string"
]
}

Responses

Created webhook with secret (shown once)

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"url": "string",
"secret": "string",
"events": [
"string"
],
"active": true,
"created_at": "string",
"updated_at": "string"
}
}

Samples


Delete webhook

DELETE
/api/webhooks/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Deletion confirmed

application/json
JSON
{
"data": {
"deleted": true
}
}

Samples


Update webhook

PATCH
/api/webhooks/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"url": "string",
"events": [
"string"
],
"active": true
}

Responses

Updated webhook (secret excluded)

application/json
JSON
{
"data": {
"id": 0,
"user_id": 0,
"url": "string",
"events": [
"string"
],
"active": true,
"created_at": "string",
"updated_at": "string"
}
}

Samples


List recent webhook deliveries

GET
/api/webhooks/{id}/deliveries

Returns the last 50 delivery attempts for debugging.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Delivery history

application/json
JSON
{
"data": {
"deliveries": [
{
"id": 0,
"webhook_id": 0,
"event": "string",
"payload": "string",
"status_code": 0,
"error": "string",
"attempt": 0,
"created_at": "string"
}
]
}
}

Samples


List API tokens

GET
/api/tokens

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

API tokens (previews only, not full tokens)

application/json
JSON
{
"data": [
{
"id": 0,
"name": "string",
"token_preview": "string",
"created_at": "string"
}
]
}

Samples


Create API token

POST
/api/tokens

Creates a new API token. The full token is returned in this response only.
Tokens are stored as SHA-256 hashes — the raw token cannot be retrieved later.

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Request Body

application/json
JSON
{
"name": "API"
}

Responses

Created token (shown once)

application/json
JSON
{
"data": {
"id": 0,
"name": "string",
"token": "string",
"created_at": "string"
}
}

Samples


Revoke API token

DELETE
/api/tokens/{id}

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Responses

Token revoked

application/json
JSON
{
"data": {
"deleted": true
}
}

Samples


Stats


Get user statistics

GET
/api/stats

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Parameters

Query Parameters

start

Start date for daily stats range (YYYY-MM-DD)

Type
string
Format
"date"
end

End date for daily stats range (YYYY-MM-DD)

Type
string
Format
"date"

Responses

Stats summary or daily stats for date range

application/json
JSON
{
"data": {
"today": {
"completions": 0,
"tasks_created": 0,
"snoozes": 0
},
"week": {
"completions": 0,
"tasks_created": 0,
"snoozes": 0
},
"month": {
"completions": 0,
"tasks_created": 0,
"snoozes": 0
},
"all_time": {
"completions": 0,
"tasks_created": 0,
"snoozes": 0
}
}
}

Samples


Query completion history

GET
/api/completions

Authorizations

bearerAuth

API token created via POST /api/tokens or the db:create-token CLI command

Type
HTTP (bearer)

Parameters

Query Parameters

task_id
Type
integer
date

Filter by completion date (YYYY-MM-DD)

Type
string
Format
"date"

Responses

Completion records

application/json
JSON
{
"data": [
{
"id": 0,
"task_id": 0,
"user_id": 0,
"completed_at": "string",
"due_at_was": "string",
"due_at_next": "string"
}
]
}

Samples


Powered by VitePress OpenAPI