لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/notifications/answer.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Answer a notification

POST /v1/notifications/:id/answer

Sends a text reply to a notification on behalf of the token owner. The Bitrix24 module that sent the notification decides how to handle the reply.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionNotification identifier — the data.notifications[].id field in the notification feed GET /v1/notifications. A positive integer

Request fields (body)

Field Type Required Description
Fieldtext Typestring Requiredyes DescriptionReply text. A whitespace-only string and the string "0" are not accepted

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/notifications/38963/answer" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "text": "Got it, thanks" }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/notifications/38963/answer" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "text": "Got it, thanks" }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/38963/answer', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ text: 'Got it, thanks' }),
})

const { data } = await res.json()
console.log(data.resultMessage[0])

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/notifications/38963/answer', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ text: 'Got it, thanks' }),
})

const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata.resultMessage Typestring[] DescriptionResult messages. Bitrix24 writes the text — escape it before rendering it in an interface

Response example

HTTP 200:

JSON
{
  "success": true,
  "data": {
    "resultMessage": ["Your reply has been sent."]
  }
}

Error response example

422 — the token owner has no notification with this id:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Notification is absent, unavailable to the token owner, or cannot perform this action.",
    "b24Code": "NOTIFICATION_ACTION_FAILED"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe path id is not a positive integer
HTTP400 CodeINVALID_PARAMS Descriptiontext is missing, is not a string, is whitespace-only or equals "0"
HTTP400 CodeINVALID_PARAMS DescriptionAnother body field or a query string parameter was passed, or the body is not a JSON object. The field is named in the message. Checked before the Bitrix24 call
HTTP400 CodeFST_ERR_CTP_EMPTY_JSON_BODY DescriptionThe Content-Type: application/json header was sent with an empty body
HTTP422 CodeBITRIX_ERROR DescriptionThe notification does not exist, is unavailable to the token owner or does not accept a reply. The Bitrix24 error code NOTIFICATION_ACTION_FAILED is in the error.b24Code field
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 returned a response without the list of result messages
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode. Checked before the Bitrix24 call
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not sent

Full list of common API errors — Errors.

Known specifics

  • A reply is also accepted for a notification that has no reply field, for example one sent with POST /v1/notifications. The message in data.resultMessage confirms only that Bitrix24 accepted the reply, not that the source module processed it.
  • A repeated reply to the same notification also returns 200. After a reply the notification stays in the feed and is not marked as read — use Mark as read for that.
  • The reply is sent on behalf of the token owner: with a personal key, the key owner; with an OAuth application key and the Authorization: Bearer header, the session user.

See also