/api/v1/task
Use this endpoint to store & retrieve tasks. A task is a configuration to run a task module with pre-configured parameters. The tasks are executed in the background. Tasks can be scheduled to run periodically.
Tasks are user specific. Like exports, tasks are run under as the user who created the task. When listing tasks, only the creating user can see his tasks.
Every task operation requires the system right system.task (a system.root user is also accepted). An unauthenticated request returns 401 with code UserRequired; an authenticated user lacking system.task (and not system.root) returns 403 with code SystemRightRequired. The id-addressed operations GET /task/{taskId}/log, POST /task/{taskId}/cancel and DELETE /task/{taskId} load the task by id and then reject a caller who is neither the task's owner nor a system.root user with 403 code InsufficientRights. The list and GET /task/{taskId} instead filter by the session user, so another user's tasks are simply not returned (an unknown id yields 404).
GET /task
Access token in the Authorization header:
Authorization: Bearer <token>.
Request the given offset of the log.
Request using the given limit. Default is 100.
Retrieve a list of tasks
The limit of the request.
The offset of the request.
The total count of the tasks of the session user.
No authenticated user. The request must carry a valid access token.
The authenticated user lacks the system.task system right (and is
not system.root). Raised with code SystemRightRequired
(parameters.rights lists the rights that would have satisfied the
check).
{
"limit": 1,
"offset": 1,
"count": 1,
"objects": [
{
"task": {
"_id": 1,
"_version": 2,
"task_module": "sleep",
"description": "henk is super",
"task_params": {
"runtime": 5
},
"task_timeout_sec": 100,
"next_run_at": "2026-05-30T12:00:10Z",
"status": "new"
},
"_user": {
"_generated_displayname": "root"
}
}
]
}POST /task
Create a new task.
Access token in the Authorization header:
Authorization: Bearer <token>.
Some task modules answer an unconfirmed save with 202 and a
confirmation dialog instead of creating the task (currently
consolidate_objects: the preview reports how many records
reference the sources and how many of those the saving user is
allowed to re-link). Repeat the request with confirm=yes (the
confirm key/value of the dialog's button) to create the task.
UTC time of when the task was created.
UTC time of when the task was updated.
Created a new task.
No content
The task module asks for a confirmation instead of creating the
task: tasks carries title, localized message, machine-readable
data and buttons; the button's name/value pair is repeated
as a query parameter (confirm=yes) to confirm.
consolidate_objects also answers a target-less unconfirmed save
with this preview (data: references, relink, denied,
capped) — such a probe can never create a task, a confirmed
save requires a valid target.
The request could not be processed. The code field of the response
identifies the specific validation failure.
No authenticated user. The request must carry a valid access token.
The authenticated user lacks the system.task system right (and is
not system.root). Raised with code SystemRightRequired
(parameters.rights lists the rights that would have satisfied the
check).
No content
PUT /task
Create a new task.
Access token in the Authorization header:
Authorization: Bearer <token>.
Some task modules answer an unconfirmed save with 202 and a
confirmation dialog instead of creating the task (currently
consolidate_objects: the preview reports how many records
reference the sources and how many of those the saving user is
allowed to re-link). Repeat the request with confirm=yes (the
confirm key/value of the dialog's button) to create the task.
UTC time of when the task was created.
UTC time of when the task was updated.
Created a new task.
No content
The task module asks for a confirmation instead of creating the
task: tasks carries title, localized message, machine-readable
data and buttons; the button's name/value pair is repeated
as a query parameter (confirm=yes) to confirm.
consolidate_objects also answers a target-less unconfirmed save
with this preview (data: references, relink, denied,
capped) — such a probe can never create a task, a confirmed
save requires a valid target.
The request could not be processed. The code field of the response
identifies the specific validation failure.
No authenticated user. The request must carry a valid access token.
The authenticated user lacks the system.task system right (and is
not system.root). Raised with code SystemRightRequired
(parameters.rights lists the rights that would have satisfied the
check).
No content
GET /task/{taskId}/log
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the task.
Request the given offset of the log.
Request using the given limit. Default is 100.
Task runners can write log entries. This endpoint can be used to retrieve them.
Index of the log entry, starts at 0.
UTC time of the entry.
Severity of the log entry.
Message of the log entry.
The current status in percent, can be null. If set (per task module), the task runner updates the status_percent of the task to the latest data.
No authenticated user. The request must carry a valid access token.
The authenticated user is neither the task's creator nor a
system.root user. Tasks are user-specific; only the user who
created a task (or a system.root user) can access it. A user
without the system.task system right also receives a 403.
No task with this id exists. The id was not loadable. Raised with
code ObjectNotFound (parameters.object carries a task <id>
token, e.g. task 7).
[
{
"idx": 1,
"timestamp": "text",
"level": "debug",
"msg": "text",
"status_percent": 1
}
]POST /task/{taskId}/cancel
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the task.
Cancellation was requested: the task's run_canceled_at timestamp
is set (and its _version is incremented). The task runner watches
for this flag and stops the running task as soon as possible; the
runner — not this request — is what eventually moves the task to
status canceled.
The request could not be processed. The code field of the response
identifies the specific validation failure.
No authenticated user. The request must carry a valid access token.
The authenticated user is neither the task's creator nor a
system.root user. Tasks are user-specific; only the user who
created a task (or a system.root user) can access it. A user
without the system.task system right also receives a 403.
No task with this id exists. The id was not loadable. Raised with
code ObjectNotFound (parameters.object carries a task <id>
token, e.g. task 7).
{
"status": {
"acknowledged": "ok"
}
}GET /task/{taskId}
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the task.
The task.
UTC time of when the task was created.
UTC time of when the task was updated.
No authenticated user. The request must carry a valid access token.
The authenticated user lacks the system.task system right (and is
not system.root). Raised with code SystemRightRequired
(parameters.rights lists the rights that would have satisfied the
check).
No task with this id exists for the authenticated user. The
GET /task/{taskId} operation raises code ResourceNotFound
(parameters.resource carries a task <id> token).
{
"task": {
"_id": 1,
"_version": 2,
"task_module": "sleep",
"description": "henk is super",
"task_params": {
"runtime": 5
},
"task_timeout_sec": 100,
"next_run_at": "2026-05-30T12:00:10Z",
"status": "new"
},
"_user": {
"_generated_displayname": "root"
}
}PATCH /task/{taskId}
Update a task. A task can only be updated if it is not in status
running. The body must carry _version one higher than the stored
version; a mismatch is rejected with code VersionMismatch. The task's
owner (_user) is preserved and cannot be reassigned; ownership is not
re-checked on update (any holder of system.task may patch any task).
Updating a task whose id does not exist is reported as a 400, not a
404.
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the task.
The patched task.
UTC time of when the task was created.
UTC time of when the task was updated.
The request could not be processed. The code field of the response
identifies the specific validation failure.
No authenticated user. The request must carry a valid access token.
The authenticated user lacks the system.task system right (and is
not system.root). Raised with code SystemRightRequired
(parameters.rights lists the rights that would have satisfied the
check).
{
"task": {
"_id": 1,
"_version": 2,
"task_module": "sleep",
"description": "henk is super",
"task_params": {
"runtime": 5
},
"task_timeout_sec": 100,
"next_run_at": "2026-05-30T12:00:10Z",
"status": "new"
},
"_user": {
"_generated_displayname": "root"
}
}DELETE /task/{taskId}
Delete a task. A task in status running cannot be deleted (cancel it
first); attempting to do so is rejected with a 400.
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the task.
The task was successfully deleted.
The request could not be processed. The code field of the response
identifies the specific validation failure.
No authenticated user. The request must carry a valid access token.
The authenticated user is neither the task's creator nor a
system.root user. Tasks are user-specific; only the user who
created a task (or a system.root user) can access it. A user
without the system.task system right also receives a 403.
No task with this id exists. The id was not loadable. Raised with
code ObjectNotFound (parameters.object carries a task <id>
token, e.g. task 7).
{
"status": {
"acknowledged": "ok"
}
}GET /task/modules
Access token in the Authorization header:
Authorization: Bearer <token>.
Retrieve a list of available task modules.
No authenticated user. The request must carry a valid access token.
The authenticated user lacks the system.task system right (and is
not system.root). Raised with code SystemRightRequired
(parameters.rights lists the rights that would have satisfied the
check).
{
"modules": [
{
"name": "text",
"displayname": {
"de-DE": "Deutscher text",
"en-US": "English text"
},
"description": {
"de-DE": "Deutscher text",
"en-US": "English text"
},
"debug": true,
"params": [
{
"name": "text",
"group": "text",
"parameters": {
"position": 1,
"type": "text",
"name": "text",
"default": true
},
"require_system_right": "text",
"unauthenticated_visible": true,
"unavailable": true
}
]
}
]
}Last updated