## Get burndown chart data

`GET /v1/scrum/groups/:groupId/burn-down`

Returns the scrum project sprint used to build the burndown chart: the current active sprint, or the last completed one if there is no active sprint.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|-------|----------|
| `groupId` (path) | number | yes | Scrum project ID. List: [`GET /v1/workgroups`](/docs/entities/workgroups/list) |

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/scrum/groups/45/burn-down" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/scrum/groups/45/burn-down" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/scrum/groups/45/burn-down', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
console.log(data.sprint ? `${data.sprint.name}: ${data.sprint.status}` : 'No sprints')
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/scrum/groups/45/burn-down', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
console.log(data.sprint ? `${data.sprint.name}: ${data.sprint.status}` : 'No sprints')
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | Always `true` on success |
| `data.sprint` | object \| null | The sprint for the chart, or `null` if the project has neither an active nor a completed sprint. A non-scrum workgroup the user belongs to also returns `null` |
| `data.sprint.id` | number | Sprint ID. Full data: [`GET /v1/scrum/sprints/:id`](/docs/scrum/sprints/get) |
| `data.sprint.groupId` | number | Scrum project ID |
| `data.sprint.entityType` | string | Record type, `sprint` |
| `data.sprint.name` | string | Sprint name |
| `data.sprint.sort` | number | Sprint order within the project |
| `data.sprint.createdBy` | number | ID of the sprint author. List: [`GET /v1/users`](/docs/entities/users/list) |
| `data.sprint.modifiedBy` | number | ID of the employee who last modified the sprint. List: [`GET /v1/users`](/docs/entities/users/list) |
| `data.sprint.dateStart` | string | Sprint start in ISO 8601 format |
| `data.sprint.dateEnd` | string | Sprint end in ISO 8601 format |
| `data.sprint.status` | string | `active` — the sprint is in progress, `completed` — finished |
| `data.sprint.info` | object | An empty object in the sprints checked |
| `data.sprint.children` | array | An empty array in the sprints checked |
| `data.sprint.tmpId` | string | An empty string in the sprints checked |

## Response example

Active sprint:

```json
{
  "success": true,
  "data": {
    "sprint": {
      "id": 11,
      "groupId": 45,
      "entityType": "sprint",
      "name": "Sprint 3",
      "sort": 0,
      "createdBy": 29,
      "modifiedBy": 29,
      "dateStart": "2023-09-15T01:00:00+00:00",
      "dateEnd": "2023-09-29T01:00:00+00:00",
      "status": "active",
      "info": {},
      "children": [],
      "tmpId": ""
    }
  }
}
```

Project without sprints:

```json
{
  "success": true,
  "data": {
    "sprint": null
  }
}
```

## Error response example

422 — the project does not exist or the user has no access to it:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "You do not have access.",
    "b24Code": "TASKS_SCS_02"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | `groupId` is not a positive integer |
| 401 | `MISSING_API_KEY` | `X-Api-Key` is not provided |
| 401 | `TOKEN_MISSING` | The key has no tokens configured |
| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |
| 422 | `BITRIX_ERROR` | The project does not exist or the user has no access to it. `error.b24Code` is `TASKS_SCS_02` |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

- Chart points are built from the sprint tasks and their story points: [`GET /v1/tasks?filter[groupId]=45`](/docs/entities/tasks/list) returns the project tasks, and [`GET /v1/scrum/tasks/:taskId`](/docs/scrum/tasks/get) returns a task's sprint and story points.

## See also

- [Check whether a completed sprint exists](/docs/scrum/metrics/team-speed)
- [Active sprint](/docs/scrum/sprints/active)
- [List sprints](/docs/scrum/sprints/list)
- [Sprint metrics](/docs/scrum/metrics)
