# Update task

```http
PATCH /projects/{project_reference}/tasks/{task_id}
```

Change the name, description or schedulable flag of a structured task, where an omitted description or flag keeps its value; returns the updated task source document. Requires project.runs.write.

## 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 write: project or preview\_branch. Defaults to project.     |
| `target_branch_id`   | query |          | Preview branch to write when source\_target\_kind is preview\_branch. |

## Request body

| Field         | Type        | Required | Description                                                        |
| ------------- | ----------- | -------- | ------------------------------------------------------------------ |
| `name`        | string      | Yes      | Updated human-readable task name.                                  |
| `description` | string,null |          | Updated task description. Omit it to keep the current description. |
| `schedulable` | boolean     |          | Updated schedulable flag. Omit it to keep the current value.       |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 200    | Updated task document                                                                                       |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 409    | Conflict                                                                                                    |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
