[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmessages\u002Furl-preview":3,"docs-tabs-chats\u002Fmessages\u002Furl-preview":6},{"content":4,"lastmod":5},"## Remove a link preview\n\n`DELETE \u002Fv1\u002Fchats\u002Fmessages\u002F:messageId\u002Furl-preview`\n\nRemoves the link preview card from your message; the message text stays. The chat is determined from the message, so no `dialogId` is needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `messageId` (path) | number | yes | Message ID, a positive integer — from the [chat feed](\u002Fdocs\u002Fchats\u002Fmessages\u002Flist) (`GET \u002Fv1\u002Fchats\u002F:dialogId\u002Fmessages`) or from the [send](\u002Fdocs\u002Fchats\u002Fmessages\u002Fsend) response |\n\nThe request accepts no body and no query parameters: any field is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Furl-preview \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Furl-preview \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Furl-preview', {\n  method: 'DELETE',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nconst { success } = await res.json()\nconsole.log('Preview removed:', success)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fmessages\u002F1002\u002Furl-preview', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success } = await res.json()\nconsole.log('Preview removed:', success)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.result` | boolean | `true` — the preview is removed |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": { \"result\": true }\n}\n```\n\n## Error response example\n\n422 — the message is not yours:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"WRONG_SENDER\",\n    \"b24Code\": \"WRONG_SENDER\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `messageId` is not a positive integer, or the request has a body field or a query parameter. Checked before any call to Bitrix24 |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused. The code is in `error.b24Code`: `WRONG_SENDER` — the message is not yours, `MESSAGE_NOT_FOUND` — the message does not exist |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 returned the `NOT_FOUND` code. The Bitrix24 code is in `error.b24Code` |\n| 403 | `BITRIX_ACCESS_DENIED` | The user has no access to the chat — Bitrix24 refused with the `ACCESS_DENIED` code |\n| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**No preview from the start.** To keep the preview from appearing at all, send the message with `urlPreview: false` — see [sending a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fsend).\n\n**An edit brings the preview back.** By default, an edit in `format=v2` mode rebuilds the preview from the links in the text, even after this operation. To keep the message without a preview, pass `urlPreview: false` when editing.\n\n## See also\n\n- [Send a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fsend)\n- [Edit a message](\u002Fdocs\u002Fchats\u002Fmessages\u002Fupdate)\n","2026-10-07",{},1794739550949]