curl --request PATCH \
--url https://api.tungo.kz/v1/workspaces/{ws}/webhooks/endpoints/{id} \
--header 'Content-Type: application/json' \
--cookie tungo.session_token= \
--data '
{
"url": "https://example.com/tungo/webhooks",
"description": "Учётная система",
"event_types": [
"proposal.written",
"payment.succeeded"
],
"channels": [
"scn_01jz8x3m4n5p6q7r8s9t0v1w2x"
],
"enabled": true
}
'import requests
url = "https://api.tungo.kz/v1/workspaces/{ws}/webhooks/endpoints/{id}"
payload = {
"url": "https://example.com/tungo/webhooks",
"description": "Учётная система",
"event_types": ["proposal.written", "payment.succeeded"],
"channels": ["scn_01jz8x3m4n5p6q7r8s9t0v1w2x"],
"enabled": True
}
headers = {
"cookie": "tungo.session_token=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'tungo.session_token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/tungo/webhooks',
description: 'Учётная система',
event_types: ['proposal.written', 'payment.succeeded'],
channels: ['scn_01jz8x3m4n5p6q7r8s9t0v1w2x'],
enabled: true
})
};
fetch('https://api.tungo.kz/v1/workspaces/{ws}/webhooks/endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ep_2xyzExample",
"url": "https://example.com/tungo/webhooks",
"description": "<string>",
"event_types": [
"<string>"
],
"channels": [
"<string>"
],
"enabled": true,
"created_at": "2026-10-05T09:30:00.000Z",
"updated_at": "2026-10-05T09:30:00.000Z"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}Поменять адрес
Меняются только переданные поля. enabled: false — не слать на адрес, пока не включат снова.
Доступ: Владелец или админ workspace; ключ API — с правом webhooks.manage.
Доступно по ключу API.
curl --request PATCH \
--url https://api.tungo.kz/v1/workspaces/{ws}/webhooks/endpoints/{id} \
--header 'Content-Type: application/json' \
--cookie tungo.session_token= \
--data '
{
"url": "https://example.com/tungo/webhooks",
"description": "Учётная система",
"event_types": [
"proposal.written",
"payment.succeeded"
],
"channels": [
"scn_01jz8x3m4n5p6q7r8s9t0v1w2x"
],
"enabled": true
}
'import requests
url = "https://api.tungo.kz/v1/workspaces/{ws}/webhooks/endpoints/{id}"
payload = {
"url": "https://example.com/tungo/webhooks",
"description": "Учётная система",
"event_types": ["proposal.written", "payment.succeeded"],
"channels": ["scn_01jz8x3m4n5p6q7r8s9t0v1w2x"],
"enabled": True
}
headers = {
"cookie": "tungo.session_token=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'tungo.session_token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/tungo/webhooks',
description: 'Учётная система',
event_types: ['proposal.written', 'payment.succeeded'],
channels: ['scn_01jz8x3m4n5p6q7r8s9t0v1w2x'],
enabled: true
})
};
fetch('https://api.tungo.kz/v1/workspaces/{ws}/webhooks/endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ep_2xyzExample",
"url": "https://example.com/tungo/webhooks",
"description": "<string>",
"event_types": [
"<string>"
],
"channels": [
"<string>"
],
"enabled": true,
"created_at": "2026-10-05T09:30:00.000Z",
"updated_at": "2026-10-05T09:30:00.000Z"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}{
"type": "error",
"error": {
"type": "payment_required_error",
"message": "Баланс доп. использования закончился — пополнить его или включить автопополнение могут владелец и админ workspace.",
"code": "balance_exhausted",
"permission": "proposals.approve",
"resets_at": "2026-11-01T19:00:00.000Z",
"allowed_methods": [
"email_otp"
],
"role": "<string>",
"permissions": [
"<string>"
],
"fields": [
{
"path": "bin",
"code": "invalid_format",
"message": "БИН/ИИН — 12 цифр"
}
]
},
"request_id": "req_4f9c2a7e1b3d4c5a8e6f7a9b0c1d2e3f"
}Авторизации
Сессия кабинета: cookie ставит вход через /v1/auth/* (Better Auth), браузер шлёт её сам — фронтенду кабинета ничего добавлять не нужно (fetch с credentials: 'include'). За HTTPS имя cookie — __Secure-tungo.session_token. Сессия кончилась — 401 authentication_error: отправить на вход.
Параметры пути
id организации (workspace), ws_… — из GET /v1/workspaces
id адреса вебхуков (ep_…)
Тело
Изменение адреса: меняются только переданные поля (хотя бы одно).
Адрес приёмника: только https и не во внутренней сети (localhost, 10.x, 192.168.x… — проверяется и по DNS), до 2000 знаков
1 - 2000"https://example.com/tungo/webhooks"
Подпись адреса для людей (до 500 знаков)
500"Учётная система"
Какие события слать на адрес — имена из GET …/webhooks/event-types (до 50). null или не передано при заведении — все события
501 - 100["proposal.written", "payment.succeeded"]
Каналы — id сценариев автоматизаций (scn_…, до 10). Заданы — на адрес приходят только события этих сценариев (automation.run.completed, automation.run.failed, automation.run.notice, automation.write_unknown), и никаких других: так итог конкретного сценария идёт в свою систему. null или не передано при заведении — все события (по event_types)
10^scn_[0-9a-z]{26}$["scn_01jz8x3m4n5p6q7r8s9t0v1w2x"]
false — не слать на адрес, пока не включат снова. При заведении по умолчанию — включён
Ответ
Адрес
Адрес вебхуков: сервер клиента, куда Tungo шлёт события организации.
id адреса (ep_…) — для адресов …/webhooks/endpoints/{id}
"ep_2xyzExample"
Куда слать события (https)
"https://example.com/tungo/webhooks"
Подпись адреса для людей; пустая строка — не задана
Какие события слать (имена из …/webhooks/event-types); null — все
Каналы — id сценариев автоматизаций (scn_…): на адрес идут только события этих сценариев; null — все события
false — на адрес сейчас не шлётся ничего, пока не включат снова (PATCH enabled: true)
Когда заведён, ISO 8601 UTC
"2026-10-05T09:30:00.000Z"
Когда менялся последний раз, ISO 8601 UTC
"2026-10-05T09:30:00.000Z"