> ## Documentation Index
> Fetch the complete documentation index at: https://docs.youka.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tasks

> Poll async project, lyrics, stem, and export work

Tasks are the execution records behind async work. Project creation, lyric sync,
stem separation, and cloud exports all return task IDs.

## Endpoints

| Method | Path                          | Purpose                          |
| ------ | ----------------------------- | -------------------------------- |
| `GET`  | `/tasks/{taskId}`             | Fetch one task by ID.            |
| `GET`  | `/projects/{projectId}/tasks` | List task history for a project. |

Full request and response schemas are in **API reference**.

## Poll one task

```bash theme={null}
curl https://api.youka.io/api/v1/tasks/tsk_abc123 \
  -H "Authorization: Bearer yk_..."
```

Poll until `status` is terminal:

| Status      | Meaning                              |
| ----------- | ------------------------------------ |
| `completed` | The task finished successfully.      |
| `finalized` | The task finished and was finalized. |
| `failed`    | The task failed.                     |
| `cancelled` | The task was cancelled.              |
| `timed-out` | The task timed out.                  |

For successful project creation, lyric sync, and stem separation tasks, re-fetch
the project after the task reaches a terminal state. For successful export
tasks, fetch the export to get the signed download URL.

## List project tasks

```bash theme={null}
curl https://api.youka.io/api/v1/projects/prj_abc123/tasks \
  -H "Authorization: Bearer yk_..."
```

Use the project task list for diagnostics, progress timelines, and low-level
automation that needs to correlate task IDs with project actions.

## What's next

* [Async jobs](/en/api/async-jobs) - recommended polling pattern
* [Projects](/en/api/projects) - project creation and task history
* [Exports](/en/api/exports) - cloud export tasks
* [SDK tasks](/en/sdk/tasks) - task polling helpers in TypeScript
