API
Bot API index
This page is the API directory. JWT methods below include params/returns; open a topic for runtime methods. See “How to call” for auth headers.
How to call
- Quickstart : apply → approval → copy Bot Token.
- Auth : console APIs use account JWT; runtime APIs use
Authorization: Bearer sbot_…。 - API prefix like
https://api.yevlen.com/api/v1(use your gateway; point SDK baseUrl here). - Node SDK / Java SDK wrap HTTP; or call with curl.
# Runtime (Bot Token)
curl -X POST "$API/bots/sendMessage" \
-H "Authorization: Bearer $SOCHAT_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"chat_id":"<chat_id>","text":"hello"}'
# Console (account JWT)
curl -X GET "$API/bots/my" \
-H "Authorization: Bearer $SOCHAT_USER_JWT"Developer console APIs (JWT)
Applications, tokens, webhooks, deliveries — each entry lists params/returns; auth is account JWT.
/api/v1/bots/applicationsapplicationsSubmit bot application
Submit a create application; token is issued only after approval.
- Auth:
Authorization: Bearer <account JWT>(console login; not sbot_ token) - Required:
name(≤100),username(lowercase letter start, a-z0-9_, 3–64, unique) - Optional:
description,avatar(https URL),scopes[](default send/receive) - Returns: bot object with
review_status=pending
/api/v1/bots/mymyList my bots
List bots for the signed-in account (review/runtime status, token prefix).
- Auth: account JWT
- Returns:
{ items: [{ id, name, username, review_status, status, has_token, token_prefix, … }] }
/api/v1/bots/my/:id:idBot details
The first read after approval may return a one-time token. Save it immediately.
- Path:
id - Returns: profile, redacted
webhook,command_menus,has_token/token_prefix - May include
one_time_token(shown once, then destroyed—save immediately)
/api/v1/bots/my/:id/vouchers/templatestemplatesList voucher templates
List the voucher templates currently available to the bot.
- Auth: account JWT; path:
id(bot ID) - The bot must be approved, enabled, and have the
vouchers:readscope - Returns:
{ items: [{ id, externalTemplateId, name, status, issueLimit, issuedCount, … }] }
/api/v1/bots/my/:id/vouchers/templatestemplatesCreate a voucher template
Create a voucher-template draft for the bot. When an application is linked, the draft is saved to that application.
- Auth: account JWT; the bot needs
vouchers:templates:write - Required:
external_template_id,name,type,issuer_name,fulfiller_name,fulfillment_category,acquisition_source,validity, andissue_limit - Current fulfillment categories:
physical_goods,offline_service, andecommerce_discount; returns a draft template
/api/v1/bots/my/:id/vouchers/templates/:templateId/submitsubmitSubmit a voucher template
Submit a draft or rejected voucher template for platform review.
- Auth: account JWT; path:
id(bot ID),templateId(template ID) - The bot needs
vouchers:templates:write - Only
draftorrejectedtemplates can be submitted; status becomesreviewing
/api/v1/bots/my/:id:idUpdate bot profile
Update name, avatar, descriptions, links, inline/friend/privacy settings after approval.
- Path:
id; only whenreview_status=approved - Optional body:
name,avatar,description,short_description,about,cover_url,links,contact - Optional:
supports_inline_queries,friend_request_mode,group_privacy, … usernameis not self-editable; returns updated bot
/api/v1/bots/my/:id/webhookwebhookConfigure webhook
Register an HTTPS webhook with account JWT (no Bot Token).
- Path:
id - Required:
url(https; SSRF-checked) - Strongly required for delivery:
secret_token - Optional:
allowed_updates[],allowed_ips[],max_connections,drop_pending_updates - Sets
delivery_mode=webhook; equivalent Token API:POST /bots/setWebhook
/api/v1/bots/my/:id/webhookwebhookDelete webhook
Removes webhook; delivery mode becomes polling (getUpdates).
- Path:
id - Optional:
drop_pending_updates - Returns
delivery_mode=polling; then usePOST /bots/getUpdates
/api/v1/bots/my/:id/deliveriesdeliveriesDelivery logs
Paginated webhook delivery status including failed / dead_letter.
- Path:
id - Query:
page(default 1),limit(1–100, default 20) - Returns:
{ items, pagination }with delivery status fields
/api/v1/bots/my/:id/regenerate-tokenregenerate-tokenRegenerate token
Old token dies immediately; response one_time_token is shown once.
- Path:
id; requires approved bot - Returns:
{ bot_id, one_time_token, token_prefix }— save immediately
/api/v1/bots/my/:id/metricsmetricsBot metrics
Recent call volume, errors, and quota summary for the developer console.
- Path param:
id(bot id) - Returns: bot runtime metrics summary
/api/v1/bots/my/:id/deliveries/:deliveryId/retryretryRetry delivery
Manually retry a failed (or retriable) webhook delivery.
- Path params:
id(bot id),deliveryId(delivery id or update_id) - Returns: updated delivery status
Runtime APIs by topic
Open a topic for params/returns. All require Authorization: Bearer sbot_…
