Справочник методов

Все методы версии v1. Каждый называет право, которое ему нужно.

Me

GET/v1/meПрава не нужны

Who am I

Key, company and limits. No scope required.

Ответ · 200 · MeDto
curl -X GET "https://api.tygy.ru/v1/me" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Conversations

GET/v1/conversationsПраво: conversations:read

List conversations

Newest activity first. Scope: `conversations:read`.

Параметры
ПолеТипОписание
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
statusstring query · необязательный
assignee_idstring query · необязательныйUser id of the assigned operator
contact_idstring query · необязательный
tagstring query · необязательныйTag id
channelstring query · необязательныйChannel the conversation came in on
updated_sincestring query · необязательныйOnly conversations changed at or after this ISO-8601 instant — for polling
Ответ · 200 · ConversationPageDto
curl -X GET "https://api.tygy.ru/v1/conversations" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/conversations/{id}Право: conversations:read

Get a conversation

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · ConversationDto
curl -X GET "https://api.tygy.ru/v1/conversations/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
PATCH/v1/conversations/{id}Право: conversations:write

Update a conversation

Status, assignee and team. Goes through the same transitions the inbox uses — audit line, notifications and scenarios fire as for an operator. Scope: `conversations:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
statusstring необязательный`open` reopens a closed/spam dialog, wakes a snoozed one or unassigns an assigned one; `snoozed` needs `snoozed_until`; to assign, set `assignee_id` instead. open, closed, snoozed, spam
assignee_idstring | null необязательныйUser id, or null to unassign
team_idstring | null необязательныйTeam id, or null to clear
snoozed_untilstring необязательныйRequired with `status: snoozed`
Ответ · 200 · ConversationDto
curl -X PATCH "https://api.tygy.ru/v1/conversations/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/v1/conversations/{id}/messagesПраво: conversations:read

List messages of a conversation

Oldest first by default. Internal notes (`type: note`) are returned only to keys holding `notes:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
orderstring query · необязательныйOldest first by default
Ответ · 200 · MessagePageDto
curl -X GET "https://api.tygy.ru/v1/conversations/<id>/messages" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/conversations/{id}/messagesПраво: messages:send

Send a reply or leave a note

Attributed to the key («API · <name>» in the inbox). `type: reply` needs `messages:send` and is delivered on the conversation’s channel; `type: note` needs `notes:write` and stays internal.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
bodystring обязательныйPlain text; Markdown is rendered where the channel supports it
typestring необязательный`reply` reaches the customer (scope `messages:send`); `note` stays internal (scope `notes:write`) reply, note
Ответ · 201 · MessageDto
curl -X POST "https://api.tygy.ru/v1/conversations/<id>/messages" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body": "…"}'
POST/v1/conversations/{id}/tagsПраво: conversations:write

Add a tag to a conversation

Idempotent.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
tag_idstring обязательный
Ответ · 200 · ConversationDto
curl -X POST "https://api.tygy.ru/v1/conversations/<id>/tags" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tag_id": "…"}'
DELETE/v1/conversations/{id}/tags/{tagId}Право: conversations:write

Remove a tag from a conversation

Idempotent.

Параметры
ПолеТипОписание
idstring path · обязательный
tagIdstring path · обязательный
Ответ · 200 · ConversationDto
curl -X DELETE "https://api.tygy.ru/v1/conversations/<id>/tags/<tagId>" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Contacts

GET/v1/contactsПраво: contacts:read

List contacts

Most recently updated first. Scope: `contacts:read`.

Параметры
ПолеТипОписание
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
qstring query · необязательныйCase-insensitive substring of the name
emailstring query · необязательныйExact e-mail (any identifier)
phonestring query · необязательныйExact phone (any identifier)
organization_idstring query · необязательный
updated_sincestring query · необязательный
Ответ · 200 · ContactPageDto
curl -X GET "https://api.tygy.ru/v1/contacts" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/contactsПраво: contacts:write

Create a contact

An e-mail / phone / Telegram username already known in the project answers 409 with the existing id — the same address never creates a second person. Scope: `contacts:write`.

Тело запроса
ПолеТипОписание
namestring обязательный
emailstring необязательный
phonestring необязательныйE.164 preferred; national formats are normalised
telegram_usernamestring необязательный
organization_idstring необязательныйClient organization to link the contact to
Ответ · 201 · ContactDto
curl -X POST "https://api.tygy.ru/v1/contacts" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "…"}'
GET/v1/contacts/{id}Право: contacts:read

Get a contact

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · ContactDto
curl -X GET "https://api.tygy.ru/v1/contacts/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
PATCH/v1/contacts/{id}Право: contacts:write

Update a contact

Absent fields stay; null clears.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
namestring | null необязательный
emailstring | null необязательныйReplaces the primary e-mail; null removes it
phonestring | null необязательный
telegram_usernamestring | null необязательный
organization_idstring | null необязательныйnull unlinks
Ответ · 200 · ContactDto
curl -X PATCH "https://api.tygy.ru/v1/contacts/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/v1/contacts/{id}/identifiersПраво: contacts:write

Add an e-mail / phone / Telegram username to a contact

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
typestring обязательныйemail, phone, telegram
valuestring обязательный
Ответ · 200 · ContactDto
curl -X POST "https://api.tygy.ru/v1/contacts/<id>/identifiers" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "email", "value": "…"}'
DELETE/v1/contacts/{id}/identifiers/{identifierId}Право: contacts:write

Remove an identifier from a contact

Параметры
ПолеТипОписание
idstring path · обязательный
identifierIdstring path · обязательный
Ответ · 200 · ContactDto
curl -X DELETE "https://api.tygy.ru/v1/contacts/<id>/identifiers/<identifierId>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/contacts/{id}/tagsПраво: contacts:write

Add a tag to a contact

Idempotent.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
tag_idstring обязательный
Ответ · 200 · ContactDto
curl -X POST "https://api.tygy.ru/v1/contacts/<id>/tags" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tag_id": "…"}'
DELETE/v1/contacts/{id}/tags/{tagId}Право: contacts:write

Remove a tag from a contact

Idempotent.

Параметры
ПолеТипОписание
idstring path · обязательный
tagIdstring path · обязательный
Ответ · 200 · ContactDto
curl -X DELETE "https://api.tygy.ru/v1/contacts/<id>/tags/<tagId>" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Organizations

GET/v1/organizationsПраво: contacts:read

List client organizations

The B2B accounts contacts work for. Scope: `contacts:read`.

Параметры
ПолеТипОписание
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
qstring query · необязательныйCase-insensitive substring of the name
updated_sincestring query · необязательный
Ответ · 200 · OrganizationPageDto
curl -X GET "https://api.tygy.ru/v1/organizations" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/organizationsПраво: contacts:write

Create a client organization

Scope: `contacts:write`.

Тело запроса
ПолеТипОписание
namestring обязательный
emailstring необязательный
phonestring необязательный
websitestring необязательный
Ответ · 201 · OrganizationDto
curl -X POST "https://api.tygy.ru/v1/organizations" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "…"}'
GET/v1/organizations/{id}Право: contacts:read

Get a client organization

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · OrganizationDto
curl -X GET "https://api.tygy.ru/v1/organizations/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
PATCH/v1/organizations/{id}Право: contacts:write

Rename a client organization

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
namestring необязательный
Ответ · 200 · OrganizationDto
curl -X PATCH "https://api.tygy.ru/v1/organizations/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/v1/organizations/{id}/tagsПраво: contacts:write

Add a tag to a client organization

Idempotent.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
tag_idstring обязательный
Ответ · 200 · OrganizationDto
curl -X POST "https://api.tygy.ru/v1/organizations/<id>/tags" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tag_id": "…"}'
DELETE/v1/organizations/{id}/tags/{tagId}Право: contacts:write

Remove a tag from a client organization

Idempotent.

Параметры
ПолеТипОписание
idstring path · обязательный
tagIdstring path · обязательный
Ответ · 200 · OrganizationDto
curl -X DELETE "https://api.tygy.ru/v1/organizations/<id>/tags/<tagId>" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Tags

GET/v1/tagsПраво: tags:read

List tags

Scope: `tags:read`.

Параметры
ПолеТипОписание
scopestring query · необязательный
Ответ · 200 · TagListDto
curl -X GET "https://api.tygy.ru/v1/tags" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Team

GET/v1/usersПраво: team:read

List users (operators)

Active members only. Scope: `team:read`.

Ответ · 200 · UserListDto
curl -X GET "https://api.tygy.ru/v1/users" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/teamsПраво: team:read

List teams

Scope: `team:read`.

Ответ · 200 · TeamListDto
curl -X GET "https://api.tygy.ru/v1/teams" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Help center

GET/v1/kb/handbooksПраво: kb:read

List handbooks

Active help centers of the project. Scope: `kb:read`.

Ответ · 200 · HandbookListDto
curl -X GET "https://api.tygy.ru/v1/kb/handbooks" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/kb/handbooks/{id}/categoriesПраво: kb:read

List categories of a handbook

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · CategoryListDto
curl -X GET "https://api.tygy.ru/v1/kb/handbooks/<id>/categories" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/kb/articlesПраво: kb:read

List published articles

Titles only; fetch one article for its body.

Параметры
ПолеТипОписание
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
qstring query · необязательныйSearch words. Matches the article title and its short description, case-insensitively. The body is not searched — ask for the article to read it.
handbook_idstring query · необязательныйRestrict to one handbook
category_idstring query · необязательныйRestrict to one category
updated_sincestring query · необязательный
Ответ · 200 · ArticlePageDto
curl -X GET "https://api.tygy.ru/v1/kb/articles" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/kb/articlesПраво: kb:write

Create an article

The body is Markdown. Creates a DRAFT unless `status` says otherwise — a sync that goes wrong should not publish. Publishing is also what re-indexes the article for the AI operator. Scope: `kb:write`.

Тело запроса
ПолеТипОписание
handbook_idstring обязательныйWhich handbook the article belongs to
titlestring обязательныйTitle of the article in this locale
markdownstring обязательныйThe body, as Markdown. Headings, paragraphs, lists and tables are understood; the same reader the file import uses converts it, so the result is identical to a typed article.
localestring необязательныйDefaults to the handbook's own locale
category_idstring | null необязательный
slugstring необязательныйDerived from the title when omitted
statusstring необязательныйDefaults to `draft`. Publishing is what re-indexes it for the AI operator. draft, published, archived
Ответ · 201 · ArticleDto
curl -X POST "https://api.tygy.ru/v1/kb/articles" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handbook_id": "…", "title": "…", "markdown": "…"}'
GET/v1/kb/articles/{id}Право: kb:read

Get a published article with its body

Параметры
ПолеТипОписание
idstring path · обязательный
localestring query · необязательныйReturn only this locale’s body (all locales by default)
Ответ · 200 · ArticleDto
curl -X GET "https://api.tygy.ru/v1/kb/articles/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
PATCH/v1/kb/articles/{id}Право: kb:write

Update an article

Every field is optional. Sending `markdown` replaces the body for that locale and requires `title` alongside it, because a translation carries both. Scope: `kb:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
titlestring необязательный
markdownstring необязательныйRequires `title` alongside it
localestring необязательный
category_idstring | null необязательный
slugstring необязательный
statusstring необязательныйdraft, published, archived
Ответ · 200 · ArticleDto
curl -X PATCH "https://api.tygy.ru/v1/kb/articles/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/v1/kb/categoriesПраво: kb:write

Create a category

Scope: `kb:write`.

Тело запроса
ПолеТипОписание
handbook_idstring обязательный
slugstring обязательный
translationsCategoryTranslationInputDto[] обязательный
parent_idstring | null необязательныйNest under another category
Ответ · 201 · CategoryDto
curl -X POST "https://api.tygy.ru/v1/kb/categories" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handbook_id": "…", "slug": "…", "translations": "…"}'
PATCH/v1/kb/categories/{id}Право: kb:write

Update a category

Scope: `kb:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
slugstring необязательный
parent_idstring | null необязательный
translationsCategoryTranslationInputDto[] необязательный
Ответ · 200 · CategoryDto
curl -X PATCH "https://api.tygy.ru/v1/kb/categories/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Analytics

GET/v1/analytics/overviewПраво: analytics:read

Overview

Headline numbers, the daily series and when the load actually lands. Scope: `analytics:read`.

Параметры
ПолеТипОписание
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · OverviewReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/overview" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/channelsПраво: analytics:read

By channel

Volume, share, resolved share and resolution speed per channel. Scope: `analytics:read`.

Параметры
ПолеТипОписание
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · ChannelsReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/channels" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/teamsПраво: analytics:read

By team

The same numbers per team, plus the team × channel breakdown. Scope: `analytics:read`.

Параметры
ПолеТипОписание
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · TeamsReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/teams" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/operatorsПраво: analytics:read

By operator

Taken, closed and replies per operator. Scope: `analytics:read`.

Параметры
ПолеТипОписание
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · OperatorsReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/operators" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/revenueПраво: analytics:read

Revenue

Won revenue, conversion and the split by channel and operator. Scope: `analytics:read`.

Параметры
ПолеТипОписание
recognitionstring query · необязательныйWhich date the money counts on. Default: `won`.
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · RevenueReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/revenue" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/qualityПраво: analytics:read

Dialog quality

AI evaluation of dialogs: average, distribution and the weekly trend. Scope: `analytics:read`.

Параметры
ПолеТипОписание
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · QualityReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/quality" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/botПраво: analytics:read

AI operator

How often the agent was used, and how those dialogs ended. Scope: `analytics:read`.

Параметры
ПолеТипОписание
fromstring query · необязательныйISO-8601 start. Default: 30 days back.
tostring query · необязательныйISO-8601 end. Default: now. The period must not exceed 366 days.
channelstring query · необязательныйNarrow to channels. Comma-separated, or repeat the parameter.
teamstring query · необязательныйTeam ids, comma-separated or repeated.
operatorstring query · необязательныйUser ids, comma-separated or repeated.
Ответ · 200 · BotReportDto
curl -X GET "https://api.tygy.ru/v1/analytics/bot" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/analytics/filtersПраво: analytics:read

Filter values

The channels, teams and operators that actually appear in this project — so a caller filters by real values instead of guessing. Scope: `analytics:read`.

Ответ · 200 · AnalyticsFiltersDto
curl -X GET "https://api.tygy.ru/v1/analytics/filters" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Meetings

GET/v1/meetingsПраво: conferences:read

List meetings

Newest first. Scope: `conferences:read`.

Параметры
ПолеТипОписание
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
Ответ · 200 · MeetingPageDto
curl -X GET "https://api.tygy.ru/v1/meetings" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/meetings/{id}Право: conferences:read

Get a meeting with its summary and transcript

The summary and the transcript are present once the meeting reaches `ready`; before that they are null. Scope: `conferences:read`.

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · MeetingDetailDto
curl -X GET "https://api.tygy.ru/v1/meetings/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"

Webhooks

GET/v1/webhooksПраво: webhooks:manage

List webhook subscriptions

Scope: `webhooks:manage`.

Ответ · 200 · WebhookListDto
curl -X GET "https://api.tygy.ru/v1/webhooks" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/webhooksПраво: webhooks:manage

Create a webhook subscription

The signing secret is returned once, here. Verify a delivery as `HMAC-SHA256("<X-Webhook-Timestamp>.<raw body>", secret)` against `X-Webhook-Signature`.

Тело запроса
ПолеТипОписание
namestring обязательныйHow the subscription is labelled in the settings list
urlstring обязательныйhttps:// endpoint (http:// allowed for localhost only)
eventsstring[] обязательный
Ответ · 201 · WebhookWithSecretDto
curl -X POST "https://api.tygy.ru/v1/webhooks" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "…", "url": "…", "events": ["…"]}'
GET/v1/webhooks/{id}Право: webhooks:manage

Get a webhook subscription

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · WebhookDto
curl -X GET "https://api.tygy.ru/v1/webhooks/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
PATCH/v1/webhooks/{id}Право: webhooks:manage

Update a webhook subscription

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
namestring необязательный
urlstring необязательный
eventsstring[] необязательный
activeboolean необязательныйfalse pauses deliveries; true clears a pause
Ответ · 200 · WebhookDto
curl -X PATCH "https://api.tygy.ru/v1/webhooks/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/v1/webhooks/{id}Право: webhooks:manage

Delete a webhook subscription

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 204
curl -X DELETE "https://api.tygy.ru/v1/webhooks/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/webhooks/{id}/rotate-secretПраво: webhooks:manage

Rotate the signing secret

The new secret is returned once. Deliveries in flight are signed with the new one.

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 200 · WebhookWithSecretDto
curl -X POST "https://api.tygy.ru/v1/webhooks/<id>/rotate-secret" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/webhooks/{id}/testПраво: webhooks:manage

Send a test event

Queues a `webhook.test` delivery with a sample body; watch it in the log. The delivery is asynchronous, so the answer is `202` — it says the event was queued, not that the endpoint replied.

Параметры
ПолеТипОписание
idstring path · обязательный
Ответ · 202 · WebhookTestResultDto
curl -X POST "https://api.tygy.ru/v1/webhooks/<id>/test" \
  -H "Authorization: Bearer $TYGY_API_KEY"
GET/v1/webhooks/{id}/deliveriesПраво: webhooks:manage

Delivery log of a subscription

Newest first, kept for 7 days.

Параметры
ПолеТипОписание
idstring path · обязательный
limitstring query · обязательный
Ответ · 200 · WebhookDeliveryListDto
curl -X GET "https://api.tygy.ru/v1/webhooks/<id>/deliveries" \
  -H "Authorization: Bearer $TYGY_API_KEY"