> For the complete documentation index, see [llms.txt](https://docs.fylr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fylr.io/for-developers/api/endpoints/api-task.md).

# /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`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /task`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `PUT /task`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task" method="put" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /task/{taskId}/log`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task/{taskId}/log" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /task/{taskId}/cancel`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task/{taskId}/cancel" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /task/{taskId}`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task/{taskId}" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `PATCH /task/{taskId}`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task/{taskId}" method="patch" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `DELETE /task/{taskId}`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task/{taskId}" method="delete" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /task/modules`

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/task/modules" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}
