## List Tasks

`tasks.list(TaskListParams**kwargs)  -> TaskListResponse`

**get** `/tasks`

List tasks. Returns a lean summary per task and omits `params`; fetch GET /tasks/{task_id} for the full record including `params`.

### Parameters

- `agent_id: Optional[str]`

- `agent_name: Optional[str]`

- `limit: Optional[int]`

- `order_by: Optional[str]`

- `order_direction: Optional[str]`

- `page_number: Optional[int]`

- `relationships: Optional[List[Literal["agents"]]]`

  - `"agents"`

- `status: Optional[Literal["CANCELED", "COMPLETED", "FAILED", 5 more]]`

  Filter tasks by status (e.g. RUNNING, COMPLETED).

  - `"CANCELED"`

  - `"COMPLETED"`

  - `"FAILED"`

  - `"RUNNING"`

  - `"INTERRUPTED"`

  - `"TERMINATED"`

  - `"TIMED_OUT"`

  - `"DELETED"`

- `task_metadata: Optional[str]`

  JSON-encoded object used to filter tasks via JSONB containment. Example: {"created_by_user_id": "abc-123"}.

### Returns

- `List[TaskListResponseItem]`

  - `id: str`

  - `agents: Optional[List[Agent]]`

    - `id: str`

      The unique identifier of the agent.

    - `acp_type: AcpType`

      The type of the ACP Server (Either sync or async)

      - `"sync"`

      - `"async"`

      - `"agentic"`

    - `created_at: datetime`

      The timestamp when the agent was created

    - `description: str`

      The description of the action.

    - `name: str`

      The unique name of the agent.

    - `updated_at: datetime`

      The timestamp when the agent was last updated

    - `agent_input_type: Optional[Literal["text", "json"]]`

      The type of input the agent expects.

      - `"text"`

      - `"json"`

    - `production_deployment_id: Optional[str]`

      ID of the current production deployment.

    - `registered_at: Optional[datetime]`

      The timestamp when the agent was last registered

    - `registration_metadata: Optional[Dict[str, object]]`

      The metadata for the agent's registration.

    - `status: Optional[Literal["Ready", "Failed", "Unknown", 3 more]]`

      The status of the action, indicating if it's building, ready, failed, etc.

      - `"Ready"`

      - `"Failed"`

      - `"Unknown"`

      - `"Deleted"`

      - `"Unhealthy"`

      - `"BuildOnly"`

    - `status_reason: Optional[str]`

      The reason for the status of the action.

  - `cleaned_at: Optional[datetime]`

  - `created_at: Optional[datetime]`

  - `name: Optional[str]`

  - `status: Optional[Literal["CANCELED", "COMPLETED", "FAILED", 5 more]]`

    - `"CANCELED"`

    - `"COMPLETED"`

    - `"FAILED"`

    - `"RUNNING"`

    - `"INTERRUPTED"`

    - `"TERMINATED"`

    - `"TIMED_OUT"`

    - `"DELETED"`

  - `status_reason: Optional[str]`

  - `task_metadata: Optional[Dict[str, object]]`

  - `updated_at: Optional[datetime]`

### Example

```python
import os
from agentex import Agentex

client = Agentex(
    api_key=os.environ.get("AGENTEX_SDK_API_KEY"),  # This is the default and can be omitted
)
tasks = client.tasks.list()
print(tasks)
```

#### Response

```json
[
  {
    "id": "id",
    "agents": [
      {
        "id": "id",
        "acp_type": "sync",
        "created_at": "2019-12-27T18:11:19.117Z",
        "description": "description",
        "name": "name",
        "updated_at": "2019-12-27T18:11:19.117Z",
        "agent_input_type": "text",
        "production_deployment_id": "production_deployment_id",
        "registered_at": "2019-12-27T18:11:19.117Z",
        "registration_metadata": {
          "foo": "bar"
        },
        "status": "Ready",
        "status_reason": "status_reason"
      }
    ],
    "cleaned_at": "2019-12-27T18:11:19.117Z",
    "created_at": "2019-12-27T18:11:19.117Z",
    "name": "name",
    "status": "CANCELED",
    "status_reason": "status_reason",
    "task_metadata": {
      "foo": "bar"
    },
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
```
