Skip to main content
The Tasks resource provides methods to retrieve and list tasks with filtering capabilities.

Methods

list

List all tasks with optional filtering by project or status.
client.tasks.list(
    project=None,
    status=None,
    limit=None,
    cursor=None
) -> CursorPage[Task]
project
str | None
Filter tasks by project UID
status
str | None
Filter tasks by status (e.g., “pending”, “in_progress”, “completed”)
limit
int | None
Maximum number of tasks to return per page
cursor
str | None
Pagination cursor for fetching the next page of results
CursorPage[Task]
CursorPage[Task]
A paginated list of tasks. Use .items to access the task list, .next_cursor for pagination, and .has_more to check if more results exist.

Example

from avala import Avala

client = Avala(api_key="your-api-key")

# List all tasks
page = client.tasks.list()
for task in page.items:
    print(task.name, task.status)

# Filter by project
page = client.tasks.list(project="project-uid-123")

# Filter by status
page = client.tasks.list(status="pending", limit=50)

# Combine filters
page = client.tasks.list(
    project="project-uid-123",
    status="in_progress"
)

get

Retrieve a specific task by its UID.
client.tasks.get(uid: str) -> Task
uid
str
required
The unique identifier of the task
Task
Task
The task object containing uid, type, name, status, project reference, and timestamps.

Example

task = client.tasks.get("task-uid-123")
print(f"Task: {task.name}")
print(f"Type: {task.type}")
print(f"Status: {task.status}")
print(f"Project: {task.project}")

Async Usage

All methods are available in async form via client.async_tasks:
import asyncio
from avala import AsyncAvala

async def main():
    client = AsyncAvala(api_key="your-api-key")
    
    # List tasks
    page = await client.tasks.list(project="project-uid-123")
    for task in page.items:
        print(task.name)
    
    # Get specific task
    task = await client.tasks.get("task-uid-123")
    print(task.status)

asyncio.run(main())

Response Types

Task

uid
str
Unique identifier for the task
type
str | None
Type of task (e.g., “annotation”, “review”, “qa”)
name
str | None
Human-readable name of the task
status
str | None
Current status of the task (e.g., “pending”, “in_progress”, “completed”, “failed”)
project
str | None
UID of the project this task belongs to
created_at
datetime | None
Timestamp when the task was created
updated_at
datetime | None
Timestamp when the task was last updated

CursorPage

items
list[T]
List of items in the current page
next_cursor
str | None
Cursor for fetching the next page (None if no more pages)
previous_cursor
str | None
Cursor for fetching the previous page
has_more
bool
Property indicating if more results are available

Build docs developers (and LLMs) love