Introduction
Ссылки, права доступа и токены публичного виджета amoCRM «Фрейм».
Виджет amoCRM передаёт свой JWT в X-Auth-Token при чтении ссылок и работе администратора. Внешний сайт использует ограниченный frame_token из URL в Authorization: Bearer и проверяет его через GET /api/v1/me и GET /api/v1/access. Общий часовой JWT для списка ссылок выдаёт POST /api/v1/auth/exchange.
Admin REST, ACL, маска {{frame_token}}, версии записей и примеры запросов подробно описаны в контракте проекта.
Authenticating requests
To authenticate requests, include a X-Auth-Token header with the value "{AMO_WIDGET_JWT}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Виджет передаёт штатный JWT amoCRM в X-Auth-Token. Внешний сайт вместо него использует Authorization: Bearer с frame_token из URL. Admin REST принимает только JWT виджета.
Авторизация
auth.exchange — Выдать часовой JWT «Фрейма».
requires authentication
Обмен штатного amoCRM widget JWT из X-Auth-Token на JWT для внешней системы. При первом обращении аккаунта автоматически импортирует старые ссылки.
Example request:
curl --request POST \
"https://frame.makeroi.tech/api/v1/auth/exchange" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/auth/exchange"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"token": "<frame_jwt>",
"token_type": "Bearer",
"expires_in": 3600,
"expires_at": "2026-10-01T12:00:00+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Администрирование
admin.directory.sync — Синхронизировать пользователей и группы amoCRM.
requires authentication
Администраторский метод со штатным widget JWT в X-Auth-Token.
Example request:
curl --request POST \
"https://frame.makeroi.tech/api/v1/admin/directory/sync" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/directory/sync"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"users_synced": 12
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.sessions.revoke — Отозвать действующие frame JWT пользователя.
requires authentication
Укажите ID пользователя amoCRM. Уже выданные JWT перестанут проходить проверку, если их сессии ещё действуют.
Example request:
curl --request POST \
"https://frame.makeroi.tech/api/v1/admin/sessions/revoke" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 123
}"
const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/sessions/revoke"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": 123
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"revoked": 2
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.legacyImport — Резервный импорт старых ссылок.
requires authentication
Используется только до автоматического импорта при первом чтении или обмене JWT. Повторный вызов не создаёт дубликаты.
Example request:
curl --request POST \
"https://frame.makeroi.tech/api/v1/admin/legacy-import" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/legacy-import"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"created": 1,
"existing": 0,
"already_imported": false
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.links.index — Получить все ссылки аккаунта.
requires authentication
Доступно только администратору amoCRM со штатным widget JWT в X-Auth-Token. Включает неактивные ссылки; URL возвращается как сохранённый шаблон.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/admin/links?limit=50&cursor=architecto" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/links"
);
const params = {
"limit": "50",
"cursor": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.links.store — Создать ссылку с правилами доступа.
requires authentication
Передайте HTTPS URL и ACL по ID пользователей и групп amoCRM. Пустой ACL закрывает ссылку для всех, включая администратора.
Example request:
curl --request POST \
"https://frame.makeroi.tech/api/v1/admin/links" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Отчёт\",
\"note\": \"Внутренний отчёт отдела продаж.\",
\"url\": \"https:\\/\\/site.example\\/app#frame_token={{frame_token}}\",
\"open_in_new_window\": false,
\"token_mode\": \"none\",
\"is_active\": true,
\"placement\": \"card_tab\",
\"entity_types\": [
\"contacts\"
],
\"access_mode\": \"assigned\",
\"append_entity_id\": false,
\"append_manager_id\": false,
\"access\": {
\"users\": [
16
],
\"groups\": [
22
]
}
}"
const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/links"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Отчёт",
"note": "Внутренний отчёт отдела продаж.",
"url": "https:\/\/site.example\/app#frame_token={{frame_token}}",
"open_in_new_window": false,
"token_mode": "none",
"is_active": true,
"placement": "card_tab",
"entity_types": [
"contacts"
],
"access_mode": "assigned",
"append_entity_id": false,
"append_manager_id": false,
"access": {
"users": [
16
],
"groups": [
22
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.links.order — Изменить порядок всех ссылок.
requires authentication
Массив ids должен включать все неудалённые ссылки аккаунта. Операция увеличивает version каждой ссылки.
Example request:
curl --request PUT \
"https://frame.makeroi.tech/api/v1/admin/links/order" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": [
\"architecto\"
]
}"
const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/links/order"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": [
"architecto"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.links.show — Получить ссылку для редактирования.
requires authentication
Возвращает сохранённый шаблон URL, ACL и version для If-Match.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/admin/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.links.update — Обновить ссылку.
requires authentication
Принимает подмножество полей создания. Требует If-Match со значением version из последнего ответа: 428 при отсутствии, 409 при конфликте.
Example request:
curl --request PATCH \
"https://frame.makeroi.tech/api/v1/admin/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "If-Match: 1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Отчёт\",
\"note\": \"Внутренний отчёт отдела продаж.\",
\"url\": \"https:\\/\\/site.example\\/app#frame_token={{frame_token}}\",
\"open_in_new_window\": false,
\"token_mode\": \"none\",
\"is_active\": true,
\"placement\": \"card_tab\",
\"entity_types\": [
\"leads\"
],
\"access_mode\": \"assigned\",
\"append_entity_id\": false,
\"append_manager_id\": false,
\"access\": {
\"users\": [
16
],
\"groups\": [
22
]
}
}"
const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"If-Match": "1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Отчёт",
"note": "Внутренний отчёт отдела продаж.",
"url": "https:\/\/site.example\/app#frame_token={{frame_token}}",
"open_in_new_window": false,
"token_mode": "none",
"is_active": true,
"placement": "card_tab",
"entity_types": [
"leads"
],
"access_mode": "assigned",
"append_entity_id": false,
"append_manager_id": false,
"access": {
"users": [
16
],
"groups": [
22
]
}
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
admin.links.destroy — Удалить ссылку.
requires authentication
Мягкое удаление. Требует If-Match с текущей version; успех — 204 без тела.
Example request:
curl --request DELETE \
"https://frame.makeroi.tech/api/v1/admin/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "If-Match: 1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/admin/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"If-Match": "1",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Доступ к ссылкам
user.me — Узнать пользователя по JWT.
requires authentication
Принимает widget JWT в X-Auth-Token или frame JWT в Authorization: Bearer. JWT из URL ссылки также подходит для этого метода.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/me" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/me"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"token_valid": true,
"account_id": 123,
"user": {
"id": 456,
"name": "Иван",
"is_admin": false
},
"link": {
"id": "11111111-1111-4111-8111-111111111111",
"allowed": true,
"url_template": "https://site.example/app#frame_token={{frame_token}}"
},
"group_access_verified": true,
"expires_at": "2026-11-23T12:00:00+00:00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
links.tokenAccess — Проверить ссылку, указанную в frame_token.
requires authentication
Метод для внешнего сайта: передайте JWT из URL в Authorization: Bearer. UUID берётся из токена. Общий JWT и widget JWT здесь не подходят.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/access" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/access"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": "11111111-1111-4111-8111-111111111111",
"allowed": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
links.index — Получить доступные ссылки пользователя.
requires authentication
Возвращает только активные ссылки с подтверждённым доступом. Требуется widget JWT или общий frame JWT с областью links:read; JWT из URL одной ссылки не позволяет получить список.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/links?limit=50&cursor=architecto" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/links"
);
const params = {
"limit": "50",
"cursor": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
links.show — Получить одну доступную ссылку.
requires authentication
URL в ответе уже содержит JWT конкретной ссылки, если задана маска {{frame_token}} или режим fragment. Чужая или отсутствующая ссылка даёт 404.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
links.access — Проверить доступ к ссылке по UUID.
requires authentication
Возвращает allowed=false для недоступной или отсутствующей ссылки. JWT из URL может проверять только собственную ссылку.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc/access" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://frame.makeroi.tech/api/v1/links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc/access"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": "11111111-1111-4111-8111-111111111111",
"allowed": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Карточки AmoCRM
cardLinks.index — Доступные вкладки и правые блоки карточки.
requires authentication
URL не выдаётся до POST /card-links/{id}/resolve. Типы карточек: leads, contacts, companies, customers.
Example request:
curl --request GET \
--get "https://frame.makeroi.tech/api/v1/card-links?entity_type=leads&limit=50&cursor=architecto" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"entity_type\": \"architecto\"
}"
const url = new URL(
"https://frame.makeroi.tech/api/v1/card-links"
);
const params = {
"entity_type": "leads",
"limit": "50",
"cursor": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"entity_type": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
cardLinks.resolve — Собрать URL карточки на backend.
requires authentication
entity_id и fields передаются виджетом как отображаемый контекст, но не подтверждают права на конкретную карточку. Идентичность пользователя и доступ к ссылке проверяются сервером. URL возвращается с frame_token.
Example request:
curl --request POST \
"https://frame.makeroi.tech/api/v1/card-links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc/resolve" \
--header "X-Auth-Token: {AMO_WIDGET_JWT}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"entity_type\": \"leads\",
\"entity_id\": 987654,
\"fields\": {
\"123456\": \"ORD-1042\"
}
}"
const url = new URL(
"https://frame.makeroi.tech/api/v1/card-links/BcECdBDA-CdED-bFEA-CbCE-BcCdeBfbbebc/resolve"
);
const headers = {
"X-Auth-Token": "{AMO_WIDGET_JWT}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"entity_type": "leads",
"entity_id": 987654,
"fields": {
"123456": "ORD-1042"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.