[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-userfields\u002Ftasks\u002Fcreate":3,"docs-tabs-userfields\u002Ftasks\u002Fcreate":6},{"content":4,"lastmod":5},"## Create field\n\n`POST \u002Fv1\u002Fuserfields\u002Ftasks`\n\nCreates a task user field. The field is shared across the whole Bitrix24 account: it appears right away in every task for all employees.\n\nPass the field properties flat at the JSON root — without a `fields` wrapper.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `fieldName` | string | yes | System field name. Stored in upper case with the `UF_` prefix: `UF_REVIEW_STAGE` is saved as is, `request_channel` becomes `UF_REQUEST_CHANNEL` |\n| `userTypeId` | string | yes | Field type from the [type catalog](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Ftypes), for example `string`, `enumeration`, `double` |\n| `label` | string \\| object | no | Field label. A string is written to `editFormLabel`, `listColumnLabel` and `listFilterLabel` in all languages. An object sets labels per language — `{ \"ru\": \"Request channel\", \"en\": \"Request channel\" }`; in the remaining languages the field name becomes the label. The label does not go into `errorMessage` and `helpMessage`: those hold the field name |\n| `multiple` | boolean | no | Multiple values in one task. Defaults to `false`. Can be set only at creation. A `boolean` field cannot be multiple |\n| `mandatory` | boolean | no | Required field. Defaults to `false` |\n| `sort` | integer | no | Field order — a non-negative integer. Defaults to `100` |\n| `settings` | object | no | Field settings; the set of keys depends on `userTypeId`. Keys that are not passed get default values — the sets for `string` and `enumeration` are listed on the [Get field](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Fget) page |\n| `items` | array | no | Options of an `enumeration` field. Not accepted for other types |\n| `items[].value` | string | yes | Option name — a non-empty string |\n| `items[].sort` | integer | no | Option order — an integer greater than `0`. Without `sort` the option gets `500`, and the order of options in the response no longer matches the order you passed |\n| `items[].def` | boolean | no | Default option. A field without `multiple` can have only one such option |\n| `items[].xmlId` | string | no | External option ID. Generated automatically if not passed |\n\nThe method accepts no other properties: an unknown key, such as `xmlId` of the field itself, is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fuserfields\u002Ftasks\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"fieldName\": \"UF_REVIEW_STAGE\",\n    \"userTypeId\": \"enumeration\",\n    \"label\": \"Review stage\",\n    \"mandatory\": true,\n    \"sort\": 500,\n    \"items\": [\n      { \"value\": \"New\", \"xmlId\": \"new\", \"sort\": 10, \"def\": true },\n      { \"value\": \"Under review\", \"xmlId\": \"review\", \"sort\": 20 },\n      { \"value\": \"Accepted\", \"xmlId\": \"accepted\", \"sort\": 30 }\n    ]\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fuserfields\u002Ftasks\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"fieldName\": \"UF_REVIEW_STAGE\",\n    \"userTypeId\": \"enumeration\",\n    \"label\": \"Review stage\",\n    \"mandatory\": true,\n    \"sort\": 500,\n    \"items\": [\n      { \"value\": \"New\", \"xmlId\": \"new\", \"sort\": 10, \"def\": true },\n      { \"value\": \"Under review\", \"xmlId\": \"review\", \"sort\": 20 },\n      { \"value\": \"Accepted\", \"xmlId\": \"accepted\", \"sort\": 30 }\n    ]\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fuserfields\u002Ftasks', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    fieldName: 'UF_REVIEW_STAGE',\n    userTypeId: 'enumeration',\n    label: 'Review stage',\n    mandatory: true,\n    sort: 500,\n    items: [\n      { value: 'New', xmlId: 'new', sort: 10, def: true },\n      { value: 'Under review', xmlId: 'review', sort: 20 },\n      { value: 'Accepted', xmlId: 'accepted', sort: 30 },\n    ],\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Created field with id:', data.id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fuserfields\u002Ftasks', {\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    fieldName: 'UF_REVIEW_STAGE',\n    userTypeId: 'enumeration',\n    label: 'Review stage',\n    mandatory: true,\n    sort: 500,\n    items: [\n      { value: 'New', xmlId: 'new', sort: 10, def: true },\n      { value: 'Under review', xmlId: 'review', sort: 20 },\n      { value: 'Accepted', xmlId: 'accepted', sort: 30 },\n    ],\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The whole created field — in the same shape as in the [Get field](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Fget) response |\n| `data.id` | number | Numeric ID of the created field |\n| `data.fieldName` | string | Final field name in the `UF_*` format |\n\nThe response comes with HTTP status `201 Created`.\n\n## Response example\n\nThe labels in the example are trimmed to two languages — `en` and `ru`. The response has more keys: one per language.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 6007967,\n    \"entityId\": \"TASKS_TASK\",\n    \"fieldName\": \"UF_REVIEW_STAGE\",\n    \"userTypeId\": \"enumeration\",\n    \"xmlId\": null,\n    \"sort\": \"500\",\n    \"multiple\": \"N\",\n    \"mandatory\": \"Y\",\n    \"showFilter\": \"N\",\n    \"showInList\": \"Y\",\n    \"editInList\": \"Y\",\n    \"isSearchable\": \"N\",\n    \"settings\": {\n      \"DISPLAY\": \"LIST\",\n      \"LIST_HEIGHT\": 1,\n      \"CAPTION_NO_VALUE\": \"\",\n      \"SHOW_NO_VALUE\": \"Y\"\n    },\n    \"editFormLabel\": {\n      \"en\": \"Review stage\",\n      \"ru\": \"Review stage\"\n    },\n    \"listColumnLabel\": {\n      \"en\": \"Review stage\",\n      \"ru\": \"Review stage\"\n    },\n    \"listFilterLabel\": {\n      \"en\": \"Review stage\",\n      \"ru\": \"Review stage\"\n    },\n    \"errorMessage\": {\n      \"en\": \"UF_REVIEW_STAGE\",\n      \"ru\": \"UF_REVIEW_STAGE\"\n    },\n    \"helpMessage\": {\n      \"en\": \"UF_REVIEW_STAGE\",\n      \"ru\": \"UF_REVIEW_STAGE\"\n    },\n    \"system\": false,\n    \"items\": [\n      {\n        \"id\": 4045,\n        \"value\": \"New\",\n        \"sort\": \"10\",\n        \"def\": \"Y\",\n        \"xmlId\": \"new\"\n      },\n      {\n        \"id\": 4047,\n        \"value\": \"Under review\",\n        \"sort\": \"20\",\n        \"def\": \"N\",\n        \"xmlId\": \"review\"\n      },\n      {\n        \"id\": 4049,\n        \"value\": \"Accepted\",\n        \"sort\": \"30\",\n        \"def\": \"N\",\n        \"xmlId\": \"accepted\"\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n400 — the required `fieldName` was not passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"MISSING_REQUIRED_FIELDS\",\n    \"message\": \"fieldName and userTypeId are required\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_REQUIRED_FIELDS` | `fieldName` or `userTypeId` was not passed |\n| 400 | `INVALID_PARAMS` | The request body is not an object, an unknown key was passed, or a value has the wrong type — for example, `sort` as a string |\n| 400 | `INVALID_PARAMS` | A `boolean` field with `multiple: true` |\n| 400 | `INVALID_PARAMS` | `items` for a field whose type is not `enumeration` |\n| 400 | `INVALID_PARAMS` | An option without `value` or with `sort` less than `1` |\n| 400 | `INVALID_PARAMS` | More than one option with `def: true` for a field without `multiple` |\n| 422 | `BITRIX_ERROR` | Unknown `userTypeId` — the message is `The custom type is invalid.` |\n| 422 | `BITRIX_ERROR` | A field with this name already exists — the message is `The field UF_REVIEW_STAGE for entity TASKS_TASK already exists.` |\n| 403 | `BITRIX_ACCESS_DENIED` | The key owner is not a Bitrix24 account administrator |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |\n| 403 | `TASK_CUSTOM_FIELDS_UNAVAILABLE` | The portal plan does not include task user fields |\n| 403 | `SCOPE_DENIED` | The API key does not have the `task` scope |\n| 502 | `TASK_USERFIELD_OUTCOME_UNKNOWN` | The connection to Bitrix24 dropped, or Bitrix24 returned a server error during the write — whether the field was created is unknown. The request was not retried automatically: find the field in the [list](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Flist) by `fieldName` before creating it again |\n| 502 | `TASK_USERFIELD_READBACK_FAILED` | The field was created, but reading it back after the write failed. The response contains `error.fieldId` — the field ID — and `error.writeConfirmed: true`. Retry the read by `fieldId`, not the creation |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens. For an application key, the `Authorization: Bearer USER_SESSION_TOKEN` header was not passed |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The API creates a task even without a value for a required field.** [`POST \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fcreate) creates a task without the field value even when the field has `mandatory: true`. In that task the field value is `null`, even if a list option has `def: true`.\n\n**A new field is visible in tasks immediately.** After creation the field arrives in [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget) under its camelCase name — `ufReviewStage` for `UF_REVIEW_STAGE`.\n\n## See also\n\n- [Get field](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Fget)\n- [Update field](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Fupdate)\n- [Delete field](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Fdelete)\n- [Field types](\u002Fdocs\u002Fuserfields\u002Ftasks\u002Ftypes)\n- [Task fields](\u002Fdocs\u002Fuserfields\u002Ftasks)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n- [User fields](\u002Fdocs\u002Fuserfields)\n","2026-10-15",{},1795377196961]