## Create a backlog

`POST /v1/scrum/backlogs`

Creates a backlog in a Scrum project that does not have one. The request body is flat, with no `fields` wrapper.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `groupId` | number | yes | Scrum project ID. Group list: [`GET /v1/workgroups`](/docs/entities/workgroups/list) |
| `createdBy` | number | yes | Creator user ID. List: [`GET /v1/users`](/docs/entities/users/list) |
| `modifiedBy` | number | no | ID of the user who modified the backlog. List: [`GET /v1/users`](/docs/entities/users/list) |

Without `createdBy` the backlog is not created: the response is `422 BITRIX_ERROR` with the message `Unable to add backlog`.

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/scrum/backlogs \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "groupId": 175, "createdBy": 1 }'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/scrum/backlogs \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "groupId": 175, "createdBy": 1 }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/scrum/backlogs', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ groupId: 175, createdBy: 1 }),
})

const { data } = await res.json()
console.log('Backlog ID:', data.id)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/scrum/backlogs', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ groupId: 175, createdBy: 1 }),
})

const { data } = await res.json()
console.log('Backlog ID:', data.id)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on successful creation, HTTP status `201` |
| `data.id` | number | ID of the created backlog |
| `data.groupId` | number | Scrum project ID |
| `data.createdBy` | number | Creator user ID |
| `data.modifiedBy` | number | ID of the user who modified the backlog. `0` if `modifiedBy` is not passed |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 43,
    "groupId": 175,
    "createdBy": 1,
    "modifiedBy": 0
  }
}
```

## Error response example

422 — the project already has a backlog:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Backlog already added",
    "b24Code": "0"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `groupId` is missing, a field outside the table is passed, or an ID is not a positive integer |
| 422 | `BITRIX_ERROR` | `Backlog already added` — the project already has a backlog |
| 422 | `BITRIX_ERROR` | `Unable to add backlog` — `createdBy` is missing or the group is not a Scrum project |
| 422 | `BITRIX_ERROR` | `Access denied` — no group with this ID exists or there is no access to it |
| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |
| 401 | `TOKEN_MISSING` | The key has no configured tokens |

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

## See also

- [Update a backlog](/docs/scrum/backlogs/update)
- [Delete a backlog](/docs/scrum/backlogs/delete)
- [Scrum backlogs](/docs/scrum/backlogs)
