---
title: "Check delivery capacity"
method: GET
path: "/v1/capacity"
tags: ["Campaigns"]
---

# Check delivery capacity

`GET /v1/capacity`

## Request

- Base URL: `https://api.mystars.tg`
- URL: `https://api.mystars.tg/v1/capacity`
- Auth: API key in header `X-Api-Key`

How fast a campaign of `recipients` would be delivered right now: active
senders, your remaining daily allowance, your backlog of paid but
undelivered recipients, and an ETA in seconds (`null` when it cannot be
estimated). `type=stars` and `type=premium` answer the `OrderCapacity`
form; `type=star_gift` answers the `GiftCapacity` form (gift senders and
your gift recipients per day) and `422 product_not_available` where gift
campaigns are not offered. A missing or unknown `type`, or a
`recipients` that is not a plain decimal integer from 0 to 10,000,
answers `400`.

## Query parameters

- `type` 'stars' | 'premium' | 'star_gift', required: What every recipient receives: `stars` (`quantity` Stars), `premium` (`months` of Premium) or `star_gift` (one Telegram star gift, `gift_id`).
- `recipients` integer

## Response `200`

Current capacity for the product.

- union: Delivery capacity for one product — the Stars/Premium form or the star-gift form.
  - OrderCapacity
    - `type` 'stars' | 'premium', required
    - `recipients` integer, required
    - `active_senders` integer, required
    - `reserved_for_direct` integer, required: Senders kept free for single orders.
    - `available_slots` integer, required: Deliveries your campaigns may start right now.
    - `max_inflight` integer, required: Your cap on campaign deliveries in flight at once.
    - `daily_cap` integer, required: Your campaign recipients per UTC day.
    - `daily_allowance_remaining` integer, required
    - `backlog` integer, required: Paid recipients of your campaigns not sent yet.
    - `eta_seconds` integer, nullable, required
  - GiftCapacity
    - `type` 'star_gift', required
    - `recipients` integer, required
    - `active_senders` integer, required: Gift senders able to send now.
    - `enrolled_senders` integer, required
    - `daily_cap` integer, required: Gifts all senders may send today.
    - `daily_allowance_remaining` integer, required
    - `tenant_daily_cap` integer, required: Your gift recipients per UTC day.
    - `tenant_daily_remaining` integer, required
    - `backlog` integer, required
    - `eta_seconds` integer, nullable, required

## Other responses

- `400`: Malformed request (`bad_request`): a missing or invalid field, header or query parameter (the `message` names it), a malformed `cursor`, a body that is not valid JSON, or a body nested deeper than 64 levels. Send integer query parameters as plain decimal digits: the pricing, order, giveaway and series routes refuse any other spelling (a sign, decimal point, exponent, hex prefix or surrounding spaces) with a `400` naming the parameter. Fix the request; retrying it unchanged gets the same answer.
- `401`: Missing or invalid `X-Api-Key`.
- `403`: The API key is valid, but the tenant is suspended (for example after `/api_revoke` — run `/api_rotate` in the bot to restore access) or banned, or the product (campaigns, giveaways) is not enabled for it. Products are enabled per tenant on request. A source address blocked at our edge gets `403 forbidden` with the message `source blocked`, whatever the key.
- `422`: The request is well-formed but cannot be served: `recipient_ineligible` (order create: the recipient cannot receive the item, and no order is created), `product_not_available`, `currency_not_available` (the currency is not offered on this service; nothing is created), `channel_checks_failed` (with `checks`), `schedule_out_of_bounds` (with `bound` and `limit`) or `unprocessable`.
- `429`: A rate limit was reached (`rate_limited`). See **Rate limits** in the overview. Which `429`s carry headers: - **Per-minute buckets** — the general request budget, the order-lifecycle bucket, the pricing/recipient-check probe cap (60 req/min), the campaign bucket, and your giveaway read, write, quote and attestation buckets. Every answer metered by one carries `RateLimit-Policy`, `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds); a `429` adds `Retry-After` (seconds). - **Caps, no `Retry-After`** — the daily intake cap and the daily order cap on `POST /v1/orders` (UTC day), the per-recipient guard on unfinished orders to one `@username`, and the cap on live campaigns. These `429`s carry no `Retry-After`, but they do carry the `RateLimit-*` headers of the per-minute bucket the request passed (often with `RateLimit-Remaining` above zero): branch on `Retry-After`, never on `RateLimit-Remaining`. Back off; the daily intake and order caps clear at the next UTC midnight. - **The daily budget of ineligible-recipient refusals** on `POST /v1/orders` — its `429` carries `Retry-After` and `error.retry_after`, both the seconds until 00:00 UTC, when the budget resets, plus the `RateLimit-*` headers of the order bucket it passed. `error.retry_after` is what sets it apart from the other `429`s. While the budget's places are held only by your own checks still running, the create answers a short `429` instead: `Retry-After` of a few seconds and no `error.retry_after` — retry after `Retry-After`. - **The giveaway quote budget shared by all tenants** — its `429` carries `Retry-After` (seconds until the shared budget reopens) and the `RateLimit-*` headers of your own quote bucket, never figures for the shared budget. - **Edge throttle** — a coarse per-IP throttle in front of the API answers the same envelope with `Retry-After: 1` and no `RateLimit-*` headers.

## Changes

- **2026-10-31** `9f589c4dd26b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/changes/v1/capacity/get.md)

---

[API](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api.md) - [All operations](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/revisions/b6cdc8aff8c2?raw)
