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.sochatlive.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
First read after approval may return one_time_token (destroyed after read, Redis TTL 7d).
- 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: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: metrics summary object (fields evolve with the console)
/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_…
