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 Required Description
Parameterid Inpath Typestring (UUID) Requiredyes DescriptionServer ID. List: GET /v1/infra/servers
ParametersubId Inpath Typestring (UUID) Requiredyes DescriptionSubscription 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
Fieldsuccess Typeboolean Descriptiontrue 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
HTTP403 CodeINFRA_FORBIDDEN_FOR_COWORK_KEY DescriptionThe 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
HTTP403 CodeSERVER_ROLE_FORBIDDEN DescriptionYou 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
HTTP404 CodeNOT_FOUND DescriptionServer not found or belongs to another API key while you are not on its development team
HTTP404 CodeSUBSCRIPTION_NOT_FOUND DescriptionSubscription 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