---
title: "Attach a task to an iteration"
method: POST
path: "/iterations/{id}/tasks"
tags: ["Planning"]
---

# Attach a task to an iteration

`POST /iterations/{id}/tasks`

## Request

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

## Request body

- object
  - `taskId` string, required

## Response `201`

The resource.

- object
  - `data` DurableObject: Stable public shape for newly exposed durable objects. Internal workspace ids, deletion markers, sync data, storage credentials, and secrets are omitted.
    - `id` string
    - `displayId` union
      - string
      - number
    - `name` string
    - `title` string
    - `status` string
    - `kind` 'requirement' | 'user_story': Requirement subtype. Legacy rows are returned as requirement.
    - `personaId` string, nullable
    - `storyActor` string, nullable
    - `storyGoal` string, nullable
    - `storyBenefit` string, nullable
    - `acceptanceCriteria` string[]
    - `storySentence` string, nullable
    - `createdAt` integer, nullable: Epoch ms.
    - `updatedAt` integer, nullable: Epoch ms.

## Other responses

- `400`: Malformed request or invalid field (`validation_error`).
- `403`: The key is read-only and may not write (`forbidden`).

---

[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)
