# Read task source

```http
GET /projects/{project_reference}/tasks/{task_id}/source
```

Read the editable source behind one task before changing it; returns the task source document with its source text, edit mode and the reasons it can only be edited as source. Requires project.runs.read.

## Parameters

| Name                    | In    | Required | Description                                                                                  |
| ----------------------- | ----- | -------- | -------------------------------------------------------------------------------------------- |
| `project_reference`     | path  | Yes      | Project slug, UUID, or domain that identifies the project.                                   |
| `task_id`               | path  | Yes      |                                                                                              |
| `source_target_kind`    | query |          | Source to read: project or preview\_branch. Defaults to runtime\_target\_kind, then project. |
| `target_branch_id`      | query |          | Preview branch to use when the target kind is preview\_branch.                               |
| `runtime_target_kind`   | query |          | Used as the source target kind when source\_target\_kind is omitted.                         |
| `target_environment_id` | query |          | Not supported for source reads; a non-null value is rejected.                                |

## Responses

| Status | Description   |
| ------ | ------------- |
| 200    | Task document |
| 400    | Bad request   |
| 401    | Unauthorized  |
| 403    | Forbidden     |
| 404    | Not found     |
