## Create recurring settings

`POST /v1/recurring-deals`

Creates settings for automatic deal repetition.

## Request fields (body)

Pass the fields at the JSON root.

| Field | Type | Required | Description |
|---|---|---|---|
| `dealId` | number / string | Yes | Source deal ID, a positive integer. A numeric string is also accepted. Get IDs from [List deals](/docs/entities/deals/list) |
| `active` | boolean / string / null | No | Whether automatic repetition is active. String forms: `"true"` / `"false"`, `"yes"` / `"no"`, `"y"` / `"n"`, `"1"` / `"0"` |
| `startDate` | date / null | No | Schedule start date, for example `2027-01-01` |
| `categoryId` | number / string / null | No | Funnel ID for the generated deals. A numeric string is also accepted. Get IDs from [List pipelines](/docs/entities/deal-categories/list) |
| `isLimit` | string | No | Repetition limit: `N` — unlimited, `T` — by the `limitRepeat` count, `D` — by the `limitDate` date |
| `limitRepeat` | number / string / null | No | Integer repetition count for mode `T`. A numeric string is also accepted |
| `limitDate` | date / null | No | Last allowed date for mode `D` |
| `params` | object | No | Complete schedule object. The parameters are listed below |
| `params.mode` | string / number / null | No | Mode: `single` or `multiple`. Numeric codes `1` and `2` are also accepted |
| `params.singleBeforeStartDateValue` | number / string / null | No | Non-negative integer offset before the start date. A numeric string is also accepted |
| `params.singleBeforeStartDateType` | string / number / null | No | Offset unit: `day`, `week`, `month` or `year`. Numeric unit codes are also accepted |
| `params.multipleType` | string / number / null | No | Repetition unit: `day`, `week`, `month` or `year`. Numeric unit codes are also accepted |
| `params.multipleInterval` | number / string / null | No | Non-negative integer repetition interval. A numeric string is also accepted |
| `params.offsetBeginDateType` | string / number / null | No | Start-date offset unit for the new deal: `day`, `week`, `month` or `year`. Numeric unit codes are also accepted |
| `params.offsetBeginDateValue` | number / string / null | No | Non-negative integer start-date offset for the new deal. A numeric string is also accepted |
| `params.offsetCloseDateType` | string / number / null | No | Close-date offset unit for the new deal: `day`, `week`, `month` or `year`. Numeric unit codes are also accepted |
| `params.offsetCloseDateValue` | number / string / null | No | Non-negative integer close-date offset for the new deal. A numeric string is also accepted |

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/recurring-deals" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dealId":51,"isLimit":"T","limitRepeat":1,"startDate":"2027-01-01","params":{"mode":"multiple","multipleType":"month","multipleInterval":1}}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/recurring-deals" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dealId":51,"isLimit":"T","limitRepeat":1,"startDate":"2027-01-01","params":{"mode":"multiple","multipleType":"month","multipleInterval":1}}'
```

### JavaScript — personal key

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/recurring-deals', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({"dealId":51,"isLimit":"T","limitRepeat":1,"startDate":"2027-01-01","params":{"mode":"multiple","multipleType":"month","multipleInterval":1}}),
})
const result = await response.json()
if (!result.success) throw new Error(result.error.message)
console.log(result.data)
```

### JavaScript — OAuth application

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/recurring-deals', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_APP_KEY', 'Authorization': 'Bearer USER_SESSION_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({"dealId":51,"isLimit":"T","limitRepeat":1,"startDate":"2027-01-01","params":{"mode":"multiple","multipleType":"month","multipleInterval":1}}),
})
const result = await response.json()
if (!result.success) throw new Error(result.error.message)
console.log(result.data)
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | Whether the request succeeded |
| `data` | object | Recurring settings. For the full list of fields, see [Recurring deal fields](./fields.md) |

## Response example

201 — the settings were created:

```json
{
  "success": true,
  "data": {
    "id": 11,
    "dealId": 53,
    "basedId": 51,
    "active": true,
    "categoryId": null,
    "isLimit": "T",
    "counterRepeat": null,
    "limitRepeat": 1,
    "limitDate": null,
    "startDate": "2027-01-01",
    "nextExecution": "2026-12-31T22:00:00.000Z",
    "lastExecution": null,
    "params": {
      "mode": "multiple",
      "singleBeforeStartDateValue": 0,
      "singleBeforeStartDateType": null,
      "multipleType": "month",
      "multipleInterval": 1,
      "offsetBeginDateType": null,
      "offsetBeginDateValue": 0,
      "offsetCloseDateType": null,
      "offsetCloseDateValue": 0
    }
  }
}
```

## Error response example

400 — `dealId` is missing:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELDS",
    "message": "Body field \"dealId\" is required to create recurringDeal."
  }
}
```

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `MISSING_REQUIRED_FIELDS` | `dealId` is missing |
| 400 | `INVALID_PARAMS` | Invalid deal ID, limit mode, value type or schedule parameter |
| 400 | `READONLY_FIELD` | A read-only field was passed |
| 400 | `NESTED_FIELDS_ENVELOPE` | The fields were passed inside a `fields` object. Pass them at the JSON root |
| 422 | `BITRIX_ERROR` | The template deal already has recurring settings. Message: `Deal already have had recurring settings.` |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | No Bitrix24 access tokens are configured |
| 403 | `MANAGEMENT_KEY_NO_ENTITY_ACCESS` | A management key has no access to entity methods |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | After the scope check, writing is blocked because the key is in read-only mode |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the operation or a plan restriction applies. See `error.message` |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |
| 502 | `BITRIX_UNAVAILABLE` | A network failure, or a Bitrix24 server error with HTTP status 500 or above |
| 429 | `RATE_LIMITED` | The request rate limit was exceeded. Retry after the interval in the `Retry-After` header |

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

## See also

- [Recurring deal fields](./fields.md)
- [List recurring deals](./list.md)
- [Recurring deals](../recurring-deals.md)
- [MCP](/docs/mcp)
- [Update recurring settings](./update.md)
- [Delete recurring settings](./delete.md)
- [Deals](/docs/entities/deals)
