[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-source-storage\u002Fmetadata-tag":3,"docs-tabs-source-storage\u002Fmetadata-tag":6},{"content":4,"lastmod":5},"## Set or remove a tag\n\n`POST \u002Fv1\u002Fapps\u002F:id\u002Fsources\u002F:versionId\u002Ftag`\n\nAdds or removes a single tag on a version without touching the others. Unlike [Update version metadata](\u002Fdocs\u002Fsource-storage\u002Fmetadata-update), which replaces the whole list, this operation changes exactly one element.\n\nTwo tags are recognized, and both protect the version from automatic cleanup:\n\n- `manual` — the version is pinned manually by an operator.\n- `published` — the version is marked as published. This tag is also set automatically after `POST \u002Fv1\u002Fapps\u002F:id\u002Fpublish`.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | UUID | yes | Application identifier. Get it via [`GET \u002Fv1\u002Fapps`](\u002Fdocs\u002Fapps\u002Flist). |\n| `versionId` (path) | string | yes | Version identifier of the form `v\u003CN>`. Get it via [List versions](\u002Fdocs\u002Fsource-storage\u002Fversions). |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `tag` | string | yes | `manual` or `published`. |\n| `action` | string | yes | `add` — add the tag, `remove` — remove it. |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fapps\u002F\u003CAPP_ID>\u002Fsources\u002Fv3\u002Ftag \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"tag\": \"manual\", \"action\": \"add\" }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fapps\u002F\u003CAPP_ID>\u002Fsources\u002Fv3\u002Ftag \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"tag\": \"manual\", \"action\": \"add\" }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch(\n  `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fapps\u002F${appId}\u002Fsources\u002Fv3\u002Ftag`,\n  {\n    method: 'POST',\n    headers: {\n      'X-Api-Key': 'YOUR_API_KEY',\n      'Content-Type': 'application\u002Fjson',\n    },\n    body: JSON.stringify({ tag: 'manual', action: 'add' }),\n  },\n)\nconst { data } = await res.json()\nconsole.log('Version tags:', data.tags)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch(\n  `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fapps\u002F${appId}\u002Fsources\u002Fv3\u002Ftag`,\n  {\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({ tag: 'manual', action: 'add' }),\n  },\n)\nconst { data } = await res.json()\nconsole.log('Version tags:', data.tags)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success. |\n| `data.versionId` | string | Version identifier. |\n| `data.tags` | string[] | Version tags after the operation. |\n\n## Response example\n\n`HTTP 200`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"versionId\": \"v3\",\n    \"tags\": [\"manual\"]\n  }\n}\n```\n\n## Error response example\n\n404 — there is no version with that identifier:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"VERSION_NOT_FOUND\",\n    \"message\": \"Version v3 not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_TAG` | The tag is not one of `manual`, `published`. |\n| 400 | `INVALID_ACTION` | The action is neither `add` nor `remove`. |\n| 400 | `INVALID_VERSION_ID` | The `versionId` format does not match `v\u003Cnon-negative integer>`. |\n| 403 | `SOURCE_APP_ID_MISMATCH` | The call was made with an authorization key `vibe_app_…` issued for a different application. Such a key can access only its own application's snapshots, even when both applications were created by the same author. |\n| 403 | `NOT_AUTHORIZED` | Only the application author, the application OAuth key, or a Bitrix24 account administrator can manage snapshots. |\n| 403 | `INFRA_FORBIDDEN_FOR_COWORK_KEY` | The call was made with a Cowork key — such a key works with data only and cannot perform write operations. To issue a key that can, see [Project key for deploy](\u002Fdocs\u002Fcowork\u002Fdeploy-key). |\n| 404 | `APP_NOT_FOUND` | The application does not exist, was deleted, or belongs to another portal. |\n| 404 | `VERSION_NOT_FOUND` | A version with this `versionId` does not exist or was deleted. |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Source code storage](\u002Fdocs\u002Fsource-storage)\n- [List versions](\u002Fdocs\u002Fsource-storage\u002Fversions)\n- [Update version metadata](\u002Fdocs\u002Fsource-storage\u002Fmetadata-update)\n- [Deleting versions](\u002Fdocs\u002Fsource-storage\u002Fdelete)\n- [Version lifetime and cleanup](\u002Fdocs\u002Fsource-storage\u002Fretention)\n- [Save a snapshot](\u002Fdocs\u002Fsource-storage\u002Fsave)\n","2026-11-05",{},1794739605741]