---
title: "Create a recurring series"
method: POST
path: "/v1/giveaways/series"
tags: ["Giveaway series"]
---

# Create a recurring series

`POST /v1/giveaways/series`

## Request

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

Schedule a giveaway that repeats every `every` × `interval` from
`starts_at` (UTC), for `count` occurrences or `until` a date — exactly
one of the two. `template` is exactly the body of `POST /v1/giveaways`
(conditions and anti-bot policy included) and is checked like a create,
live chat checks included, before the series is accepted: a refusal names
its field under `template.` (for example `template.title` — at most 80
characters once whitespace runs are collapsed — `template.gift.comment`,
`template.gift.gift_id` or `template.winner_count`, with `details.code`
when it has one), and answers with the create's statuses (`404` for an
unknown condition chat, `422 channel_checks_failed` with `checks`, `503`
when Telegram could not be asked). Each slot spawns an ordinary giveaway
(`series.occurrence_created`), opens its funding order at once
(`giveaway.awaiting_funding`) and is paid on its own through its one-time
deposit address; attest partner conditions against each occurrence's own
giveaway id.

**Bounds.** At most 52 occurrences, the last no more than one year after
`starts_at`: past either bound the answer is `422 schedule_out_of_bounds`
with `field`, `bound` (`max_occurrences` or `max_span`) and `limit`.
`starts_at` may not be in the past (one minute of grace) and must fall
within the coming year, and `every` is at most 365 for `day`, 52 for
`week` and 12 for `month` (each `400`). Occurrences never overlap:
`template.duration_sec` plus the funding window (7,200 s) plus the spawn
grace (900 s) must be shorter than `every` × `interval`, a month counted
as 28 days (`400` on `template.duration_sec`) — for a daily series,
`duration_sec` is at most 78,299.

**Missed slots.** A slot not spawned within 15 minutes of its time is
skipped, never made up. An unfunded occurrence counts as a miss:
`on_unfunded: pause` pauses after the first miss, `skip` after three in a
row. Series per tenant are capped (`409 limit_reached`).

`Idempotency-Key` is required and behaves like a giveaway create.
Recurring series are enabled on request (`503 series_unavailable` until
then — not retryable).

## Headers

- `Idempotency-Key` string, required

## Request body

- CreateGiveawaySeriesRequest: Give exactly one of `count` and `until`.
  - `template` CreateGiveawayRequest, required: A classic giveaway. Unknown fields are refused with `400`.
    - `channel_id` string, uuid, required: A registered chat.
    - `title` string, nullable: At most 80 characters once runs of whitespace (line breaks included) are collapsed to one space; the raw string is capped at 320. May not contain NUL or unpaired surrogate characters. A refusal is `400` on `title`.
    - `prize_type` 'stars' | 'premium' | 'gift', required: `stars` (Stars per winner), `premium` (Premium months per winner) or `gift` (one star gift per winner).
    - `prize_quantity_per_winner` integer, required: Stars per winner (50–1,000,000), Premium months per winner (a term on sale: 3, 6 or 12 today), or `1` for a gift. Outside that it is `400` on `prize_quantity_per_winner`, with `details.code` `stars_per_winner_min` / `stars_per_winner_max` (`params.min` / `params.max`) or `premium_term_invalid` (`params.terms`, the terms on sale).
    - `winner_count` integer, required: At most `max_winners` (channel list); above it `400` on `winner_count` with `details.code` `winner_count_max` (`params.max`).
    - `duration_sec` integer, required: How long the giveaway runs once it opens: at least 60 seconds and at most 7 days (604,800 s); outside that it is `400` on `duration_sec`.
    - `conditions` GiveawayConditionInput[]: At most one `chat_member` and two `attestation` conditions, with distinct keys.
      - union: An entry condition — a membership gate or an attestation you assert.
        - ChatMemberConditionInput
          - `type` 'chat_member', required
          - `channel_ids` string[], required: Registered chats the entrant must be a member of (re-checked before the draw).
        - AttestationConditionInput
          - `type` 'attestation', required
          - `key` string, required: Your condition key; name it in attestations.
          - `label` string, required: What entrants read, at most 80 characters.
          - `cta_url` string, nullable: An `https://` link entrants tap to meet the condition.
          - `timing` 'entry_and_close' | 'close_only', required: `entry_and_close` — entry needs a satisfied attestation; `close_only` — entry is admitted and anyone un-attested at close is filtered.
    - `antibot` GiveawayAntibotInput
      - `mode` 'shadow' | 'enforce', required
      - `threshold` number
      - `require_premium` boolean
      - `audience_language` string, nullable: The audience's BCP-47 primary language subtag, for example `en`.
    - `external_ref` string, nullable: Your own reference, echoed on every read and event. May not contain NUL or unpaired surrogate characters.
    - `listed` boolean: Show it on the public giveaways index (the proof page stays reachable by link).
    - `entries_events` boolean: Send batched `giveaway.entries` events.
    - `gift` GiveawayGiftPrize, nullable
      - `gift_id` string, required: A gift from the catalog (`GET /v1/gifts`). It is checked against the catalog at create: an unknown or sold-out gift is `400` on `gift.gift_id`, and one whose remaining stock or total Stars do not fit the winner count is `400` on `winner_count`, each with `details.code`.
      - `comment` string, nullable: Text sent with each prize gift, at most the catalog's `comment_max_length` characters after trimming. No links (a domain-like token counts as one), no @mentions, no control characters other than a line feed `\n` (a carriage return `\r` is refused, so send `\n` line breaks, not `\r\n`), and no NUL or unpaired surrogate characters: a refusal is `400` on `gift.comment`.
  - `interval` 'day' | 'week' | 'month', required
  - `every` integer: Slots are `every` intervals apart — at most 365 for `day`, 52 for `week` and 12 for `month` (`400` above).
  - `starts_at` string, date-time, required: The first slot (UTC). A month step keeps the day, clamped to the month's end.
  - `count` integer: The number of occurrences. More than 52, or a last slot more than a year after `starts_at`, is `422 schedule_out_of_bounds` (with `bound` and `limit`), not a `400`.
  - `until` string, date-time: The last slot is the last one at or before this time. `until` must be after `starts_at` (`400`). An `until` more than a year after `starts_at`, or one that would make more than 52 slots, is `422 schedule_out_of_bounds` (with `bound` and `limit`).
  - `currency` 'ton' | 'usdt_ton': The asset every occurrence's funding order is opened in: `ton` = GRAM, `usdt_ton` = USDT (TON) — `422 currency_not_available` while USDT funding is not offered.
  - `on_unfunded` 'skip' | 'pause'

## Response `200`

Idempotent replay — the series this key created.

- GiveawaySeries
  - `id` string, uuid, required
  - `status` 'active' | 'paused' | 'cancelled' | 'completed', required: `active` ⇄ `paused` — paused by you (`paused_reason: requested`) or automatically (`spawn_failures`, `lost_admin`, `unfunded`), active again only by a resume. From either: `cancelled` (by you) or `completed` (the last slot passed, also when a resume finds no slot left). Pause applies to `active`, resume to `paused`, cancel to both; asking for the status a series already has returns it unchanged, anything else is `409 invalid_state` with `status`. Terminal: `cancelled`, `completed`.
  - `paused_reason` 'requested' | 'spawn_failures' | 'lost_admin' | 'unfunded' | 'null', nullable
  - `interval` 'day' | 'week' | 'month', required
  - `every` integer, required
  - `starts_at` string, date-time, required
  - `count` integer, nullable
  - `until` string, date-time, nullable
  - `last_index` integer: The slot the series ends with.
  - `on_unfunded` 'skip' | 'pause'
  - `currency` 'ton' | 'usdt_ton': The asset the order is paid in. `ton` = the native coin GRAM (ex TON), sent as a plain transfer — it is not USDT on TON. `usdt_ton` = USDT (TON), sent as a jetton transfer. Required on every create and pricing request: a request without it is rejected with `400 bad_request`.
  - `next_index` integer, nullable
  - `next_occurrence_at` string, date-time, nullable
  - `occurrences_created` integer
  - `consecutive_failures` integer
  - `consecutive_misses` integer
  - `template` CreateGiveawayRequest, required: A classic giveaway. Unknown fields are refused with `400`.
    - `channel_id` string, uuid, required: A registered chat.
    - `title` string, nullable: At most 80 characters once runs of whitespace (line breaks included) are collapsed to one space; the raw string is capped at 320. May not contain NUL or unpaired surrogate characters. A refusal is `400` on `title`.
    - `prize_type` 'stars' | 'premium' | 'gift', required: `stars` (Stars per winner), `premium` (Premium months per winner) or `gift` (one star gift per winner).
    - `prize_quantity_per_winner` integer, required: Stars per winner (50–1,000,000), Premium months per winner (a term on sale: 3, 6 or 12 today), or `1` for a gift. Outside that it is `400` on `prize_quantity_per_winner`, with `details.code` `stars_per_winner_min` / `stars_per_winner_max` (`params.min` / `params.max`) or `premium_term_invalid` (`params.terms`, the terms on sale).
    - `winner_count` integer, required: At most `max_winners` (channel list); above it `400` on `winner_count` with `details.code` `winner_count_max` (`params.max`).
    - `duration_sec` integer, required: How long the giveaway runs once it opens: at least 60 seconds and at most 7 days (604,800 s); outside that it is `400` on `duration_sec`.
    - `conditions` GiveawayConditionInput[]: At most one `chat_member` and two `attestation` conditions, with distinct keys.
      - union: An entry condition — a membership gate or an attestation you assert.
        - ChatMemberConditionInput
          - `type` 'chat_member', required
          - `channel_ids` string[], required: Registered chats the entrant must be a member of (re-checked before the draw).
        - AttestationConditionInput
          - `type` 'attestation', required
          - `key` string, required: Your condition key; name it in attestations.
          - `label` string, required: What entrants read, at most 80 characters.
          - `cta_url` string, nullable: An `https://` link entrants tap to meet the condition.
          - `timing` 'entry_and_close' | 'close_only', required: `entry_and_close` — entry needs a satisfied attestation; `close_only` — entry is admitted and anyone un-attested at close is filtered.
    - `antibot` GiveawayAntibotInput
      - `mode` 'shadow' | 'enforce', required
      - `threshold` number
      - `require_premium` boolean
      - `audience_language` string, nullable: The audience's BCP-47 primary language subtag, for example `en`.
    - `external_ref` string, nullable: Your own reference, echoed on every read and event. May not contain NUL or unpaired surrogate characters.
    - `listed` boolean: Show it on the public giveaways index (the proof page stays reachable by link).
    - `entries_events` boolean: Send batched `giveaway.entries` events.
    - `gift` GiveawayGiftPrize, nullable
      - `gift_id` string, required: A gift from the catalog (`GET /v1/gifts`). It is checked against the catalog at create: an unknown or sold-out gift is `400` on `gift.gift_id`, and one whose remaining stock or total Stars do not fit the winner count is `400` on `winner_count`, each with `details.code`.
      - `comment` string, nullable: Text sent with each prize gift, at most the catalog's `comment_max_length` characters after trimming. No links (a domain-like token counts as one), no @mentions, no control characters other than a line feed `\n` (a carriage return `\r` is refused, so send `\n` line breaks, not `\r\n`), and no NUL or unpaired surrogate characters: a refusal is `400` on `gift.comment`.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, nullable
  - `paused_at` string, date-time, nullable
  - `ended_at` string, date-time, nullable

## Other responses

- `201`: Series created.
- `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/series/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)
