# PATCH /api/v2/sprints/{sprint}

Update a sprint

- MCP id: sprints.update
- Scope: api:write:project_management
- Permission: project_management::manage_sprints
- Rate cost: 1 unit, write bucket. A write costs the same whatever `view` you ask for.
- Cache-Control: private, no-store

Partially updates a sprint's name, description or planned dates: absent keys are untouched, an empty body is rejected.

`project_id` is not accepted: a sprint cannot be moved between projects, because its work items and its `order` position are both scoped to the project it was created on. Neither are `order`, `is_active`, `started_at` or `completed_at`: the first is read-only and the other three belong to the start and complete actions. ⚠ `end_date` is checked against `start_date` only when both are sent, so a PATCH carrying an `end_date` earlier than the stored `start_date` succeeds; send the pair together if you need the ordering enforced. Send `If-Match` with the `ETag` from your last read to detect a concurrent edit, which answers `412`. Treat it as best-effort only: this resource carries no concurrency token, and `updated_at` is second-precision, so two writes inside the same second are indistinguishable.

## Parameters
- sprint (integer, path): The Sprint's numeric id.
- view (string, optional): Which field set to render.
- X-Request-Id (header, optional): A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
- If-Match (header, optional): The ETag a write is conditional on. A stale validator is 412 precondition-failed.

## Request body
- name (string ≤ 255, optional): Sprint name as shown in plnnrly, e.g. `Sprint 14`.
- description (string or null, optional): Free-text sprint goal. Plain text, not markup.
- start_date (date (YYYY-MM-DD) or null, optional): Planned first day of the sprint. Independent of `started_at`: planning a date does not start the sprint.
- end_date (date (YYYY-MM-DD) or null, optional): Planned last day of the sprint. Independent of `completed_at`. Must be on or after start_date.

Unknown keys are refused with `422` validation-failed, naming the key.

## Response 200
- id (integer, required): Unique identifier.
- project_id (integer, required): The project this sprint belongs to. A sprint cannot be moved between projects, so this is accepted on create only.
- name (string ≤ 255, required): Sprint name as shown in plnnrly, e.g. `Sprint 14`.
- description (string or null, required, multiline): Free-text sprint goal. Plain text, not markup.
- start_date (date (YYYY-MM-DD) or null, required): Planned first day of the sprint. Independent of `started_at`: planning a date does not start the sprint.
- end_date (date (YYYY-MM-DD) or null, required): Planned last day of the sprint. Independent of `completed_at`.
- started_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required, server-assigned): When the sprint was actually started. Written only by POST `sprints/{sprint}/actions/start`; `null` on an upcoming sprint.
- completed_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required, server-assigned): When the sprint was actually completed. Written only by POST `sprints/{sprint}/actions/complete`; `null` until then. Non-`null` is what makes the derived state `completed`.
- is_active (boolean, required, server-assigned): Whether this is the project's running sprint. Set by actions/start and cleared by actions/complete, never by PATCH. At most one sprint per project is active at a time.
- order (integer, required, server-assigned): Display position within the project. Assigned on create as the last position in that project's sprint order, changed only by reordering in plnnrly, and not writable.
- work_items_count (integer ≥ 0, required): Number of work items currently on this sprint, resolved and unresolved alike.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- project (Ref or ProjectSummary, required): The project this sprint belongs to. Expanding it additionally requires the projects prefix's read grant and a token scope covering it.
- links (SprintLinks, required)
  - self (url, required): The canonical URI of this record.
  - work_items (url, required): Work items on this sprint.

## Errors
- 403 forbidden-by-policy | insufficient-permission | insufficient-token-scope: Forbidden.
- 412 precondition-failed: Precondition failed.
- 415 unsupported-media-type: Unsupported media type.
- 422 unprocessable-relationship | validation-failed: Unprocessable content.
- 400 idempotency-key-required | invalid-cursor | invalid-query-parameter | malformed-request | unsupported-parameter: Bad request.
- 401 token-expired | unauthenticated: Unauthenticated.
- 404 endpoint-not-found | resource-not-found: Not found.
- 406 not-acceptable: Not acceptable.
- 429 rate-limit-exceeded: Too many requests.
- 500 internal-error: Server error.
- 503 tenant-unavailable: Service unavailable.

## Example
```bash
curl -X PATCH \
  'https://<your-url>/api/v2/sprints/1' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'If-Match: *' \
  -d '{
    "name": "Sprint 14: invoicing",
    "end_date": "2026-03-20"
  }'
```
