[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcrm-field-values\u002Fprimary-contact":3,"docs-tabs-entities\u002Fcrm-field-values\u002Fprimary-contact":6},{"content":4,"lastmod":5},"## Set the primary CRM contact\n\n`PUT \u002Fv1\u002Fdeals\u002F:id\u002Fprimary-contact`\n\n`PUT \u002Fv1\u002Fleads\u002F:id\u002Fprimary-contact`\n\n`PUT \u002Fv1\u002Fquotes\u002F:id\u002Fprimary-contact`\n\n`PUT \u002Fv1\u002Finvoices\u002F:id\u002Fprimary-contact`\n\n`PUT \u002Fv1\u002Fitems\u002F:entityTypeId\u002F:id\u002Fprimary-contact`\n\nSelect an already bound contact as primary without replacing other bindings.\n\n> These operations require the `crm-rest-v3` flag and a Bitrix24 update after `crm 26.2200.0` with `RestV3CrudDeal` enabled. Until available, calls return `422 METHOD_NOT_YET_AVAILABLE` with `error.release`.\n\nRequires `crm` scope and `READWRITE` access. [Resource and value formats](\u002Fdocs\u002Fentities\u002Fcrm-field-values).\n\n## Parameters\n\n| Parameter | Type | Required | Default | Description |\n|---|---|---|---|---|\n| `id` (path) | integer | yes | — | Record ID from the corresponding list resource |\n| `entityTypeId` (path) | integer | for items | — | Smart-process type from [List smart process types](\u002Fdocs\u002Fentities\u002Fsmart-processes\u002Flist) |\n\n## Request body\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `contactId` | integer | yes | Already bound contact ID from [List contacts](\u002Fdocs\u002Fentities\u002Fcontacts\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -i -X PUT \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F12\u002Fprimary-contact\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"contactId\":34}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -i -X PUT \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F12\u002Fprimary-contact\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"contactId\":34}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F12\u002Fprimary-contact', {\n  method: 'PUT',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({\"contactId\": 34})\n})\nconsole.log(res.status === 204)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fdeals\u002F12\u002Fprimary-contact', {\n  method: 'PUT',\n  headers: { 'X-Api-Key': 'YOUR_APP_KEY', 'Content-Type': 'application\u002Fjson', 'Authorization': 'Bearer USER_SESSION_TOKEN' },\n  body: JSON.stringify({\"contactId\": 34})\n})\nconsole.log(res.status === 204)\n```\n\n## Response fields\n\nSuccess is HTTP `204 No Content` with an empty body. Check the status, do not parse JSON.\n\n## Response example\n\n```http\nHTTP\u002F1.1 204 No Content\n```\n\n## Error response example\n\n400 — missing request field.\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Body must contain only contactId\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|---|---|---|\n| 400 | `INVALID_PARAMS` | Invalid request shape or ID |\n| 400 | `UNKNOWN_FILTER_FIELD` | Unknown query parameter |\n| 400 | `INVALID_ENTITY_TYPE_ID` | Reserved type requires its named resource |\n| 401 | `TOKEN_MISSING` | Bitrix24 credentials are missing |\n| 403 | `SCOPE_DENIED` | Key lacks crm scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | Key forbids writes |\n| 404 | `ENTITY_NOT_FOUND` | Record was not found |\n| 422 | `METHOD_NOT_YET_AVAILABLE` | Feature unavailable; error.release identifies the update |\n| 502 | `BITRIX_UNAVAILABLE` | No valid update confirmation |\n\nBitrix24 failures use standard V1 error handling; messages are sanitized to remove credentials. [Common errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [CRM field values and primary contact](\u002Fdocs\u002Fentities\u002Fcrm-field-values)\n","2026-11-03",{},1795602561557]