# Sprints

A scrum board's sprints: plan, change, start and complete them, and move tasks into them.

## List a board's sprints

`GET /orgs/{org}/boards/{board}/sprints`

Scope: `boards:read`

The board's sprints: open ones (active, then future in their order) by default; closed (newest first) or all with state. With what the token's person may do: can_manage (create, change, start, complete) and whether several sprints may be active at once.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `board` (string (uuid), required): The board's id.

### Query parameters

- `state` (string): open (active and future, the default), closed or all. [one of: open, closed, all; default open]

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/boards/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/sprints" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
      "board": {
        "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
        "name": "WEB board"
      },
      "name": "WEB Sprint 14",
      "goal": "Checkout works on every browser.",
      "state": "active",
      "position": "a3",
      "duration": "2w",
      "start": "2026-12-01T09:00:00.000Z",
      "end": "2026-12-15T09:00:00.000Z",
      "planned_start": "2026-12-01T09:00:00.000Z",
      "planned_end": "2026-12-15T09:00:00.000Z",
      "auto_start": false,
      "auto_complete": false,
      "started_at": "2026-12-01T09:12:00.000Z",
      "completed_at": null,
      "tasks": 9
    }
  ],
  "next_cursor": null,
  "can_manage": true,
  "parallel": false
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Plan a sprint

`POST /orgs/{org}/boards/{board}/sprints`

Scope: `boards:write`

Adds a future sprint at the end of the board's sprints, as the backlog's Create sprint does: without a name, the next by the board's naming (WEB Sprint 8); without dates, after the last sprint with its length. Needs Manage sprints.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `board` (string (uuid), required): The board's id.

### Headers

- `Idempotency-Key` (string): A unique key (such as a uuid): the same key and body within 24 hours gets the first answer again without a second create; another body gets 422. [1 to 200 characters]

### Body

- `name` (string): 1 to 255 characters. [at most 1020 characters]
- `goal` (string): At most 1000 characters. [at most 4000 characters]
- `duration` (string): 1w, 2w, 3w or 4w (the end follows the start), or custom. [one of: 1w, 2w, 3w, 4w, custom]
- `start` (string (date-time) or null)
- `end` (string (date-time) or null): With duration custom; else worked out.
- `auto_start` (boolean): A future sprint starts by itself at its start.
- `auto_complete` (boolean)

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/boards/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/sprints" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "goal": "string",
  "duration": "1w",
  "start": "2026-12-01T09:30:00Z",
  "end": "2026-12-01T09:30:00Z",
  "auto_start": true,
  "auto_complete": true
}'
```

### Answer: 201

```json
{
  "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
  "board": {
    "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
    "name": "WEB board"
  },
  "name": "WEB Sprint 14",
  "goal": "Checkout works on every browser.",
  "state": "future",
  "position": "a3",
  "duration": "2w",
  "start": "2026-12-01T09:00:00.000Z",
  "end": "2026-12-15T09:00:00.000Z",
  "planned_start": null,
  "planned_end": null,
  "auto_start": false,
  "auto_complete": false,
  "started_at": null,
  "completed_at": null,
  "tasks": 9
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 422 `idempotency_key_reused`: idempotency_key_reused: The same Idempotency-Key was sent within 24 hours with a different body.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Get a sprint

`GET /orgs/{org}/sprints/{sprint}`

Scope: `boards:read`

One sprint, with the number of its tasks the token's person can open.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `sprint` (string (uuid), required): The sprint's id.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/sprints/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
  "board": {
    "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
    "name": "WEB board"
  },
  "name": "WEB Sprint 14",
  "goal": "Checkout works on every browser.",
  "state": "active",
  "position": "a3",
  "duration": "2w",
  "start": "2026-12-01T09:00:00.000Z",
  "end": "2026-12-15T09:00:00.000Z",
  "planned_start": "2026-12-01T09:00:00.000Z",
  "planned_end": "2026-12-15T09:00:00.000Z",
  "auto_start": false,
  "auto_complete": false,
  "started_at": "2026-12-01T09:12:00.000Z",
  "completed_at": null,
  "tasks": 9
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Change a sprint

`PATCH /orgs/{org}/sprints/{sprint}`

Scope: `boards:write`

Changes the fields given, as the sprint's Edit dialog does: an active sprint keeps a start and an end; a fixed duration works the end out from the start; a completed sprint can't change (409). Needs Manage sprints.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `sprint` (string (uuid), required): The sprint's id.

### Body

- `name` (string): 1 to 255 characters. [at most 1020 characters]
- `goal` (string): At most 1000 characters. [at most 4000 characters]
- `duration` (string): 1w, 2w, 3w or 4w (the end follows the start), or custom. [one of: 1w, 2w, 3w, 4w, custom]
- `start` (string (date-time) or null)
- `end` (string (date-time) or null): With duration custom; else worked out.
- `auto_start` (boolean): A future sprint starts by itself at its start.
- `auto_complete` (boolean)

### Request

```sh
curl -X PATCH "https://projqo.example/api/v1/orgs/{org}/sprints/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "goal": "string",
  "duration": "1w",
  "start": "2026-12-01T09:30:00Z",
  "end": "2026-12-01T09:30:00Z",
  "auto_start": true,
  "auto_complete": true
}'
```

### Answer: 200

```json
{
  "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
  "board": {
    "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
    "name": "WEB board"
  },
  "name": "WEB Sprint 14",
  "goal": "Checkout works on every browser.",
  "state": "active",
  "position": "a3",
  "duration": "2w",
  "start": "2026-12-01T09:00:00.000Z",
  "end": "2026-12-15T09:00:00.000Z",
  "planned_start": "2026-12-01T09:00:00.000Z",
  "planned_end": "2026-12-15T09:00:00.000Z",
  "auto_start": false,
  "auto_complete": false,
  "started_at": "2026-12-01T09:12:00.000Z",
  "completed_at": null,
  "tasks": 9
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `conflict`: conflict: The thing changed since it was read, or the change clashes with its state.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Start a sprint

`POST /orgs/{org}/sprints/{sprint}/start`

Scope: `boards:write`

Starts a future sprint, as the backlog's Start sprint dialog does: with its start (and its end, or a duration), optionally a new name and goal. A sprint needs tasks; an Organisation project's board runs one sprint at a time unless parallel sprints are on (409 conflict with the app's words). Needs Manage sprints.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `sprint` (string (uuid), required): The sprint's id.

### Body

- `start` (string (date-time), required): When it starts (with Z or an offset).
- `end` (string (date-time) or null): With duration custom.
- `duration` (string): 1w, 2w, 3w or 4w (the end follows the start), or custom. [one of: 1w, 2w, 3w, 4w, custom]
- `name` (string): 1 to 255 characters. [at most 1020 characters]
- `goal` (string): At most 1000 characters. [at most 4000 characters]
- `auto_complete` (boolean)

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/sprints/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/start" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "start": "2026-12-01T09:30:00Z",
  "end": "2026-12-01T09:30:00Z",
  "duration": "1w",
  "name": "string",
  "goal": "string",
  "auto_complete": true
}'
```

### Answer: 200

```json
{
  "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
  "board": {
    "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
    "name": "WEB board"
  },
  "name": "WEB Sprint 14",
  "goal": "Checkout works on every browser.",
  "state": "active",
  "position": "a3",
  "duration": "2w",
  "start": "2026-12-01T09:00:00.000Z",
  "end": "2026-12-15T09:00:00.000Z",
  "planned_start": "2026-12-01T09:00:00.000Z",
  "planned_end": "2026-12-15T09:00:00.000Z",
  "auto_start": false,
  "auto_complete": false,
  "started_at": "2026-12-01T09:12:00.000Z",
  "completed_at": null,
  "tasks": 9
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `conflict`: conflict: The thing changed since it was read, or the change clashes with its state.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## What completing a sprint would do

`GET /orgs/{org}/sprints/{sprint}/completion`

Scope: `boards:read`

As the Complete sprint dialog shows it: how many of its tasks are completed (in the board's last column) and open, as the token's person can see them, the future sprints the open tasks can go to, and where they go by default.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `sprint` (string (uuid), required): The sprint's id.

### Request

```sh
curl -X GET "https://projqo.example/api/v1/orgs/{org}/sprints/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/completion" \
  -H "Authorization: Bearer $PROJQO_TOKEN"
```

### Answer: 200

```json
{
  "completed": 7,
  "open": 2,
  "destinations": [
    {
      "id": "6a7b8c9d-0e1f-4a2b-9c3d-5e6f7a8b9c0d",
      "name": "WEB Sprint 15"
    }
  ],
  "default": {
    "to": "sprint",
    "sprint": "6a7b8c9d-0e1f-4a2b-9c3d-5e6f7a8b9c0d"
  }
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation.
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Complete a sprint

`POST /orgs/{org}/sprints/{sprint}/complete`

Scope: `boards:write`

Completes an active sprint, as the Complete sprint dialog does. Its open tasks (every one, also those the token's person can't open) go to a future sprint of the board (to sprint, with sprint), a new sprint (to new) or the backlog (to backlog, at its end). Completed tasks are those in the board's last column. Needs Manage sprints.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `sprint` (string (uuid), required): The sprint's id.

### Body

- `to` (string, required): Where the open tasks go: sprint, new or backlog. [one of: sprint, new, backlog]
- `sprint` (string (uuid)): With to sprint: a future sprint of the same board.

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/sprints/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/complete" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "sprint",
  "sprint": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10"
}'
```

### Answer: 200

```json
{
  "sprint": {
    "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
    "board": {
      "id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
      "name": "WEB board"
    },
    "name": "WEB Sprint 14",
    "goal": "Checkout works on every browser.",
    "state": "closed",
    "position": "a3",
    "duration": "2w",
    "start": "2026-12-01T09:00:00.000Z",
    "end": "2026-12-15T09:00:00.000Z",
    "planned_start": "2026-12-01T09:00:00.000Z",
    "planned_end": "2026-12-15T09:00:00.000Z",
    "auto_start": false,
    "auto_complete": false,
    "started_at": "2026-12-01T09:12:00.000Z",
    "completed_at": "2026-12-15T09:05:00.000Z",
    "tasks": 9
  },
  "completed": 7,
  "open": 2,
  "to": "sprint",
  "moved_to": {
    "id": "6a7b8c9d-0e1f-4a2b-9c3d-5e6f7a8b9c0d",
    "name": "WEB Sprint 15"
  }
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `conflict`: conflict: The thing changed since it was read, or the change clashes with its state.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).

## Move tasks into a sprint

`POST /orgs/{org}/sprints/{sprint}/tasks`

Scope: `boards:write`

Moves tasks into an active or future sprint of the board, as dragging them there on the backlog does, optionally at a place (before or after a task, or the top or bottom of the sprint). Needs Edit tasks on each; a completed sprint takes none (409). A task joining an active sprint after its start is marked so in the sprint's report. Take tasks out with POST /boards/{board}/backlog/tasks.

### Path parameters

- `org` (string, required): The organisation's id (or its address name). [1 to 100 characters]
- `sprint` (string (uuid), required): The sprint's id.

### Body

- `tasks` (array of string, required): The tasks (ids or keys), in the order they land. [1 to 500 items]
- `before` (string): Just before this task (id or key). [1 to 60 characters]
- `after` (string): Just after this task (id or key). [1 to 60 characters]
- `at` (string): The top or the bottom of the column or section. [one of: top, bottom]

### Request

```sh
curl -X POST "https://projqo.example/api/v1/orgs/{org}/sprints/6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10/tasks" \
  -H "Authorization: Bearer $PROJQO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "tasks": [
    "string"
  ],
  "before": "string",
  "after": "string",
  "at": "top"
}'
```

### Answer: 200

```json
{
  "items": [
    {
      "id": "6f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
      "key": "WEB-12",
      "rank": "0|i0000h:",
      "sprint": {
        "id": "5f6a7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
        "name": "WEB Sprint 14"
      }
    }
  ]
}
```

### Errors

- 400 `invalid`: invalid: A value is wrong or missing, or a parameter is unknown. Every problem is in details.
- 401 `invalid_token`: invalid_token: No token was sent, or it is wrong, expired or revoked, or its person is no longer a member (or is now a guest).
- 403 `insufficient_scope`: insufficient_scope: The token doesn't have the scope this call needs (named in WWW-Authenticate). api_off: The organisation's admins have switched the API off. suspended: projqo has suspended the organisation. refused: The token's person can see the thing but may not do this; the message says why. read_only: The organisation is read-only (over the Free plan's people, or a payment is overdue).
- 404 `not_found`: not_found: Nothing is at this address, or the token's person can't see it: the answer is the same.
- 409 `archived`: archived: The item (or its project) is archived, so it can't be changed. conflict: The thing changed since it was read, or the change clashes with its state.
- 413 `too_large`: too_large: The body or a file is larger than allowed.
- 415 `unsupported_media_type`: unsupported_media_type: The body isn't JSON.
- 429 `rate_limited`: rate_limited: Too many calls in this minute, for the token or for the whole organisation.
- 500 `internal`: internal: Something went wrong on projqo's side (never your mistake).
