For AI agents: markdown of this page — /docs-content-en/infra/event-subscriptions/delete.md documentation index — /llms.txt

Delete a subscription

DELETE /v1/infra/servers/:id/event-subscriptions/:subId

Deletes the subscription and unregisters the event in Bitrix24 — this event is no longer delivered to the application. The response is { "success": true } with HTTP status 200.

Parameters

Parameter In Type Req. Description
id path string (UUID) yes Server ID. List: GET /v1/infra/servers
subId path string (UUID) yes Subscription ID. From the response of POST or GET .../event-subscriptions

Examples

curl — personal key

Terminal
curl -X DELETE -H "X-Api-Key: YOUR_API_KEY" \
  https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/event-subscriptions/SUBSCRIPTION_ID

curl — OAuth application

Terminal
curl -X DELETE \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/event-subscriptions/SUBSCRIPTION_ID

JavaScript — personal key

javascript
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/event-subscriptions/${subId}`,
  { method: 'DELETE', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
const { success } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/event-subscriptions/${subId}`,
  {
    method: 'DELETE',
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  }
)
const { success } = await res.json()

Response fields

Field Type Description
success boolean true on successful deletion

Response example

JSON
{
  "success": true
}

Error response example

404 — subscription not found:

JSON
{
  "success": false,
  "error": {
    "code": "SUBSCRIPTION_NOT_FOUND",
    "message": "Subscription not found"
  }
}

Errors

HTTP Code Description
403 INFRA_FORBIDDEN_FOR_COWORK_KEY The call was made with a Cowork/Code key — such a key works with data only and cannot perform write operations. To issue a key that can, see Project key for deploy
403 SERVER_ROLE_FORBIDDEN You are on this server's development team with the Developer role, and this operation is open to the Administrator role. error.hint carries your role, the required threshold and the list of calls that are open to you. Role breakdown — List servers
404 NOT_FOUND Server not found or belongs to another API key while you are not on its development team
404 SUBSCRIPTION_NOT_FOUND Subscription with the given subId was not found for this server

Full list of common API errors — Errors.

Known specifics

  • Deleting the same subscription again returns 404 SUBSCRIPTION_NOT_FOUND. After a successful deletion there is no longer a record with this subId, so the second call does not find the subscription.
  • You can also detach an event with a repeat POST. If you need to redirect the event to a different path rather than delete the subscription, call POST with the same event — it updates the appPath of the existing subscription.

See also