Reseller API
The standard reseller-panel API: one endpoint, a key, an action, and JSON responses. Add tgfather as a provider and resell Telegram Stars, Premium, Sessions, Aged channels, and Ads.
| Endpoint | https://tgfather.com/api/v2 |
|---|---|
| HTTP method | POST · form-encoded params |
| Auth | key=<your key> in the POST body (or Authorization: Bearer <key>). Never put the key in the URL query — it leaks into access logs and is rejected. |
| Response | JSON |
| Currency | USD · charged to your wallet balance |
| Spec | OpenAPI 3.1 (import into Postman or a client generator) · llms.txt · free sandbox key |
Charge: charge = rate × quantity / 1000. Per-unit products (Premium) set rate = unit price × 1000, so one order costs rate / 1000.
Never pay twice: send your own idempotency_key with every add. If a request times out, send it again with the same key, or look the order up by that key with status. See Safe retries.
POST /api/v2 · action=services
Every service with its id, name, price (rate, per 1,000), min/max and a short desc. Service ids are fixed and permanent. A sold-out service stays in the list with "max": "0" at its last price, so your mapping and markup survive until it restocks; an add for it answers out_of_stock. The response carries an ETag; send it back as If-None-Match and you get 304 Not Modified with no body while the list is unchanged. The rate is exactly what you are charged: for Telegram Ads it already includes our service fee (charge = quantity × rate / 1000).
POST /api/v2 · action=add
Places an order. Debits your wallet immediately and returns a short random order code (e.g. Kp3m9x) to poll with status. The code — not a sequential number — is your order handle everywhere.
| Parameters | Description |
|---|---|
| service | Service id from services |
| link | Target: the recipient @username / profile link (Stars, Premium, Aged, Ads) |
| quantity | Amount: # of Stars / accounts, or 1 for a per-unit product |
| idempotency_key | Recommended. Your own unique id for this purchase, 1–64 chars of A–Z a–z 0–9 _ - (e.g. your internal order id). Sending the same key again never charges twice: it returns the original order. client_reference is accepted as an alias. |
replayed: true means this request matched an earlier one with the same key: you get the original order and nothing new is charged.
POST /api/v2 · action=status
Returns the state of one order (order=CODE), several (orders=Kp3m9x,Rt7bw2, up to 100), or the order you placed with a key (idempotency_key=po-10442). Besides the standard fields, every order carries a machine-readable state and next_action (see Order statuses). Sessions and Aged include a result with the download / invite.
orders=Kp3m9x,Rt7bw2,nope12idempotency_key=po-10442Same object as above. If no order exists for that key you get error_code: "order_not_found" with charged: false: nothing was charged under it, and sending the add again with the same key is safe.
POST /api/v2 · action=orders
Your order history, newest first, with the same object status returns. Use it to reconcile: every order carries our order code and your idempotency_key.
| Parameters | Description |
|---|---|
| limit | Optional. Orders per page, 1–100 (default 50). |
| after | Optional. The next value from the previous page. |
| from / to | Optional. Creation time range: unix seconds, RFC 3339, or YYYY-MM-DD (UTC, whole day). |
| service | Optional. Only this service id. |
| recipient | Optional. Only orders for this @username. |
| status | Optional. A status (Completed, In progress, Canceled, Partial) or a state (awaiting_join, transferred, refunded, …). |
Pass after=<next> to get the following page. next is null on the last page.
POST /api/v2 · action=cancel
Cancels orders and refunds them in full to your balance. Services that allow it say "cancel": true in services: Aged Telegram Hub until the recipient claims the chat (state sourcing, awaiting_join or awaiting_start), and Telegram Ads until the ad goes live (queued, in_review or declined). After that the order can't be cancelled.
With a single order=Mx2pQ7 the answer is {"cancel": 1} or an error object. No service offers refills: action=refill and refill_status answer with error_code: "refill_not_supported".
POST /api/v2 · action=check
Checks, without charging, whether link can receive service: Premium and Aged need a personal account; Stars a personal account or a channel; Ads a public channel or bot. Use it to validate your buyer's @username before you take their money. add runs the same check for Stars, Premium and Aged, so a bad recipient fails with nothing charged. For Ads, check is advisory: add doesn't verify the link.
| Field | Meaning |
|---|---|
valid | true = an add with this link would be accepted. |
verified | false when Telegram could not confirm the username either way; it is then treated as valid. |
recipient_type | user · bot · chat (channel or group) · not_found · unknown · invalid · not_required (sessions) |
error_code | When valid is false: recipient_not_found, recipient_not_a_person or invalid_link. |
POST /api/v2 · action=quote
Returns what an add of quantity × service would charge right now, without placing it. quantity in the answer is what the charge covers: for sessions it can be lower than asked when stock is short. It is the current price, not a reservation: prices and stock can move before you order.
POST /api/v2 · action=balance
Returns your spendable wallet balance.
POST /api/v2 · action=statement
Every movement of your balance, newest first, to reconcile against your own books: deposits, order charges, refunds and adjustments. Movements that belong to an API order carry its order code.
| Parameters | Description |
|---|---|
| limit | Entries per page, 1–100 (default 50) |
| from / to | Date range: unix timestamp, RFC3339 or YYYY-MM-DD (a bare to date includes that whole day) |
| after | The next value of the previous page |
type is deposit, charge, refund or adjustment; amount is signed (negative = money out). next is absent on the last page.
POST /api/v2 · action=webhook
Register one HTTPS URL and we POST to it every time one of your orders changes state, so you don't have to poll. Polling status / orders still works and is the way to recover anything you missed.
| Parameters | Description |
|---|---|
| url | Your public https:// endpoint. Setting it again replaces the URL and issues a new secret. |
| delete | 1 removes the webhook. |
The secret is shown only here: store it. Calling action=webhook with no url shows the current URL.
Verify the signature: compute HMAC-SHA256 with your secret over <X-TGF-Timestamp>.<raw body> and compare it to the hex after sha256=. Reject a timestamp more than 5 minutes old.
Answer any 2xx within 10 seconds. Otherwise we retry with growing gaps (30 s up to 1 h, 12 tries). Deliveries can repeat, so key your handling on order + state. Orders from the 3 days before you register are included.
| action | What it does |
|---|---|
webhook_test | Sends a signed {"event": "ping"} to your URL now and returns delivered, status_code, duration_ms (and error: dns_error, blocked_address, timeout, tls_error, connection_failed, request_failed or HTTP nnn). |
webhook_resend | order=CODE: sends that order's current state now, the same way. |
webhook_log | Your recent delivery attempts, newest first (limit 1–100, default 20; kept 7 days): event, order, state, delivered, status_code, error, sent_at. |
Telegram notices: if your account is linked to Telegram, each order's outcome is also sent there by our bot: the session ZIP, the Aged invite, and a one-line notice when Stars or Premium are delivered, an ad finishes, or an order is refunded.
No code at all? Open your own Telegram shop bot, connected to this API, in a few minutes: see the guide.
POST /api/v2 · action=ticket_create and more
Open and answer support tickets with your API key, for yourself or for your own customers. Our support team answers them, and you read the answers with ticket_get. Available once your account has at least one successful deposit.
Give each of your customers a customer_ref (your own id for them, up to 64 letters, digits and _ . : -). Each customer can have one open ticket at a time; a second ticket_create for the same customer answers ticket_already_open with that ticket's number, so you can add to it with ticket_reply. Answers never mention us, so you can show them to your customer as they are.
| action | Parameters | What it does |
|---|---|---|
ticket_create | message (max 2000), subject (optional), customer_ref (optional) | Opens a ticket. Without a subject, the start of the message is used. |
ticket_reply | ticket, message | Adds a message to an open ticket. |
ticket_list | customer_ref, status (open/closed), since, limit (1–100), after | Your tickets, newest first. since returns only tickets updated after that time, so you can poll for new answers cheaply. |
ticket_get | ticket | One ticket with its whole thread. |
last_sender is support when we answered last and customer when you did. A ticket with no activity for 7 days closes by itself; a closed ticket refuses ticket_reply (ticket_closed), so open a new one. Sandbox keys can't use tickets.
Telegram Accounts live
Ready-to-use accounts, one service per country and age band (e.g. Indonesia · 1-2 years). quantity = number of accounts; link unused. Delivery is ZIP-only: the order's status returns one bundle ZIP for the whole batch.
Pricing is automatic: the rate is the best live price for that (country, age), refreshed as stock moves, so there is no fixed price list to maintain. max is the live quantity available; a sold-out SKU drops off the list until it restocks, and its id never changes. Session ids start at 10, one per (country, age band), category Telegram Sessions:
services listlink unused)If stock is lower than ordered, status returns Partial and only the shipped quantity is charged. Web store: /telegram-accounts.
The bundle is one ZIP for the whole batch, each account under sessions/ (Telethon) + tdata/ (Telegram Desktop). The url is token-scoped — the random token is the credential, so a panel that stores a bare URL fetches it with no header: curl -O <url>.
Aged Telegram Hub live
Aged Telegram channels, groups, and bots, one service per kind and creation year (type Poll). You pick the year; we deliver a chat of exactly that kind and year. Only years in stock are listed in services. Order quantity = 1 and set link to the buyer's @username; the chat is transferred to that user. Category Aged Telegram Hub.
| Service | Kind |
|---|---|
9000 + year − 2000 | Aged bot (e.g. 9025 = 2025) |
9100 + year − 2000 | Aged group (e.g. 9124 = 2024) |
9200 + year − 2000 | Aged channel (e.g. 9226 = 2026) |
Optional owner country: pass answer_number = a country (US, germany, or a dial like +1) to prefer a chat owned in that country. Leave it blank / anything unrecognized and we pick any in-stock country.
Delivery: the buyer joins a private invite, then ownership transfers. This happens automatically once they join — polling status is enough. The confirm action just triggers the transfer sooner and is optional.
answer_number)Bots work the same, except the recipient opens the bot and taps Start (state: "awaiting_start", next_action: "recipient_start_bot") and result.chat_username holds the bot's @username. The recipient has until claim_deadline (3 days); after that the order closes as expired_unclaimed without a refund.
You don't have to call confirm — once the buyer joins, we transfer ownership automatically and status flips to Completed. Web store: /telegram-aged-channels-groups-robots.
Telegram Stars live
One service. link = recipient @username or profile link; quantity = number of Stars (min 50). rate is per 1,000.
| Service | Product |
|---|---|
1 | Telegram Stars |
Telegram Ads live
Official Telegram Sponsored Messages, placed for you under the agency model: you resell ad placements and never manage an ad account yourself.
| Service | Product |
|---|---|
5 | Telegram Ads |
Ads order like every other service — send only service, link and quantity and we fill the rest with sane defaults you can refine. Each order is reviewed before it is submitted to Telegram, so a default draft never runs unchecked. Override any field below to take full control:
| Field | Required | Meaning |
|---|---|---|
link | required | Destination: the public @channel, bot or t.me link the ad promotes |
quantity | required | Initial budget in whole USD (charged from your balance; min 5, max 5000) |
cpm | optional | Bid: USD price per 1,000 views (Telegram runs an auction; a higher CPM wins more impressions). Defaults to $1.50 if omitted. Telegram's floor applies at placement. |
ad_title | optional | Ad title (≤ 40 chars, shown in the sponsored card). Auto-written from your destination if omitted. |
ad_text | optional | Ad text / message (≤ 160 chars, one line: no line breaks, shorteners or banned verticals). Auto-written if omitted. |
target | optional | Comma list of channels to show the ad in (public, 1,000+ subscribers). Omit it and we auto-scan relevant public channels for you from what you promote. |
Total price. You are charged quantity plus our flat service fee: total = quantity × (1 + fee_pct/100). The service's rate in services already includes the fee (rate = 1000 × (1 + fee_pct/100)), so the standard quantity × rate / 1000 gives the total. The exact total debited is returned as charge (USD) in the add response.
We place the ad for you. Your budget is refundable until it is submitted to Telegram; after that it is final. Poll action=status for the state (queued, in review, active / declined). Every ad must pass Telegram's advertising policy.
Keys & IP allowlist
Besides your primary key (account page), you can create up to 10 named extra keys, for example one per server or a read-only key for reporting. A read-only key can call services, status, orders, check, quote, balance, statement and webhook_log; anything else answers key_read_only. Keys are managed with the primary key only.
| action | Parameters | Result |
|---|---|---|
key_create | name (optional), read_only=1 (optional) | The new key, shown once, with its id |
keys | none | Your extra keys (id, name, prefix, read_only, last_used_at) and allowed_ips |
key_revoke | id | {"revoked": 1} |
ip_allowlist | ips=203.0.113.4,198.51.100.0/24 or clear=1 | The saved allowed_ips |
With an allowlist set, every key of the account (primary, extra and test) only works from those IPs/CIDRs (max 20); other addresses get ip_not_allowed. The list must include the IP you set it from, so a typo can't lock you out.
Sandbox (test key)
Build and test your integration without spending. Create a test key with your primary live key; it starts with tgfather_test_ and replaces any previous test key.
With the test key every action works as live, against a separate sandbox account: services, check and quote return real data; add validates and prices exactly like live but charges nothing and buys nothing; the order then moves through its real states on a fast clock (Stars/Premium deliver in ~40 s, Aged transfers in ~2 min with a placeholder invite, Ads run for ~3 min, Sessions complete in ~20 s with a placeholder link). status, orders, cancel and webhook behave as live, and every sandbox order carries "sandbox": true. balance is always 1000.00; statement is empty. Sandbox and live orders never see each other, and a webhook registered with the test key only receives sandbox orders.
| link | Sandbox result |
|---|---|
@sandbox_not_found | add fails: recipient_not_found |
@sandbox_bot | add fails: recipient_not_a_person (Ads: invalid_link) |
@sandbox_out_of_stock | add fails: out_of_stock |
@sandbox_refund | The order is refunded after ~30 s |
| any other @username | The order completes |
Safe retries
A timeout or an unreadable answer to add doesn't tell you whether the order was placed. With an idempotency_key you never have to guess:
- Give every purchase its own key (your internal order id works well) and send it with
add. - If the answer is lost, send the same
addwith the same key. If the first one went through you get that order back (replayed: true) and nothing is charged again. If it didn't, the order is placed now. - Or look it up first:
action=status&idempotency_key=….order_not_foundwithcharged: falsemeans nothing was charged under that key;order_pending_recordwithcharged: truemeans it was, and step 2 returns the order.
A key belongs to one purchase forever: reusing it for a different order returns the first order instead of buying again. Without a key, only an identical request repeated within 2 minutes is recognised as a retry. Orders placed before you used keys can be matched with order history.
Order statuses
The status field uses the standard reseller vocabulary.
| Status | Meaning |
|---|---|
| In progress | Being fulfilled. |
| Completed | Delivered. Sessions carry the result link. |
| Partial | Fewer delivered than ordered; you're charged only for what shipped. |
| Canceled | Not delivered, refunded to your wallet. |
state says exactly what is happening, and next_action says who has to act.
| state | status | Meaning |
|---|---|---|
processing | In progress | Sessions: being fulfilled. |
completed | Completed | Sessions: delivered. Ads: the budget is fully spent. |
queued | In progress | Stars / Premium: waiting to be sent. Ads: waiting for review. Ads can still be cancelled. |
sending | In progress | Stars / Premium: being sent to the recipient. |
on_hold | In progress | Stars / Premium: delivery is delayed and our team is on it (error_code: delivery_delayed). It completes or is refunded in full; nothing for you to do. |
delivered | Completed | Stars / Premium: received by the recipient. |
in_review | In progress | Ads: submitted to Telegram, waiting for approval. Can still be cancelled. |
running / paused | In progress | Ads: live / paused. result shows budget, spent, views and clicks. |
declined | In progress | Ads: Telegram declined the ad (error_code: ad_declined). Cancel it for a full refund, or contact support to edit and resubmit. |
cancelling | In progress | Ads: a cancel is in progress. |
partial | Partial | Sessions: fewer delivered than ordered, charged only for what shipped. |
sourcing | In progress | Aged: the chat is being prepared. Can still be cancelled. |
awaiting_join | In progress | Aged channel / group: the recipient must join invite_link. Can still be cancelled. |
awaiting_start | In progress | Aged bot: the recipient must open the bot and tap Start. Can still be cancelled. |
transfer_pending | In progress | Aged: ownership is being transferred. |
transferred | Completed | Aged: the recipient owns the chat (transferred_at). |
expired_unclaimed | Completed | Aged: the recipient didn't join before claim_deadline. Not refunded. |
refunded | Canceled | Cancelled and refunded in full (refunded shows the amount on Aged orders). error_code says why when known, e.g. cancelled_by_you. |
failed | Canceled | Aged: cancelled, refund being processed. |
| next_action | Meaning |
|---|---|
wait | Nothing for you to do; check again later. |
recipient_join_invite | Send invite_link to the recipient; they join with their account. |
recipient_start_bot | The recipient opens the bot link and taps Start. |
contact_support | Something needs us (e.g. recipient_not_found); quote the order code. |
none | Final. |
Errors
Errors come back as JSON with HTTP 200 (reseller-API convention). error is a readable message, error_code a stable code to branch on, and request_id (also in the X-Request-ID header of every answer) is what to quote to support. A failed add also says whether money moved (charged) and whether the same request can succeed later (retryable).
| error_code | Meaning |
|---|---|
invalid_key | Missing or unknown key. |
ip_not_allowed | The key was used from an IP outside your allowlist. |
key_read_only / primary_key_required | This key can't call this action. |
key_in_url | The key was sent in the URL; send it in the POST body or the Authorization header. |
account_disabled | This account can't use the API. |
invalid_action | Unknown action. |
invalid_service / service_retired | No such service id / an id that was retired (see services). |
service_unavailable | The service is not on sale right now. |
invalid_link | link missing or not a valid @username / t.me link. |
recipient_not_a_person | The @username can't receive this service: a bot (any product), or a channel/group (Premium, Aged). See check. |
recipient_not_found | No Telegram account has this @username. Nothing was charged. |
invalid_quantity | quantity outside the service's min/max. |
invalid_request | Another parameter is invalid; see error. |
insufficient_funds | Balance too low. Top up and retry. |
out_of_stock | Nothing in stock right now. Retry later. |
invalid_idempotency_key | The key isn't 1–64 chars of A–Z a–z 0–9 _ -, or idempotency_key and client_reference differ. |
idempotency_key_reused | Sessions: that key already belongs to a finished order; use a new key. |
order_not_found | The order (or key) isn't yours or doesn't exist. |
rate_limited | Too many requests (HTTP 429); wait a few seconds. |
order_pending_record | status by key: that key was charged but the answer was lost before the order record was written. Send the same add with the same key: it returns the order (replayed: true) without charging again. |
too_many_orders | More than 100 orders in one request. |
cancel_too_late / cancel_not_supported | The order can't be cancelled. |
deposit_required | Tickets: your account needs one successful deposit first. |
ticket_already_open | Tickets: this customer already has an open ticket; the answer carries its ticket number. |
ticket_not_found / ticket_closed | Tickets: not your ticket, or closed (open a new one). |
temporary_error | Our side; retry with the same idempotency_key. If charged is true, the retry returns your order without charging again. |
Aged orders that ended badly carry an error_code in status too: recipient_not_found, claim_window_expired, out_of_stock, chat_not_transferable, cancelled_by_you or cancelled.
Rate limits
A per-IP token bucket applies to the endpoint, plus a per-account one across all your IPs. Over the limit you get HTTP 429 with "error_code": "rate_limited" and a Retry-After header (seconds); wait that long and retry.
| Endpoint | Limit |
|---|---|
| POST /api/v2, per IP | 120 requests / minute (bursts of 40) |
| POST /api/v2, per account | 300 requests / minute (bursts of 100) |
Faster integration
- Webhooks instead of polling. Register a webhook and we push every status change to you; no need to poll
status. - Batch status. Check up to 100 orders in one call with
orders=instead of one call per order. - Reuse the catalogue.
serviceschanges slowly: refresh it every few minutes, and send itsETagback asIf-None-Matchto get an empty304when nothing changed. - Keep connections open. Reuse one HTTP client (keep-alive) and accept gzip; this saves a TLS handshake and most of the transfer on every call.