#Fire a trigger

POST /v1/triggers/fire

Sends an automation-activation signal for a given CRM entity. Bitrix24 runs all robots and actions configured for the specified trigger at the corresponding pipeline stage.

#Request fields (body)

Field Type Req. Description
entityType string CRM entity type: deal, lead, contact, company, quote, invoice
entityId number CRM entity ID. Source: GET /v1/deals, GET /v1/leads, GET /v1/contacts, GET /v1/companies, GET /v1/quotes, GET /v1/invoices
triggerId string Trigger code. List of codes: `GET /v1/triggers`, field CODE

#Examples

#curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.tech/v1/triggers/fire \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entityType":"deal","entityId":5141,"triggerId":"payment_received"}'

#curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.tech/v1/triggers/fire \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"entityType":"deal","entityId":5141,"triggerId":"payment_received"}'

#JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.tech/v1/triggers/fire', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    entityType: 'deal',
    entityId: 5141,
    triggerId: 'payment_received',
  }),
})
const data = await res.json()
console.log(data.success, data.data) // true, true

#JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.tech/v1/triggers/fire', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    entityType: 'deal',
    entityId: 5141,
    triggerId: 'payment_received',
  }),
})
const data = await res.json()

#Response fields

Field Type Description
success boolean true when the signal was sent successfully
data boolean true — signal accepted by Bitrix24

#Response example

JSON
{
  "success": true,
  "data": true
}

#Error response example

400 — unknown entity type:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_ENTITY_TYPE",
    "message": "Unknown entityType \"banana\". Supported: deal, lead, contact, company, quote, invoice"
  }
}

#Errors

HTTP Code Description
400 MISSING_PARAMS One of the required parameters is missing: entityType, entityId, triggerId
400 INVALID_ENTITY_TYPE Unknown entity type. Allowed: deal, lead, contact, company, quote, invoice
401 MISSING_API_KEY The X-Api-Key header is missing
401 INVALID_API_KEY Invalid or expired API key
401 TOKEN_MISSING The key has no connected Bitrix24 tokens
401 TOKEN_EXPIRED The OAuth user session has expired — re-authorize via /v1/oauth/authorize
403 SCOPE_DENIED The key lacks the crm scope
403 BITRIX_ACCESS_DENIED Bitrix24 denied access
429 RATE_LIMITED Request limit exceeded. Retry in 1–2 seconds
502 BITRIX_UNAVAILABLE Bitrix24 is unavailable

Full list of common API errors — Errors.

#Known specifics

  • The signal is accepted regardless of automation configuration. If no robots are configured for the given triggerId at the current pipeline stage, Bitrix24 still returns data: true — no error occurs.

#See also