## Check whether a completed sprint exists

`GET /v1/scrum/groups/:groupId/team-speed`

Checks whether the scrum project has at least one completed sprint from which team velocity can be calculated.

## 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/team-speed" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/scrum/groups/45/team-speed" \
  -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/team-speed', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
console.log(data.existsCompletedSprint ? 'Completed sprints exist' : 'No completed sprints')
```

### JavaScript — OAuth application

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

const { data } = await res.json()
console.log(data.existsCompletedSprint ? 'Completed sprints exist' : 'No completed sprints')
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | Always `true` on success |
| `data.existsCompletedSprint` | boolean | `true` — the project has at least one completed sprint, `false` — it has none. A non-scrum workgroup the user belongs to also returns `false` |

## Response example

```json
{
  "success": true,
  "data": {
    "existsCompletedSprint": true
  }
}
```

## 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` |

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

- Team velocity is calculated from the story points of tasks in completed sprints: [`GET /v1/scrum/sprints`](/docs/scrum/sprints/list) returns the sprints, and [`GET /v1/scrum/tasks/:taskId`](/docs/scrum/tasks/get) returns a task's sprint and story points.

## See also

- [Get burndown chart data](/docs/scrum/metrics/burn-down)
- [List sprints](/docs/scrum/sprints/list)
- [Sprint metrics](/docs/scrum/metrics)
