[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-openlines\u002Fconfig\u002Fcreate":3,"docs-tabs-openlines\u002Fconfig\u002Fcreate":6},{"content":4,"lastmod":5},"\n## Create Open Channel configuration\n\n`POST \u002Fv1\u002Fopenline-configs`\n\nCreates a new Open Channel configuration. At least one recognised writable field is enough to create one — the remaining parameters take their default values. The full record with identifiers and all fields is available via `GET \u002Fv1\u002Fopenline-configs\u002F:id`.\n\n## Request fields (body)\n\nMinimum to create: at least one recognised writable field (see [Configuration fields](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Ffields)).\n\n**Field names.** Pass every field in camelCase — `name`, `active`, `queueType`, `crmCreate`, `workTimeFrom`, and the others from [Configuration fields](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Ffields). This is the canonical case — both the response and `GET \u002Fv1\u002Fopenline-configs\u002Ffields` return fields in it. UPPER_SNAKE_CASE names are also accepted for backward compatibility. The example below uses camelCase.\n\n**Boolean fields** (`active`, `crm`, `workTimeEnable`, `welcomeMessage`, …) accept `true` \u002F `false` — the value is automatically coerced to the `\"Y\"`\u002F`\"N\"` values Bitrix24 expects.\n\n| Field | Type | Required | Description |\n|------|-----|-------|---------|\n| `name` | string | no | Open Channel name |\n| `active` | boolean | no | Whether the channel is active (`true` \u002F `false`) |\n| `queueType` | string | no | Queue distribution: `all` — to all operators at once, `evenly` — evenly across operators, `strictly` — strictly in the queue order |\n| `queueTime` | number | no | Wait time in the queue (seconds) before transfer |\n| `noAnswerTime` | number | no | Time without a response (seconds) after which `noAnswerRule` triggers |\n| `crm` | boolean | no | Enable CRM integration |\n| `crmCreate` | string | no | Type of CRM record created on first contact. Allowed values: `none`, `lead`, `deal` |\n| `workTimeEnable` | boolean | no | Enable the working-hours schedule |\n| `workTimeFrom` | string | no | Start of the working day (for example, `\"9\"` or `\"9.30\"`) |\n| `workTimeTo` | string | no | End of the working day (for example, `\"18\"` or `\"18.30\"`) |\n| `workTimeTimezone` | string | no | Schedule time zone (for example, `\"UTC\"`) |\n| `welcomeMessage` | boolean | no | Enable the welcome message |\n| `welcomeMessageText` | string | no | Welcome message text |\n| `languageId` | string | no | Channel language (for example, `\"en\"`, `\"de\"`) |\n\nFull field list — [`GET \u002Fv1\u002Fopenline-configs\u002Ffields`](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Ffields).\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenline-configs \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Customer support\",\n    \"active\": true,\n    \"queueType\": \"evenly\",\n    \"workTimeEnable\": true,\n    \"workTimeFrom\": \"9\",\n    \"workTimeTo\": \"18\"\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenline-configs \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"name\": \"Customer support\",\n    \"active\": true,\n    \"queueType\": \"evenly\",\n    \"workTimeEnable\": true,\n    \"workTimeFrom\": \"9\",\n    \"workTimeTo\": \"18\"\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenline-configs', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    name: 'Customer support',\n    active: true,\n    queueType: 'evenly',\n    workTimeEnable: true,\n    workTimeFrom: '9',\n    workTimeTo: '18',\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('New configuration ID:', data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenline-configs', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    name: 'Customer support',\n    active: true,\n    queueType: 'evenly',\n    workTimeEnable: true,\n    workTimeFrom: '9',\n    workTimeTo: '18',\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('New configuration ID:', data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | number | Identifier of the created configuration |\n| `meta.warnings` | string[] | Optional. Present when some passed fields are unrecognised — lists the keys Bitrix24 ignored |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": 29\n}\n```\n\n## Error response example\n\n400 — the body has no recognised field:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"VALIDATION_ERROR\",\n    \"message\": \"No recognised openline-configs field in the body. Unrecognised: bogusField. Provide at least one known field (e.g. lineName, queueType, active) — see GET \u002Fv1\u002Fopenline-configs\u002Ffields.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `VALIDATION_ERROR` | The request body is empty — no field was passed |\n| 400 | `VALIDATION_ERROR` | The body has no recognised field (all keys are unknown) — the message lists the unrecognised fields |\n| 400 | `VALIDATION_ERROR` | The `crmCreate` value is not `none`, `lead`, or `deal` |\n| 400 | `READONLY_FIELD` | A read-only field (`id`, `queue`, `dateCreate`, and others) was passed in the body |\n| 401 | `TOKEN_MISSING` | The `X-Api-Key` header was not passed |\n| 403 | `SCOPE_DENIED` | The API key lacks the `imopenlines` scope |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n`data` in the response is a number (the identifier of the new configuration), not a record object. To get the created configuration with all fields, make a separate request: `GET \u002Fv1\u002Fopenline-configs\u002F:id`.\n\n**Request body validation.** Unknown keys in the request body are not saved. Vibecode checks the body against the full field schema ([Configuration fields](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Ffields)) and reacts as follows:\n\n- no field is recognised (e.g. `{ \"bogusField\": \"x\" }`) — the request is rejected with `400 VALIDATION_ERROR` before the Bitrix24 call, and the message lists the unrecognised fields.\n- at least one field is recognised but some keys are unknown — the configuration is created, and the response carries `meta.warnings` with the list of ignored keys.\n- `crmCreate` has a value other than `none`, `lead`, or `deal` — the whole body is rejected with `400 VALIDATION_ERROR` before Bitrix24 is called, and the configuration is not created.\n- a read-only field (`id`, `queue`, `dateCreate`, and others) is passed in the body — the request is rejected with `400 READONLY_FIELD`.\n\n## See also\n\n- [Get configuration](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Fget)\n- [List configurations](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Flist)\n- [Configuration fields](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Ffields)\n","2026-09-23",{},1794739594134]