API Reference

100% Telegram Bot API compatible. Change the base URL and you're done.

Base URL

https://api.xiachat.com

All endpoints follow the pattern: POST /bot<token>/<method>

Python
bot = Bot(token="xc_...", base_url="https://api.xiachat.com/bot")
Node.js
new TelegramBot(token, { baseApiUrl: "https://api.xiachat.com" })
cURL
curl -X POST https://api.xiachat.com/bot<token>/getMe

Send a text message to a chat. Supports Telegram-compatible reply_markup and XiaChat suggestion chips.

Parameters

NameTypeRequiredDescription
chat_idstringRequiredTarget chat ID
textstringRequiredMessage text
parse_modestringOptionalMarkdown | MarkdownV2 | HTML
reply_markupobjectOptionalTelegram inline keyboard
xiachat_suggestion_chipsstring[]OptionalXiaChat: quick reply chips
xiachat_streambooleanOptionalXiaChat: enable streaming mode
Request Body
{
  "chat_id": "chat_abc123",
  "text": "Based on your SOUL profile, you two have great compatibility! ๐ŸŽฏ",
  "xiachat_suggestion_chips": ["Tell me more", "Show their profile", "Next match"]
}
Response
{
  "ok": true,
  "result": {
    "message_id": "msg_xyz789",
    "chat": { "id": "chat_abc123", "type": "private" },
    "text": "Based on your SOUL profile...",
    "date": 1708444800
  }
}

Webhook Update Format

When a user sends a message to your bot, XiaChat POSTs a Telegram-compatible Update to your webhook URL:

{
  "update_id": 12345,
  "message": {
    "message_id": "msg_abc123",
    "from": {
      "id": "user_xyz",
      "is_bot": false,
      "first_name": "Leo"
    },
    "chat": {
      "id": "chat_abc",
      "type": "private"
    },
    "date": 1708444800,
    "text": "Help me break the ice with my match!",
    "xiachat_context": {                    // โ† XiaChat extension
      "soul_profile": {
        "personalityType": "ENFP",
        "interests": ["hiking", "photography"],
        "communicationStyle": "warm_casual"
      }
    }
  }
}

The xiachat_context field is an extension โ€” it's only included if your bot has soul_access capability.