# Tasks

## List

`projects.tasks.list(strproject_id)  -> TaskListResponse`

**get** `/projects/{projectId}/tasks`

List the tasks of the project's task source for the current user, to send one in the X-Scenario-Task-Id header. Returns 502 when the task source fails. Enterprise only.

### Parameters

- `project_id: str`

### Returns

- `class TaskListResponse: …`

  - `tasks: List[Task]`

    The tasks of the task source, at most 1,000. Entries without a valid id
    are skipped, and a repeated id keeps its first entry.

    - `id: str`

      The task id, to send in the X-Scenario-Task-Id header

    - `name: Optional[str]`

      The task name

    - `status: Optional[str]`

      The task status

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
tasks = client.projects.tasks.list(
    "projectId",
)
print(tasks.tasks)
```

#### Response

```json
{
  "tasks": [
    {
      "id": "id",
      "name": "name",
      "status": "status"
    }
  ]
}
```

## Domain Types

### Task List Response

- `class TaskListResponse: …`

  - `tasks: List[Task]`

    The tasks of the task source, at most 1,000. Entries without a valid id
    are skipped, and a repeated id keeps its first entry.

    - `id: str`

      The task id, to send in the X-Scenario-Task-Id header

    - `name: Optional[str]`

      The task name

    - `status: Optional[str]`

      The task status
