---
title: "Assign a task to an Epic phase"
method: PUT
path: "/tasks/{id}/phase"
tags: ["Phases"]
---

# Assign a task to an Epic phase

`PUT /tasks/{id}/phase`

## Request

- Base URL: `https://app.pencil.ink/api/v1`
- URL: `https://app.pencil.ink/api/v1/tasks/{id}/phase`
- Auth: HTTP bearer

Set `phaseId` to null to detach it. The phase must belong to the task's Epic. Requires a `write` key.

## Request body

- object
  - `phaseId` string, nullable, required

## Response `200`

The resource.

- object
  - `data` TaskPhaseAssignment
    - `taskId` string, required
    - `phaseId` string, nullable, required

## Other responses

- `400`: Malformed request or invalid field (`validation_error`).
- `403`: The key is read-only and may not write (`forbidden`).
- `404`: Resource not found in this org (`not_found`).
- `409`: A strict phase gate prevents the requested start (`phase_gate_locked`).

---

[API](https://skmtc.dev/pencil/apis/pencil-public-api.md) · [All operations](https://skmtc.dev/pencil/apis/pencil-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pencil/apis/pencil-public-api/revisions/2b842698b76d?raw)
