## Create a deal from a template

`POST /v1/recurring-deals/:id/expose`

Creates a deal immediately from a recurring deal template. Use it for manual creation when you do not need to wait for the next scheduled run.

## Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `id` (path) | number | yes | — | Setting ID from the [recurring deals list](./list.md). A positive integer within the safe range |

## Request fields (body)

The request body can be empty or `{}`. No fields are accepted.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/recurring-deals/11/expose" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/recurring-deals/11/expose" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### JavaScript — personal key

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/recurring-deals/11/expose', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({}),
})
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/11/expose', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_APP_KEY', 'Authorization': 'Bearer USER_SESSION_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({}),
})
const result = await response.json()
if (!result.success) throw new Error(result.error.message)
console.log(result.data)
```

## Response fields

| Field | Type | Required | Description |
|---|---|---|---|
| `success` | boolean | yes | `true` on successful creation |
| `data` | object | yes | The created deal |
| `data.dealId` | number | yes | ID of the new deal. Get the deal: [by ID](../deals/get.md) |
| `data.links` | object | yes | Links to the created deal |
| `data.links.deal` | string | yes | Relative path to the deal resource: `/v1/deals/:dealId` |

## Response example

201 — the deal is created:

```json
{
  "success": true,
  "data": {
    "dealId": 52,
    "links": {
      "deal": "/v1/deals/52"
    }
  }
}
```

## Error response example

400 — a field is passed in the request body:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "This action accepts no fields"
  }
}
```

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `INVALID_PARAMS` | `id` is not a positive integer within the safe range |
| 400 | `INVALID_PARAMS` | The request body contains fields, or is `null`, an array or a scalar instead of an object. Message: `This action accepts no fields` |
| 404 | `ENTITY_NOT_FOUND` | A setting with this ID is not found |
| 502 | `BITRIX_RESPONSE_INVALID` | The Bitrix24 response contains no valid ID of the created deal |
| 403 | `MANAGEMENT_KEY_NO_ENTITY_ACCESS` | A management key has no access to entity data |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key passed the scope check, but its mode forbids creating a deal |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |
| 401 | `TOKEN_MISSING` | No Bitrix24 access tokens are configured |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access |
| 422 | `BITRIX_ERROR` | A Bitrix24 business refusal or a plan restriction. The reason is in `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 and above |
| 429 | `RATE_LIMITED` | The request limit is exceeded. The wait time is in the `Retry-After` header |

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

## See also

- [Get a setting](./get.md)
- [Update a setting](./update.md)
- [Recurring deals](../recurring-deals.md)
- [MCP for AI](/docs/mcp)
- [Get a deal](../deals/get.md)
- [Deals](../deals.md)
