Перейти к основному содержимому

API Reference

Полный reference REST endpoints. Все примеры — https://api.reasonspace.ru/api/....

Базовая аутентификация

Bot endpoints (/api/bot/*) принимают:

Authorization: Bot bot_<48hex>

Owner endpoints (/api/bots, /api/bots/{id}/webhooks, etc) принимают Bearer JWT юзера:

Authorization: Bearer <user_jwt>

OAuth endpoints (/api/oauth/*) — Form-encoded с client_id/secret.

Versioning

Все эндпоинты под /api/. Legacy /api/* без /v1/ обслуживается до 27 Nov 2026 (Sunset header). Любые breaking changes выходят как /api/v2/* с 6-месячным deprecation period.

OpenAPI

Скачать openapi.json

Errors

{
"detail": "missing scope: messages.send"
}

Стандартные codes: 200, 201, 204, 400, 401, 403, 404, 422, 429, 500.

Rate limits

См. Rate limits.