Skip to documentation
Developer documentation

Build on Telestars.

Bring your agency into your own app, dashboard or AI tools. Use the available Telestars API operations with no API surcharge.

Quickstart

Choose REST for your application, or MCP for an AI assistant. Both access the same agency and share its usage limits.

Your app · REST API

Create a key, keep it on your server, and request the data your app needs.

Your AI tools · MCP

Add the server URL, sign in and choose permissions. No API key to paste into a prompt.

  1. Create your key

    Open Settings → Developer → API Keys, or Billing → API Key. Name the key, choose its expiration and keep only the permissions you need. Start with Read bots and Read statistics.

  2. Save it on your server

    Copy the key once into your server’s secret manager as TELESTARS_API_KEY. It cannot be shown again. Never put it in frontend code, a URL or an AI prompt.

  3. Read your bots

    Copy the Base URL shown in your API Keys panel. Send your key in the Authorization header and use a returned bot ID for reports or actions.

First request
curl --fail-with-body \
  --header "Authorization: Bearer $TELESTARS_API_KEY" \
  "https://telestars-backend.onrender.com/api/v1/bots?limit=50"
List response
{
  "result": {
    "data": [
      {
        "id": "<BOT_ID>",
        "display_name": "My creator",
        "bot_username": "my_creator_bot"
      }
    ],
    "next_cursor": null
  },
  "request_id": "<REQUEST_ID>",
  "usage_recorded": true,
  "billing": {
    "status": "included",
    "charged_usd": 0
  }
}

Build a reporting dashboard

Read each bot’s summary and daily history for your date range, then combine the results in your dashboard. Revenue is returned in Stars. Missing historical evidence is returned as null, not invented.

Statistics example
curl --fail-with-body --get "https://telestars-backend.onrender.com/api/v1/analytics/summary" \
  --header "Authorization: Bearer $TELESTARS_API_KEY" \
  --data-urlencode "bot_id=<BOT_ID>" \
  --data-urlencode "from=2026-10-01" \
  --data-urlencode "to=2026-10-14" \
  --data-urlencode "timezone=Europe/Paris"

MCP & OAuth

Connect an MCP client that supports Streamable HTTP and OAuth with dynamic client registration. Your permissions control exactly which tools it can use.

  1. Copy the server URL

    Open Settings → Developer → MCP. Copy the MCP server URL and add it as a custom connector in your AI tool.

  2. Authorize your agency

    Sign in to Telestars, select your agency and review the requested permissions. Write permissions are off by default. The client registers automatically; no client secret is required.

  3. Ask your first question

    Try: “Which bots can I access?” Then ask for a report over a specific period. Revoke the connection at any time in Connected tools.

MCP server URL
https://telestars-backend.onrender.com/api/mcp
Codex CLI
codex mcp add telestars --url "https://telestars-backend.onrender.com/api/mcp"
codex mcp login telestars
Cloud clients such as Claude and ChatGPT need a publicly reachable HTTPS server. A localhost URL works only with a client running on your computer.
OAuth for custom integrations

Discovery is available at /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource/api/mcp. Use authorization code with S256 PKCE, an exact registered callback URL and the full resource URL as the audience. REST tokens use /api/v1; MCP tokens use /api/mcp. They are not interchangeable.

Access tokens last 15 minutes. Refresh tokens rotate and allow renewal for up to 30 days. Serialize refresh requests: reusing an old refresh token revokes the connection. Advanced OAuth settings also support registering a client manually.

Authentication & permissions

Every key and OAuth connection belongs to one agency. Only agency owners and admins can create or revoke access. A key never grants access to another agency, even when a bot or conversation ID is supplied.

Use separate keys for separate applications. Start with read access, add write permissions only when needed, set an expiration and revoke keys you no longer use.
bots:readRead bots
bots:settings:readRead bot settings
bots:settings:writeChange bot settings
creators:readRead creator profiles
creators:writeChange creator profiles
voices:readRead bot voice settings and presets
voices:writeChange bot voice settings and presets
analytics:readRead statistics
fans:readRead top spenders
conversations:readRead conversation details
fans:writeChange fan display names and tags
messages:readRead message content
messages:writeSend manual text messages
bots:writeChange bot display names
tracking:readRead tracking links
tracking:writeRename tracking links
team:readRead team performance
team:members:readRead team members, invitations and schedules
team:manageManage team members, invitations and schedules
scripts:readRead scripts and steps
scripts:writeCreate script drafts and rename scripts
scripts:manageEdit steps and activate scripts (may resume AI)
offers:writeCreate and edit AI Offers
media:sendSend free and paid media to fans
gallery:readRead media, albums and AI Offers
gallery:writeUpload media and organize albums
ai:generateGenerate AI replies without sending
ai:runRun AI on existing conversations (may send messages)
ai:manageEnable or disable bot AI

Bot settings & media

Use separate permissions for bot settings, Creator Information and Voice Presets. Send only the fields you want to change inside changes; omitted fields keep their current values.

Bot settings example
curl --fail-with-body --request PUT "https://telestars-backend.onrender.com/api/v1/bots/configuration" \
  --header "Authorization: Bearer $TELESTARS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"bot_id":"<BOT_ID>","idempotency_key":"<NEW_REQUEST_UUID>","changes":{"delivery_speed":"fast","allow_standard_emojis":true}}'

Bot settings updates use the app’s validation. They cannot enable or disable AI, change the Telegram identity or set provider credentials. Creator Information uses its own endpoint; changing it does not rewrite Voice.

Create a custom Voice Preset with its name and prompt, then select it through the activation endpoint. Built-in presets cannot be edited or deleted. Selecting a voice does not enable AI or send a message.

Upload media in three steps

  1. Prepare the files

    Call /gallery/uploads/prepare with one bot and 1–10 files. Keep the returned upload_request_id and complete_request_id. Each signed upload URL expires after 10 minutes.

  2. Upload the file bytes

    From your own application, PUT each file to its signed URL with the returned headers. Do not send your Telestars API key to that URL. MCP prepares and completes uploads; the client transfers the files.

  3. Complete and check readiness

    Call /gallery/uploads/complete with upload_request_id and use complete_request_id as idempotency_key, with the same credential. Inspect the receipt after an uncertain outcome. Accepted media may still need Telegram preparation or gallery analysis; check processing-status before delivery.

The API covers the operations listed below, not every feature in the Telestars app. Telegram account authentication and bot provisioning remain experimental. Billing management and TeleFans management are not covered by this reference.

AI & automation

Separate permissions control AI drafts, conversation processing and the bot’s AI switch. Grant only the capabilities your integration needs.

Generate a draft

ai:generate

Generate text with a bot’s persona and supplied history. Nothing is sent to a fan and the conversation does not advance.

Process a conversation

ai:run

Queue an existing pending batch. Normal Telestars rules still apply, including takeover and payment guards. Processing can send messages to the fan.

AI draft example
curl --fail-with-body --request POST "https://telestars-backend.onrender.com/api/v1/ai/replies" \
  --header "Authorization: Bearer $TELESTARS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"bot_id":"<BOT_ID>","message":"Hello!","idempotency_key":"<NEW_REQUEST_UUID>"}'

To process an existing conversation, first list its pending batches, then call /ai/conversations/run with bot_id, conversation_id, batch_id and a new idempotency_key. Read the corresponding request status instead of submitting a second action.

Enable or disable bot AI

ai:manage

Read /bots/ai/status, then change the switch through /bots/ai/activation. Enabling follows the app’s wallet, script and Telegram prerequisites and may resume eligible pending conversations. Human takeovers remain protected. A saved switch does not confirm that a reply was delivered.

AI activation example
curl --fail-with-body --request PUT "https://telestars-backend.onrender.com/api/v1/bots/ai/activation" \
  --header "Authorization: Bearer $TELESTARS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"bot_id":"<BOT_ID>","idempotency_key":"<NEW_REQUEST_UUID>","enabled":true}'

After an uncertain result, read /bots/ai/requests with the same idempotency_key before retrying. Status reads show the saved switch and disabled reason; they do not run readiness checks or probe Telegram.

Sending text or media and activating scripts can affect real fans. Grant those permissions deliberately. The API preserves the app’s validation, billing and delivery rules.

The reference below covers scripts, steps, Offers, media delivery, albums, conversations, fans, tracking and team reports. Telegram account authentication and managed bot creation are still experimental and are not part of this public reference.

Team management

Use team:members:read to read members, invitations, bot assignments, shifts and schedules. Use team:manage for changes. These permissions are separate from team:read, which only reads performance reports.

Team operations keep the app’s Pro subscription and role checks. Creating an invitation can send the normal invitation email. The invited person must accept it through the usual sign-in flow; API access cannot accept on their behalf.

Removing a member marks their membership as removed, clears assignments and removes agency access. The membership history and user account are preserved. Changing the role cannot restore a removed membership. Inspect the action receipt before retrying.

Pricing & limits

API and MCP included

No API subscription, per-call fee or MCP surcharge. Normal bot subscriptions, sales commissions and provider charges follow the same rules as in the app. AI is never charged a second time because it was called through the API.

All keys and MCP connections share one rolling 60-second allowance for the agency, based on its highest active subscription. Adding keys does not multiply the limit.

Usage limits by subscription
SubscriptionCalls / 60 secondsConcurrent calls
Free202
Starter605
Pro12010

At capacity, follow Retry-After. There is no paid overage. Large agencies can request a higher limit after capacity validation, without an API surcharge.

Reports require one bot, at most 90 inclusive days and at most 100,000 deliveries. Split larger ranges and combine the results in your application.

Pagination, retries & errors

Page through results

Lists return result.data and result.next_cursor. Pass the cursor as after until it is null. Each page uses one call. UUID pagination is not chronological order; sort script steps by step_index and album items by position.

Retry safely

Create one UUID idempotency_key for each new write or AI action. Reuse the same UUID and identical parameters after a network failure. Never use a new UUID to retry an uncertain send. Read its request receipt first; a queued action is not proof of delivery.

HTTP errors
StatusWhat to do
400Check the parameters against the request schema.
401Check whether your credential is missing, expired or revoked.
402This app action requires wallet funds. API access itself is included.
403Check the agency, resource audience and required permissions.
409Inspect the request status or resolve conflicting parameters before retrying.
429Wait for the delay in Retry-After before retrying.
503The service is temporarily unavailable. Retry reads with backoff; inspect write receipts first.

MCP tool failures may arrive with HTTP 200 and isError: true. Inspect the tool result, including retry_after_seconds for capacity errors. Keep request_id when contacting support. Never share your API key.

API reference

81 public operations, generated from the current API contract.

OpenAPI JSON
GET/api/v1/bots/ai/status
PUT/api/v1/bots/ai/activation
GET/api/v1/bots/ai/requests
GET/api/v1/team/members
GET/api/v1/team/invitations
GET/api/v1/team/members/schedule
GET/api/v1/team/audit-log
POST/api/v1/team/invitations/create
POST/api/v1/team/invitations/resend
POST/api/v1/team/invitations/revoke
PUT/api/v1/team/members/role
POST/api/v1/team/members/remove
PUT/api/v1/team/members/bots
PUT/api/v1/team/members/creators
PUT/api/v1/team/members/schedule
GET/api/v1/team/requests
GET/api/v1/bots/configuration
PUT/api/v1/bots/configuration
GET/api/v1/bots/creator-information
PUT/api/v1/bots/creator-information
GET/api/v1/bots/voice-presets
POST/api/v1/bots/voice-presets/create
PUT/api/v1/bots/voice-presets/update
PUT/api/v1/bots/voice-presets/delete
PUT/api/v1/bots/voice-presets/activation
GET/api/v1/bots/configuration/requests
GET/api/v1/bots/creator-information/requests
GET/api/v1/bots/voice-presets/requests
POST/api/v1/gallery/uploads/prepare
POST/api/v1/gallery/uploads/complete
GET/api/v1/gallery/uploads/requests
GET/api/v1/gallery/media/processing-status
POST/api/v1/scripts/steps/create
PUT/api/v1/scripts/steps/update
PUT/api/v1/scripts/steps/delete
PUT/api/v1/scripts/steps/order
PUT/api/v1/scripts/activation
PUT/api/v1/gallery/offers/save
POST/api/v1/conversations/media/free
POST/api/v1/conversations/media/paid
GET/api/v1/scripts/requests
GET/api/v1/gallery/offers/requests
GET/api/v1/conversations/media/requests
GET/api/v1/scripts
GET/api/v1/scripts/detail
GET/api/v1/scripts/steps
POST/api/v1/scripts/drafts
PUT/api/v1/scripts/title
GET/api/v1/gallery/media
GET/api/v1/gallery/media/detail
GET/api/v1/gallery/albums
GET/api/v1/gallery/albums/items
POST/api/v1/gallery/albums/create
PUT/api/v1/gallery/albums/name
PUT/api/v1/gallery/albums/membership
GET/api/v1/gallery/offers
GET/api/v1/gallery/offers/detail
POST/api/v1/conversations/messages/send
GET/api/v1/conversations/messages/requests
GET/api/v1/creators
GET/api/v1/conversations/messages
GET/api/v1/fans/lifetime
GET/api/v1/sales
GET/api/v1/paid-media
GET/api/v1/tracking-links/report
GET/api/v1/team/report
PUT/api/v1/bots/display-name
PUT/api/v1/fans/tags
POST/api/v1/ai/replies
POST/api/v1/ai/conversations/run
GET/api/v1/ai/conversations/batches
GET/api/v1/ai/conversations/requests
GET/api/v1/ai/requests
GET/api/v1/bots
GET/api/v1/analytics/summary
GET/api/v1/analytics/daily
GET/api/v1/fans/top-spenders
GET/api/v1/conversations
PUT/api/v1/fans/display-name