Sign in

Webhooks

Methods of the “MAX: webhooks” group. On the right — a request and response example for each.

List of webhooks

GET/v1/max/webhooks/
0 unitsfrom “API.Max Growth”

All webhooks of the key’s organization: URL, channels, whether enabled, how many deliveries are pending, the last successful delivery and the last error. Signing secrets are not included. From the “API.Max Growth” plan, 0 units.

Response fields

FieldTypeDescription
resultslistWebhooks of the key’s organization
results[].idnumberWebhook number — in /v1/max/webhooks/{id}/ URLs and in events
results[].urlstringThe address events are sent to (https://)
results[].is_activeyes / noWhether the webhook is enabled
results[].disabled_reasonstringWhy it is disabled: failing — no successful delivery for a day, client — disabled by you, staff — by datool.ru staff; empty — enabled
results[].channelslistNumbers of the subscribed MAX channels
results[].pendingnumberDeliveries waiting to be sent
results[].created_atdate and timeWhen the webhook was created (ISO 8601, Moscow time)
results[].last_success_atdate and time or nullLast successful delivery
results[].failing_sincedate and time or nullSince when there have been no successful deliveries; null — all good
results[].last_errorstringThe last delivery error, briefly

Errors

CodecodeWhen
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.

Create a webhook

POST/v1/max/webhooks/
0 unitsfrom “API.Max Growth”, a “read and write” key

A new webhook: post.created events about new posts in these channels will be sent to the address as POST requests. The signing secret is in the response and is shown only once.

Request body

JSON with the Content-Type: application/json header.

FieldTypeDescription
urlstringThe https:// address events are sent to
channelslistdatool.ru numbers of public MAX channels (the id field in the catalog)

Response fields

FieldTypeDescription
idnumberWebhook number — in /v1/max/webhooks/{id}/ URLs and in events
urlstringThe address events are sent to (https://)
is_activeyes / noWhether the webhook is enabled
disabled_reasonstringWhy it is disabled: failing — no successful delivery for a day, client — disabled by you, staff — by datool.ru staff; empty — enabled
channelslistNumbers of the subscribed MAX channels
pendingnumberDeliveries waiting to be sent
created_atdate and timeWhen the webhook was created (ISO 8601, Moscow time)
last_success_atdate and time or nullLast successful delivery
failing_sincedate and time or nullSince when there have been no successful deliveries; null — all good
last_errorstringThe last delivery error, briefly
secretstringThe X-Datool-Signature signing secret. Shown only once — save it

Errors

CodecodeWhen
400field errorsAn invalid parameter or body field: the error comes under the field name, for example {"channels": ["Comma-separated channel numbers."]}.
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
403read_only_keyThe key has no “read and write” mark.
403manager_requiredA member’s key: webhooks can be changed by the owner or an administrator.
403limit_reachedYou already have as many webhooks as your plan allows.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.
503timeoutThe database query took longer than 5 seconds — retry later or narrow the selection.

Webhook

GET/v1/max/webhooks/{id}/
0 unitsfrom “API.Max Growth”

One webhook of the organization: channels, state, pending deliveries, the last successful delivery and error. Another organization’s webhook — 404.

Parameters

NameWhereDescription
id required
number
pathWebhook number

Response fields

FieldTypeDescription
idnumberWebhook number — in /v1/max/webhooks/{id}/ URLs and in events
urlstringThe address events are sent to (https://)
is_activeyes / noWhether the webhook is enabled
disabled_reasonstringWhy it is disabled: failing — no successful delivery for a day, client — disabled by you, staff — by datool.ru staff; empty — enabled
channelslistNumbers of the subscribed MAX channels
pendingnumberDeliveries waiting to be sent
created_atdate and timeWhen the webhook was created (ISO 8601, Moscow time)
last_success_atdate and time or nullLast successful delivery
failing_sincedate and time or nullSince when there have been no successful deliveries; null — all good
last_errorstringThe last delivery error, briefly

Errors

CodecodeWhen
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
404not_foundThere is no object with this number or name, or you can’t see it.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.

Change a webhook

PATCH/v1/max/webhooks/{id}/
0 unitsfrom “API.Max Growth”, a “read and write” key

Any of the fields: address, channel list (replaces the previous one entirely), is_active. is_active=true enables a disabled webhook: errors are cleared and posts are sent from now on. A webhook disabled by datool.ru staff (disabled_reason=staff) cannot be enabled this way — 409 conflict, contact support.

Parameters

NameWhereDescription
id required
number
pathWebhook number

Request body

JSON with the Content-Type: application/json header.

FieldTypeDescription
urlstringNew address
channelslistA new channel list — replaces the previous one entirely
is_activeyes / notrue — enable again (errors are cleared), false — disable

Response fields

FieldTypeDescription
idnumberWebhook number — in /v1/max/webhooks/{id}/ URLs and in events
urlstringThe address events are sent to (https://)
is_activeyes / noWhether the webhook is enabled
disabled_reasonstringWhy it is disabled: failing — no successful delivery for a day, client — disabled by you, staff — by datool.ru staff; empty — enabled
channelslistNumbers of the subscribed MAX channels
pendingnumberDeliveries waiting to be sent
created_atdate and timeWhen the webhook was created (ISO 8601, Moscow time)
last_success_atdate and time or nullLast successful delivery
failing_sincedate and time or nullSince when there have been no successful deliveries; null — all good
last_errorstringThe last delivery error, briefly

Errors

CodecodeWhen
400field errorsAn invalid parameter or body field: the error comes under the field name, for example {"channels": ["Comma-separated channel numbers."]}.
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
403read_only_keyThe key has no “read and write” mark.
403manager_requiredA member’s key: webhooks can be changed by the owner or an administrator.
404not_foundThere is no object with this number or name, or you can’t see it.
409conflictThe webhook was disabled by datool.ru staff — only support can enable it.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.
503timeoutThe database query took longer than 5 seconds — retry later or narrow the selection.

Delete a webhook

DELETE/v1/max/webhooks/{id}/
0 unitsfrom “API.Max Growth”, a “read and write” key

Delete a webhook together with its queue of undelivered events. Requires a “read and write” key. Response 204 without a body.

Parameters

NameWhereDescription
id required
number
pathWebhook number

Errors

CodecodeWhen
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
403read_only_keyThe key has no “read and write” mark.
403manager_requiredA member’s key: webhooks can be changed by the owner or an administrator.
404not_foundThere is no object with this number or name, or you can’t see it.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.

Rotate the signing secret

POST/v1/max/webhooks/{id}/rotate-secret/
0 unitsfrom “API.Max Growth”, a “read and write” key

A new signing secret: the previous one stops working immediately. The secret is in the response and is shown only once.

Parameters

NameWhereDescription
id required
number
pathWebhook number

Response fields

FieldTypeDescription
idnumberWebhook number — in /v1/max/webhooks/{id}/ URLs and in events
urlstringThe address events are sent to (https://)
is_activeyes / noWhether the webhook is enabled
disabled_reasonstringWhy it is disabled: failing — no successful delivery for a day, client — disabled by you, staff — by datool.ru staff; empty — enabled
channelslistNumbers of the subscribed MAX channels
pendingnumberDeliveries waiting to be sent
created_atdate and timeWhen the webhook was created (ISO 8601, Moscow time)
last_success_atdate and time or nullLast successful delivery
failing_sincedate and time or nullSince when there have been no successful deliveries; null — all good
last_errorstringThe last delivery error, briefly
secretstringThe X-Datool-Signature signing secret. Shown only once — save it

Errors

CodecodeWhen
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
403read_only_keyThe key has no “read and write” mark.
403manager_requiredA member’s key: webhooks can be changed by the owner or an administrator.
404not_foundThere is no object with this number or name, or you can’t see it.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.

Test a webhook

POST/v1/max/webhooks/{id}/test/
0 unitsfrom “API.Max Growth”, a “read and write” key

A test delivery of a ping event without posts — to check the address and signature. One attempt, no retries; at most once a minute per webhook (more often — 429 throttled with a Retry-After header). The result appears in the last_success_at and last_error fields within a few seconds.

Parameters

NameWhereDescription
id required
number
pathWebhook number

Response fields

FieldTypeDescription
deliverynumberDelivery number (the X-Datool-Delivery header)
statusstringqueued — added to the sending queue

Errors

CodecodeWhen
401not_authenticated / authentication_failedNo key, the key is wrong or revoked, the member is suspended or the key’s organization is archived.
403tariff_requiredWebhooks are available from the “API.Max Growth” plan.
403read_only_keyThe key has no “read and write” mark.
403manager_requiredA member’s key: webhooks can be changed by the owner or an administrator.
404not_foundThere is no object with this number or name, or you can’t see it.
409conflictThe webhook is disabled — enable it (is_active=true) and try again.
429throttledA webhook can be tested at most once a minute.
429rate_limited / throttledToo often — more requests per second than your plan allows; how long to wait is in the Retry-After header.

The error format, limit headers and what to do about each error are in the article “Errors”.

Was this page helpful?

You are leaving datool.ru

The link leads to an external website. datool.ru is not responsible for its content — check the address before entering passwords or payment details.

Redirecting in 10 s

Continue