API Reference
Programmatic access to cThrone features. All requests must be authenticated.
Why Use the API?
cThrone provides a set of APIs that enable your bots to leverage custom functionality without building it yourself. These APIs handle common features that you would otherwise need to implement and maintain on your side.
Global Bot Config
Manage global settings like maintenance mode, feature flags, or support contacts dynamically.
Store Subscriber Data
Save user balances, preferences, subscription levels, and any custom data — no database setup required.
Focus on Bot Logic
Skip building data layers and admin panels. Just call our API and focus on your bot's core features.
Interact with the API by sending HTTP requests to your bot's unique URL, always authorized with your token.
All API requests must be authenticated using your bot token from the platform. For Telegram bots, this is the token you received from @BotFather.
Authorization: Bearer YOUR_BOT_TOKENAlternative: You can also pass the token via the X-Bot-Token header.
Store and retrieve global configuration for your bot. This data is available to your bot instance regardless of the user context.
Example Use Cases:
- Feature Flags — Enable or disable specific bot features globally
- Maintenance Mode — Temporarily disable bot interactions during updates
- Support Contact — Store current support email or channel link
- Welcome Message — Customize the greeting message without redeploying code
- Default Settings — Set global defaults for language or timezone
/api/v1/bot/custom-configGet the current custom configuration for the bot.
{
"maintenanceMode": false,
"defaultLanguage": "en",
"supportEmail": "support@example.com",
"welcomeMessage": "Hello! How can I help you?"
}/api/v1/bot/custom-configReplace the bot's custom configuration. This overwrites existing configuration.
{
"maintenanceMode": true,
"defaultLanguage": "es",
"supportEmail": "contact@example.com",
"welcomeMessage": "Hola! En qué puedo ayudarte?"
}Custom Fields allow you to store arbitrary data about each subscriber of your bot. This is useful for persisting user-specific information without setting up your own database.
Example Use Cases:
- User Balance — Store virtual currency or credits for each user
- Subscription Level — Track premium, gold, or free tier status
- User Preferences — Save language settings, notification preferences, or themes
- Game Progress — Persist scores, levels, or achievements
- Custom Notes — Add admin notes or tags for CRM purposes
/api/v1/subscribers/:platformUserId/custom-fieldsRetrieve all custom fields for a specific subscriber.
platformUserIdThe user ID from the platform (e.g. Telegram User ID like 123456789){
"balance": 150,
"subscriptionLevel": "gold",
"language": "en",
"notifications": true
}/api/v1/subscribers/:platformUserId/custom-fieldsReplace all custom fields for a subscriber. This overwrites existing fields with the new data.
{
"balance": 150,
"subscriptionLevel": "gold",
"language": "en",
"notifications": false
}Note: This is a full replacement. To update a single field, first GET the current fields, modify the value, then PUT the complete object.
