---
title: "List database tasks"
method: GET
path: "/v1/databases/{database_id}/tasks"
tags: ["Database"]
---

# List database tasks

`GET /v1/databases/{database_id}/tasks`

Lists all tasks for a database.

## Path parameters

- `database_id` string, required

## Query parameters

- `after_task_id` string, uuid
- `limit` integer
- `sort_order` 'asc' | 'ascend' | 'ascending' | 'desc' | 'descend' | 'descending'

## Response `200`

OK response.

- ListDatabaseTasksResponse
  - `tasks` Task[], required — The tasks for the given database.
    - `completed_at` string, date-time — The time when the task was completed.
    - `created_at` string, date-time, required — The time when the task was created.
    - `database_id` string — The database ID of the task.
    - `entity_id` string, required — The entity ID (database_id or host_id) that this task belongs to.
    - `error` string — The error message if the task failed.
    - `host_id` string — The ID of the host that the task is running on.
    - `instance_id` string — The ID of the instance that the task is operating on.
    - `node_name` string — The name of the node that the task is operating on.
    - `parent_id` string, uuid — The parent task ID of the task.
    - `scope` 'database' | 'host', required — The scope of the task (database or host).
    - `status` 'pending' | 'running' | 'completed' | 'canceled' | 'canceling' | 'failed' | 'unknown', required — The status of the task.
    - `task_id` string, uuid, required — The unique ID of the task.
    - `type` string, required — The type of the task.

## Other responses

- `400` — Bad Request response.
- `404` — Not Found response.
- `409` — Conflict response.
- `500` — Internal Server Error response.
- `default` — Unexpected error response

---

[API](https://skmtc.net/pgedge/apis/pgedge-control-plane-v1-api.md) · [All operations](https://skmtc.net/pgedge/apis/pgedge-control-plane-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pgedge/pgedge-control-plane-v1-api/versions/29a68546f34c/schema)
