---
title: "Register a chat"
method: POST
path: "/v1/giveaways/channels"
tags: ["Giveaways"]
---

# Register a chat

`POST /v1/giveaways/channels`

## Request

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

Register a channel or group by `@username`, numeric chat id or link, and
get the live checks back: our bot must be an administrator (and able to
post, for auto-posting), and your account must administer the chat.
Fix what fails, then re-run the check. `Idempotency-Key` is required.

A check that fails is a `200` with `checks` saying which one. Refusals:
`404 not_found` — our bot cannot see the chat (it is not in it, or the
name does not exist; a handle that belongs to a person reads the same):
add the bot to the chat, then register it again. `400 bad_request` — the
text is not a usable chat reference, is a positive numeric id (a person
or a bot — refused without asking Telegram), or names a chat that is not a
channel or group; `message` starts with the refusal's code, for example
`not_a_chat: …`. An `invite_link` that is not a `https://t.me/+…` (or
`https://t.me/joinchat/…`) join link is `400` on `invite_link`.
`503 unavailable` — Telegram could not be asked right now: retry. It
says nothing about the chat.

## Headers

- `Idempotency-Key` string, required

## Request body

- RegisterGiveawayChannelRequest
  - `chat` string, required: `@username`, numeric chat id or link.
  - `invite_link` string, nullable: A `https://t.me/+…` join link for a private chat.

## Response `200`

The chat and its checks.

- GiveawayChannelWithChecks
  - `channel` GiveawayChannel, required
    - `id` string, uuid, required
    - `chat_id` string, required: The Telegram chat id.
    - `username` string, nullable, required
    - `title` string, nullable, required
    - `chat_type` string, nullable, required
    - `bot_is_admin` boolean, required
    - `bot_can_post` boolean, required
    - `owner_verified` boolean, required
    - `invite_link` string, nullable, required
    - `checked_at` string, date-time, nullable, required
  - `checks` GiveawayChannelChecks, required
    - `bot_is_admin` boolean, required: Our bot administers the chat (required).
    - `bot_can_post` boolean, required: Our bot may post there (required for auto-posting).
    - `owner_is_admin` boolean, required: Your Telegram account administers the chat.

## 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.
- `404`: No such resource for this tenant (another tenant's id is also `404`).
- `409`: The request conflicts with the resource's state or with an earlier request: `idempotency_conflict`, `idempotency_in_flight` (with `Retry-After`), `conflict` (also an order `Idempotency-Key` reused with a different body, or an order cancel in a status other than `awaiting_payment`), or a giveaway refusal with its own code (`funding_received`, `use_close`, `limit_reached`, `attestations_frozen`, `attestation_limit_reached` with `limit`, `funding_order_open_in_other_currency` with `currency`, …).
- `413`: The request body is too large (`bad_request`, `request body too large`). On the giveaway and series routes the limit is about 64 KB of JSON; a series template or an attestation batch of 1,000 ids fits well inside it.
- `415`: A request body was sent with a `Content-Type` other than `application/json` (a missing one included), or with an unsupported charset or `Content-Encoding` (`bad_request`). A POST without a body needs no `Content-Type`.
- `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.
- `503`: A required source was temporarily unavailable (`unavailable`): the price source, recipient eligibility that could not be verified right now, the payment check a cancel runs first, or (order create, rarely) no fulfilment capacity assigned to your tenant right now. The `message` is generic (`internal error`), so it does not say which: treat every `unavailable` as **retryable** — reuse the same `Idempotency-Key` and try again shortly. An app `503 unavailable` creates and cancels nothing and charges nothing. If `503 unavailable` on order create persists, contact support with the `X-Request-ID`. The edge's own `502`, `503` and `504` (the service restarting or timing out) answer the same envelope with `unavailable`, and may follow a request that did land: retry with the same `Idempotency-Key`, and an order create that landed is replayed, never duplicated. On the campaign, gift and giveaway routes a `503` may also be a gift catalog that cannot be read right now (`gift_catalog_unavailable` — retry later) or an option that is not enabled for your tenant yet (`prize_type_unavailable`, `partner_conditions_unavailable`, `antibot_enforce_unavailable`, `autopost_unavailable`, `series_unavailable` — do not retry, ask support); the `code` says which.

## Changes

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

[Operation history](https://skmtc.dev/mystars/apis/mystars-faas-fulfilment-api/changes/v1/giveaways/channels/post.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)
