API documentation
Launch and track campaigns over HTTP from your own code.
On this page
Base URL
All endpoints live under this prefix. Every path below is relative to it.
Getting an API key
Keys are issued in the site cabinet or in the Telegram bot. On the site, sign in and open Dashboard → API, then click “Issue key”; you can keep several keys and revoke each one separately. In the bot, go to Profile and tap “API”, then “Issue key”; the bot keeps one key, and reissuing it replaces the previous one. Site keys belong to your site account and bot keys to your Telegram account: each is listed and managed only where it was issued. The key is shown once — copy it immediately, it is not shown again.
Open Dashboard → APIAuthenticating requests
Send the key with every request, either in the header or as a bearer token in the Authorization header. Both are equivalent — send only one. If an Authorization header is present but is not a Bearer token, is ignored and the request gets 401.
curl https://api.doomflood.guru/v1/account/balance \
-H "X-Api-Key: $DOOM_API_KEY"
curl https://api.doomflood.guru/v1/account/balance \
-H "Authorization: Bearer $DOOM_API_KEY"Keep the key secret
A key grants full access to your account and balance. Never embed it in client-side code or public repositories. If a key leaks, revoke it where it was issued: on the site in Dashboard → API (Revoke), or in the bot (Profile → API → Reissue key). A revoked or replaced key stops working immediately. Resetting your site password or signing out of all sessions revokes all your site keys, and the bot key too if your Telegram is linked.
curl https://api.doomflood.guru/v1/account/balance \
-H "X-Api-Key: $DOOM_API_KEY"{
"balance": 42.5,
"currency": "USD"
}Lists the email presets (default, fast), the email long-tariff bounds (including its bonus rule: when durationMinutes is greater than bonusMessagesOverMinutes, bonusMessages extra messages are added to the requested quantity and billed, so GET /price and the charge include them), and the phone limits (quantity and duration ranges, price per 100). Read the current limits and prices from here rather than hardcoding them — they depend on server settings and your loyalty discount.
Parameters
No parameters.
curl https://api.doomflood.guru/v1/tariffs \
-H "X-Api-Key: $DOOM_API_KEY"{
"tariffs": [
{
"tariff": "default",
"durationMinutes": 60,
"quantity": 1000,
"basePrice": 1,
"finalPrice": 0.90,
"discountRate": 0.10
},
{
"tariff": "fast",
"durationMinutes": 30,
"quantity": 1000,
"basePrice": 1.20,
"finalPrice": 1.08,
"discountRate": 0.10
}
],
"long": {
"minQuantity": 1,
"maxQuantity": 3000,
"maxDurationMinutes": 1440,
"basePricePer100": 0.13,
"finalPricePer100": 0.12,
"bonusMessagesOverMinutes": 120,
"bonusMessages": 100
},
"phone": {
"minQuantity": 50,
"maxQuantity": 500,
"minDurationMinutes": 30,
"maxDurationMinutes": 10080,
"pricePer100": 0.5
}
}Calculates the price for a campaign before launching it. The price is always computed on the server; a client-supplied price is never accepted.
Parameters
typestringoptional"email" (default) or "phone".
tariffstringoptionalEmail only: default, fast or long.
quantityintegerdepends on typeEmail long and phone: number of messages (required for both).
durationMinutesintegerdepends on typeEmail long (optional) and phone (required): duration in minutes.
curl "https://api.doomflood.guru/v1/price?type=email&tariff=default" \
-H "X-Api-Key: $DOOM_API_KEY"
curl "https://api.doomflood.guru/v1/price?type=phone&quantity=100&durationMinutes=60" \
-H "X-Api-Key: $DOOM_API_KEY"# type=email&tariff=default
{
"basePrice": 1,
"finalPrice": 0.90,
"discountRate": 0.10
}
# type=phone&quantity=100&durationMinutes=60
{
"basePrice": 0.5,
"finalPrice": 0.5,
"discountRate": 0
}Creates a campaign. For type "email" pass a tariff: default and fast take no extra parameters, long requires quantity (1–3000) and takes an optional durationMinutes (1–1440). For type "phone" pass a strict +1XXXXXXXXXX US number, quantity and durationMinutes within the phone limits from GET /tariffs — no tariff is allowed. The body is charged against your balance; send an to make retries safe. Unknown JSON fields in the body are rejected with 422.
Parameters
typestringrequired"email" or "phone" (case-insensitive).
targetstringrequiredEmail: a valid address (≤ 254 chars). Phone: a US number strictly +1XXXXXXXXXX.
tariffstringdepends on typeEmail only: default, fast or long. Must not be sent for phone.
quantityintegerdepends on typeEmail long: required, 1–3000. Phone: required, within GET /tariffs phone range.
durationMinutesintegerdepends on typeEmail long: optional, 1–1440. Phone: required, 30 .. phone.maxDurationMinutes.
startTimestringoptionalOptional ISO-8601 date-time; no offset means UTC. From 5 min in the past up to 7 days ahead.
curl -X POST https://api.doomflood.guru/v1/campaigns \
-H "X-Api-Key: $DOOM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-d '{
"type": "email",
"target": "[email protected]",
"tariff": "default"
}'curl -X POST https://api.doomflood.guru/v1/campaigns \
-H "X-Api-Key: $DOOM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
-d '{
"type": "phone",
"target": "+15551234567",
"quantity": 100,
"durationMinutes": 60
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "running",
"chargedAmount": 0.90,
"newBalance": 41.60
}Returns your campaigns, newest first. Supports an optional status filter and limit/offset pagination. total counts matching campaigns up to 10000; when totalIsCapped is true the real number is larger.
Parameters
statusstringoptionalFilter by status: running, completed, scheduled, failed, cancelled, timeout, starting.
limitintegeroptionalPage size, 1–100 (default 20).
offsetintegeroptionalItems to skip, ≥ 0 (default 0).
curl "https://api.doomflood.guru/v1/campaigns?status=running&limit=20&offset=0" \
-H "X-Api-Key: $DOOM_API_KEY"{
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "email",
"target": "[email protected]",
"status": "running",
"tariff": "default",
"requestedMessages": 1000,
"progressPercent": 42,
"cost": 0.90,
"durationMinutes": 60,
"createdAt": "2026-10-20T12:00:00Z",
"finishedAt": null
}
],
"total": 1,
"limit": 20,
"offset": 0,
"totalIsCapped": false
}Returns a single campaign by id. requestedMessages: The quantity you asked for, without bonus messages, for long and phone campaigns. Preset tariffs (default, fast) report a nominal 1000. Long campaigns created before this change may include the 100-message bonus. An id that is not yours, does not exist, or is not a valid GUID returns 404.
Parameters
idpath, GUIDrequiredCampaign id.
curl https://api.doomflood.guru/v1/campaigns/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "X-Api-Key: $DOOM_API_KEY"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "email",
"target": "[email protected]",
"status": "completed",
"tariff": "default",
"requestedMessages": 1000,
"progressPercent": 100,
"cost": 0.90,
"durationMinutes": 60,
"createdAt": "2026-10-20T12:00:00Z",
"finishedAt": "2026-10-20T13:00:00Z"
}Stops a campaign. A campaign that has already finished, failed, or been cancelled returns 409. On success the response status is "completed" — the API does not distinguish a campaign cancelled through it from one that finished on its own, and ?status=cancelled will not find it. The status "cancelled" can still appear for a cancellation made by the system. Cancelling does not refund the charge.
Parameters
idpath, GUIDrequiredCampaign id.
curl -X POST https://api.doomflood.guru/v1/campaigns/3fa85f64-5717-4562-b3fc-2c963f66afa6/cancel \
-H "X-Api-Key: $DOOM_API_KEY"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "completed"
}A launch request charges your balance. If the network drops before you see the response, a blind retry could create a second campaign and charge you twice. The optional header prevents that.
Generate a GUID per intended launch and send it as on POST /campaigns. Reuse the same GUID when you retry the same launch. The key is bound to your account, so collisions between accounts are impossible.
A retry with a key that already succeeded returns the original campaign without charging again: chargedAmount is the stored cost of that campaign and newBalance is your current balance. Email and phone use separate key scopes — the same client key on an email and a phone launch creates two different campaigns. The replay is compared with the stored campaign (type, target, tariff, quantity, duration): reusing a key with a different body returns 409 idempotency_key_reused — always use a new key for each distinct launch.
A non-GUID value, or a repeated header, returns 422. One caveat: the charge is applied just before the campaign row is written, so a hard process crash in that window can leave you charged without a campaign, and a retry with the same key would charge again. The key only protects you after the campaign row is committed — if a launch response is lost, check GET /campaigns and your balance before retrying.
Errors produced by the API itself have the JSON shape below. Use requestId when reporting a problem. The proxy in front of the API can return non-JSON bodies (502/504 when the API is down or slow, 413 for an oversized body, 429 from the edge limiter), so always rely on the HTTP status when the body is not JSON.
{
"error": {
"code": "validation_error",
"message": "target must be a valid email address.",
"requestId": "0HN1234567890:00000001"
}
}| Code | HTTP | Meaning |
|---|---|---|
| invalid_api_key | 401 | Missing, revoked or invalid key. |
| forbidden | 403 | Access denied (e.g. a blocked owner). |
| insufficient_balance | 422 | Not enough balance to launch. |
| validation_error | 422 | Invalid or unparsable body, query, header, limits, or price below the minimum (e.g. “type must be 'email' or 'phone'.”, “Invalid request body.”). |
| conflict | 409 | Campaign cannot be cancelled in its current state. |
| idempotency_key_reused | 409 | The same Idempotency-Key was used with a different body (type, target, tariff, quantity or duration). Use a new key for a new launch. |
| not_found | 404 | Entity is not yours, does not exist, or route is unknown. |
| method_not_allowed | 405 | HTTP method not allowed for this route. |
| unsupported_media_type | 415 | Content-Type is not supported. |
| rate_limited | 429 | Request or auth-failure limit exceeded. See Retry-After. |
| service_unavailable | 503 | Transient dependency failure (DB, bus, key store), or a launch that failed after the charge was refunded. Retry-After: 5; for launches retry with the same Idempotency-Key. |
| charge_uncertain | 500 | The charge outcome is unknown, or the campaign was not created and the charge could not be refunded. Do not retry: check GET /v1/campaigns and your balance, and contact support. |
| internal_error | 500 | Unhandled server error. |
| bad_request | 400 / 4xx | Low-level transport error (e.g. truncated or oversized body). Validation problems use 422, not 400. |
503 responses from the API carry : 5. Treat 502, 503 and 504 as transient and retry with backoff (for launches, always with the same ; a 503 from a launch means nothing was charged or the charge was refunded). A 500 charge_uncertain means: do not retry, check the balance and GET /v1/campaigns first.
Three layers apply: the edge limit per IP (nginx), the application limit per key owner, and the auth-failure limit per IP. All reject with status 429.
Per-IP edge limit (nginx)
The reverse proxy caps requests per IP at roughly 20 req/s with a burst allowance (~40). When it rejects, the 429 body is NOT the API's JSON envelope — it is nginx's own HTML. Clients must rely on the HTTP status code, not the body, to detect this case.
Per-owner application limit
The application applies fixed-window limits partitioned by key owner (all keys of one owner share one budget). Launch and cancel default to 15 per 60s; reads (campaign list, single campaign, tariffs, price, balance) default to 120 per 60s. These 429 responses DO use the JSON envelope and carry in seconds.
Auth-failure limit
Repeated bad keys from one IP (default 20 per 60s) get blocked: after the limit, every request from that IP — even one with a valid key — returns 429 until the window ends. Fix the key before retrying.
To back off: on 429 with , wait that many seconds; otherwise use exponential backoff with jitter. Keep steady-state request rates well under the edge limit.
An OpenAPI document describes every endpoint, parameter and schema. Import it into Postman or Insomnia, or generate a typed client from it.