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

Все методы версии 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"
POST/v1/conversationsПраво: conversations:start

Start a conversation with a contact

Writes first, the way «Write first» in the inbox does: reuses the contact’s open conversation on the same channel or opens a new one, and sends `body` as the first message, attributed to the key. A channel that cannot initiate (a Telegram, VK or MAX bot to someone who never wrote to it) answers 409. Emits `conversation.created` for a new conversation. Scope: `conversations:start` (+ `conversations:write` for `assignee_id`).

Тело запроса
ПолеТипОписание
contact_idstring обязательныйAn existing contact of the project
bodystring обязательныйThe first message, plain text
channelstring необязательныйDefaults to the channel of the contact’s latest conversation that can start one. Telegram, VK and MAX reach only a customer who wrote to the bot before. email, whatsapp, telegram, vk, max
subjectstring необязательныйSubject line, for `email` only
assignee_idstring необязательныйUser to assign the conversation to; needs `conversations:write` as well
Ответ · 201 · StartConversationResultDto
curl -X POST "https://api.tygy.ru/v1/conversations" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contact_id": "…", "body": "…"}'
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
includestring query · необязательныйWith `calls:read`: `transcript` adds each call’s full transcript to its card. Left out, `call.transcript` is null to keep the page light — the summary and recordings still come.
Ответ · 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"
POST/v1/conversations/{id}/meetingsПраво: meetings:write

Offer the customer a video meeting

Creates a meeting hosted by `operator_id` and posts its link into the conversation as a reply — what «Offer a meeting» does in the inbox. Scope: `meetings:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
operator_idstring необязательныйUser who hosts the meeting. Required for an API key — a meeting needs a person to run it.
messagestring необязательныйInvitation text. `{join_url}` is replaced with the link; without it the link is appended. Defaults to the cabinet’s invitation in the project’s language.
Ответ · 201 · ProposeMeetingResultDto
curl -X POST "https://api.tygy.ru/v1/conversations/<id>/meetings" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

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
attributesobject необязательныйCustom attribute values by key (see `GET /v1/contacts/attributes`). Merged: keys you leave out stay, `null` clears one. The widget's rule (ADR-0028): an unknown key is kept (shown under «Другое»), a value of the wrong type is dropped, a long one is cut — each reported in `attribute_warnings` of the response, status 200. A non-object is a 422.
Ответ · 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/attributesПраво: contacts:read

List custom contact attributes

The project’s attribute schema: what `attributes` on a contact may hold and of which type. Scope: `contacts:read`.

Ответ · 200 · ContactAttributeDefinitionListDto
curl -X GET "https://api.tygy.ru/v1/contacts/attributes" \
  -H "Authorization: Bearer $TYGY_API_KEY"
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
attributesobject необязательныйCustom attribute values by key (see `GET /v1/contacts/attributes`). Merged: keys you leave out stay, `null` clears one. The widget's rule (ADR-0028): an unknown key is kept (shown under «Другое»), a value of the wrong type is dropped, a long one is cut — each reported in `attribute_warnings` of the response, status 200. A non-object is a 422.
Ответ · 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"
POST/v1/tagsПраво: tags:write

Create a tag

A name already used in the same scope answers 409. Scope: `tags:write`. There is no delete: removing a tag strips it everywhere at once, which is for a person.

Тело запроса
ПолеТипОписание
scopestring обязательныйWhat the tag can be attached to; fixed for life conversation, contact, organization, conference
namestring обязательныйUp to 40 characters, unique within the scope
colorstring необязательныйOne of the fixed palette; defaults to the first #ff4747, #ff55a5, #b459c9, #0080ff, #00b8e9, #00b3be, #00bc97, #00be3b, #8ebe00, #baad0e, #e7b500, #ff8200, #ff5f00, #353d43, #75818b, #9ca5ad
Ответ · 201 · TagDto
curl -X POST "https://api.tygy.ru/v1/tags" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scope": "conversation", "name": "…"}'
PATCH/v1/tags/{id}Право: tags:write

Rename or recolor a tag

Every dialog and contact that carries it shows the change. Absent fields stay.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
namestring необязательный
colorstring необязательный#ff4747, #ff55a5, #b459c9, #0080ff, #00b8e9, #00b3be, #00bc97, #00be3b, #8ebe00, #baad0e, #e7b500, #ff8200, #ff5f00, #353d43, #75818b, #9ca5ad
Ответ · 200 · TagDto
curl -X PATCH "https://api.tygy.ru/v1/tags/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

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 articles

Published articles, titles only; fetch one article for its body. A key that also holds `kb:write` may pass `status=draft|archived|all` to see unpublished ones. Scope: `kb:read`.

Параметры
ПолеТипОписание
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 · необязательный
statusstring query · необязательныйWhich articles to list. Anything but `published` needs `kb:write` as well — a writer must see the drafts it made; a reader sees only what customers see.
Ответ · 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 an article with its body

A published article. A key that also holds `kb:write` gets drafts and archived articles too; to any other key they are 404, like a missing id. Scope: `kb:read`.

Параметры
ПолеТипОписание
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 '{}'
POST/v1/kb/mediaПраво: kb:write

Upload an image or video for an article

Multipart form: `file` and `handbook_id`. Images (PNG, JPEG, WebP, GIF, AVIF) and video (MP4, WebM, MOV, M4V), up to 50 MB — the same limits as the editor. Put the returned `url` on a line of its own in article Markdown: `![caption](url)`. Scope: `kb:write`.

Ответ · 201 · MediaDto
curl -X POST "https://api.tygy.ru/v1/kb/media" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/kb/articles/{id}/translateПраво: kb:translate

Translate an article with AI

Starts the same AI translation as the editor, from the article’s own language into each locale in `locales`, and answers 202 at once. Translations land with `source: "ai"`; read the article to see them. A locale a person has edited is skipped unless `overwrite_human` is true. On a published article the new translation is live as soon as it is written. Spends the project’s AI tokens — 402 `ai_budget_exhausted` when they are used up. Scope: `kb:translate`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
localesstring[] обязательныйTarget locales. Each must be one of the handbook's locales, not its primary.
overwrite_humanboolean необязательныйRe-translate locales a person has edited too. Off by default: a human translation is never overwritten unless you ask.
Ответ · 202 · TranslationJobDto
curl -X POST "https://api.tygy.ru/v1/kb/articles/<id>/translate" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"locales": ["…"]}'

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"

Contact notes

GET/v1/contacts/{id}/notesПраво: notes:read

List the notes on a contact

The notes on the contact card, newest first. Scope: `notes:read`.

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

Add a note to a contact

Shown on the contact card as written by «API · <key name>». Scope: `notes:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
bodystring обязательныйPlain text, up to 5000 characters
Ответ · 201 · ContactNoteDto
curl -X POST "https://api.tygy.ru/v1/contacts/<id>/notes" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body": "…"}'

Macros

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

List shared macros

The project’s shared saved replies, newest first, a page at a time; `q` finds text in the title or the shortcut. Operators’ personal macros are not included. Scope: `macros:read`.

Параметры
ПолеТипОписание
limitstring query · необязательныйPage size, 1…100
starting_afterstring query · необязательныйCursor from the previous page’s `next_cursor`
qstring query · необязательныйFinds the text in the title or the shortcut
Ответ · 200 · MacroListDto
curl -X GET "https://api.tygy.ru/v1/macros" \
  -H "Authorization: Bearer $TYGY_API_KEY"
POST/v1/macrosПраво: macros:write

Create a shared macro

Scope: `macros:write`. There is no delete: removing a macro is for a person.

Тело запроса
ПолеТипОписание
titlestring обязательныйUp to 120 characters
bodystring обязательныйUp to 8000 characters; `{{placeholders}}` allowed
shortcutstring | null необязательныйA leading «/» is dropped
Ответ · 201 · MacroDto
curl -X POST "https://api.tygy.ru/v1/macros" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "…", "body": "…"}'
GET/v1/macros/{id}Право: macros:read

Get a shared macro

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

Edit a shared macro

Absent fields stay.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
titlestring необязательный
bodystring необязательный
shortcutstring | null необязательныйnull removes it
Ответ · 200 · MacroDto
curl -X PATCH "https://api.tygy.ru/v1/macros/<id>" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Calls

POST/v1/conversations/{id}/callsПраво: calls:make

Call the customer (click-to-call)

Asks the connected telephony to ring `operator_id`’s extension first and dial the customer when they pick up — what «Call» does in the inbox. 202 means the provider accepted the request; the call itself appears as a card in the conversation. One attempt per operator at a time; an unclear outcome is never retried for you. Scope: `calls:make`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
operator_idstring необязательныйUser whose extension rings first; the customer is dialled when they pick up. Required for an API key — a key has no phone of its own.
phonestring необязательныйOne of the contact's own numbers (any spelling). Defaults to the contact's primary phone; a number not on the contact is a 422 — add it to the contact first.
Ответ · 202 · CallAttemptDto
curl -X POST "https://api.tygy.ru/v1/conversations/<id>/calls" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Quality

GET/v1/conversations/{id}/qualityПраво: quality:read

Get the quality marks of a conversation

The AI score, the customer’s rating and the reviewer’s verdict. Scope: `quality:read`.

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

Set the reviewer’s verdict

Rates a CLOSED conversation 1–5; a score of 1–3 needs a `comment`. Replaces the previous verdict, notifies the responsible operator, and a disagreement with the AI score teaches the AI judge — exactly as a review in the inbox. Scope: `quality:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
scorenumber обязательныйInteger 1–5
commentstring | null необязательныйRequired for scores 1–3: a low mark without a reason teaches nobody
Ответ · 200 · ConversationQualityDto
curl -X PUT "https://api.tygy.ru/v1/conversations/<id>/quality" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"score": 1}'

Organization notes

GET/v1/organizations/{id}/notesПраво: notes:read

List the notes on a company

The notes on the client company card, newest first. Scope: `notes:read`.

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

Add a note to a company

Only for a key that acts on behalf of an employee («Действует от имени»): the note is that person’s, shown as «<employee> · API · <key name>». An integration key with no author gets 409 `author_required`. Scope: `notes:write`.

Параметры
ПолеТипОписание
idstring path · обязательный
Тело запроса
ПолеТипОписание
bodystring обязательныйPlain text, up to 5000 characters
Ответ · 201 · OrganizationNoteDto
curl -X POST "https://api.tygy.ru/v1/organizations/<id>/notes" \
  -H "Authorization: Bearer $TYGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body": "…"}'