{"openapi":"3.1.0","info":{"title":"Autel API","description":"\nHeadless, multi-account service that monitors Telegram channels, analyses new posts with a\nconfigurable AI model, stores structured results (events, narratives, digests) and can post them\nto Telegram channels.\n\n**Authentication.** Send `Authorization: Bearer <api key>`. Keys are obtained by registering with an\ninvite code and confirming the one-time code sent by email. `admin` keys can do everything; `read`\nkeys can only read results (items, reports, posts, channels).\n\n**Errors** are `application/problem+json` (RFC 9457) with a stable `code` field.\n\n**Lists** take `limit` (default 50, max 200) and `cursor`, and return `{\"data\": [...], \"next_cursor\": ...}`.\n","version":"1.0.0"},"paths":{"/healthz":{"get":{"tags":["System"],"summary":"Service health","description":"Returns 200 when the service is running and the database answers; 503 otherwise. No authentication. Used by Docker and uptime monitors.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"Database not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/v1/accounts":{"post":{"tags":["Account"],"summary":"Register (step 1 of 2)","description":"Start registration with an invite code and an email address. A one-time code is emailed; confirm it with `POST /v1/auth/challenges/{challenge_id}/verify` to create the account and receive the first API key. The answer is the same whether or not the address is already registered. No password is ever set.","operationId":"register_v1_accounts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeOut"}}}},"400":{"description":"`invalid_invite`: Invite code is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`registration_closed`: Registration is closed","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[],"x-postman-capture":{"challenge_id":"challenge_id"}}},"/v1/auth/challenges/{challenge_id}/verify":{"post":{"tags":["Account"],"summary":"Confirm an emailed code","description":"Confirm the one-time code from the email. For registration and recovery the answer (201) holds a new admin API key, shown once. For an email change the answer is 200 with the new address. A wrong, expired, used or unknown code always returns `invalid_or_expired_code`.","operationId":"verify_v1_auth_challenges__challenge_id__verify_post","parameters":[{"name":"challenge_id","in":"path","required":true,"schema":{"type":"string","title":"Challenge Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/VerifiedOut"},{"$ref":"#/components/schemas/EmailChangedOut"}],"title":"Response Verify V1 Auth Challenges  Challenge Id  Verify Post"}}}},"200":{"description":"Email address changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangedOut"}}}},"400":{"description":"`invalid_or_expired_code`: Code is wrong, expired or already used; `invalid_invite`: Invite code is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`duplicate`: Already exists","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[],"x-postman-capture":{"api_key":"api_key.key","key_id":"api_key.id"}}},"/v1/auth/recovery":{"post":{"tags":["Account"],"summary":"Recover access (lost API key)","description":"Email a one-time code to the account's address. Confirming it returns a new admin API key; existing keys stay active unless `revoke_existing_keys` is sent with the code. The answer is the same whether or not the address has an account.","operationId":"recovery_v1_auth_recovery_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeOut"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[],"x-postman-capture":{"challenge_id":"challenge_id"}}},"/v1/account":{"get":{"tags":["Account"],"summary":"Account summary","description":"Name, status, what is and is not set up yet, and the next scheduled runs. With an admin key it also shows the email address and which AI provider keys are stored.","operationId":"get_account_v1_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Account V1 Account Get"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`account_suspended`: Account is suspended","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyRead":[]}]},"delete":{"tags":["Account"],"summary":"Delete the account","description":"Logs the account out of Telegram and permanently deletes every channel, post, item, report, setting, secret and key. Send the account's email address in `confirm`.","operationId":"delete_account_v1_account_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/account/email":{"post":{"tags":["Account"],"summary":"Change the account email","description":"Sends a one-time code to the new address and a notice to the current one. Confirm the code with `POST /v1/auth/challenges/{challenge_id}/verify` to switch the address.","operationId":"change_email_v1_account_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChallengeOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`duplicate`: Already exists","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}],"x-postman-capture":{"challenge_id":"challenge_id"}}},"/v1/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys","description":"Every key of the account, newest first. Key material is never returned; `last4` helps tell keys apart.","operationId":"list_keys_v1_api_keys_get","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key","description":"Create an `admin` key, or a `read` key that can only read results (give that one to a consumer website). The full key is returned once. At most 10 active keys per account.","operationId":"create_key_v1_api_keys_post","security":[{"ApiKeyAdmin":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreatedOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`key_limit`: API key limit reached; `validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-postman-capture":{"read_api_key":"key"}}},"/v1/api-keys/{key_id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key","description":"Revokes the key immediately. Revoking the key used for this request is allowed.","operationId":"revoke_key_v1_api_keys__key_id__delete","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/credentials":{"put":{"tags":["Telegram"],"summary":"Store Telegram app credentials","description":"Store your own `api_id` and `api_hash` from https://my.telegram.org (API development tools). They are encrypted and never returned. While logged in, changing them needs `?force=true`, which logs out first.","operationId":"put_credentials_v1_telegram_credentials_put","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Log out first if logged in.","default":false,"title":"Force"},"description":"Log out first if logged in."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramStatus"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`logged_in`: Telegram is logged in; log out first or use force=true","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["Telegram"],"summary":"Remove Telegram credentials and session","description":"Logs out of Telegram (best effort) and deletes the stored app credentials, phone number and session.","operationId":"delete_credentials_v1_telegram_credentials_delete","security":[{"ApiKeyAdmin":[]}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/telegram":{"get":{"tags":["Telegram"],"summary":"Telegram connection status","description":"Login status, which credentials are stored (never their values), the logged-in user, any flood-wait cooldown, and whether a bot token is stored.","operationId":"get_status_v1_telegram_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramStatus"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/telegram/login":{"post":{"tags":["Telegram"],"summary":"Ask Telegram for a login code","description":"Telegram sends a login code to the account's Telegram app (or by SMS). Then call `POST /v1/telegram/login/code`. Calling this again for the same phone resends the code. Limited to 3 per hour.","operationId":"login_v1_telegram_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action; `phone_banned`: Telegram reports this phone number as banned","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`credentials_missing`: Telegram app credentials are not set; `logged_in`: Telegram is logged in; log out first or use force=true","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`phone_invalid`: Phone number is not valid; `api_id_invalid`: Telegram api_id/api_hash are not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`flood_wait`: Telegram asked us to wait; `rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`telegram_error`: Telegram returned an error","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/telegram/login/code":{"post":{"tags":["Telegram"],"summary":"Submit the Telegram login code","description":"Completes login, or answers `password_required` when the Telegram account has two-step verification; then call `POST /v1/telegram/login/password`.","operationId":"login_code_v1_telegram_login_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`no_login_in_progress`: No Telegram login is in progress","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"400":{"description":"`code_invalid`: Telegram login code is wrong","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"410":{"description":"`code_expired`: Telegram login code has expired","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`flood_wait`: Telegram asked us to wait","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`telegram_error`: Telegram returned an error","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/telegram/login/password":{"post":{"tags":["Telegram"],"summary":"Submit the two-step verification password","description":"Only when the previous step answered `password_required`. The password is used once and never stored.","operationId":"login_password_v1_telegram_login_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`no_login_in_progress`: No Telegram login is in progress","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"400":{"description":"`password_invalid`: Two-step verification password is wrong","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`flood_wait`: Telegram asked us to wait","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`telegram_error`: Telegram returned an error","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/telegram/logout":{"post":{"tags":["Telegram"],"summary":"Log out of Telegram","description":"Ends the session at Telegram and deletes it here. App credentials stay stored; log in again with `POST /v1/telegram/login`.","operationId":"logout_v1_telegram_logout_post","responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/telegram/dialogs":{"get":{"tags":["Telegram"],"summary":"Chats you are in","description":"The chats the logged-in Telegram user is in, of the kinds allowed by `collection.chat_types` (default: channels and groups; chats with people and bots only when turned on), with Telegram's permanent id and whether this account already monitors each one. Pick the ones to monitor and send their ids in `refs` to POST /v1/channels. `monitored=false` lists only the ones not monitored yet.","operationId":"dialogs_v1_telegram_dialogs_get","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Filter by title or username.","title":"Q"},"description":"Filter by title or username."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"monitored","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Only monitored (true) or not monitored (false).","title":"Monitored"},"description":"Only monitored (true) or not monitored (false)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DialogList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`not_authorized`: Telegram is not connected","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`flood_wait`: Telegram asked us to wait; `cooldown`: Telegram cooldown in effect","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/settings":{"get":{"tags":["Settings"],"summary":"Read settings","description":"The account's effective settings (every default filled in). See docs/PLAN.md §8 for each setting's meaning, range and default.","operationId":"get_settings_v1_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]},"patch":{"tags":["Settings"],"summary":"Change settings","description":"JSON merge patch (RFC 7396): send only what changes; `null` resets a key to its default. The whole result is validated; unknown keys are rejected. Changing a schedule reschedules the next run.","operationId":"patch_settings_v1_settings_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Patch"},"example":{"collection":{"every_minutes":30},"llm":{"provider":"anthropic","effort":"low"}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid; `no_publish_target`: Auto-post needs at least one enabled publish target","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/presets":{"get":{"tags":["Settings"],"summary":"List presets","description":"Built-in presets in full, so you can see what applying one would set.","operationId":"list_presets_v1_presets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyRead":[]}]}},"/v1/settings/apply-preset":{"post":{"tags":["Settings"],"summary":"Apply a preset","description":"Replace the whole settings document with a preset (`events` or `disinfo_digest`), optionally with a merge-patch of overrides on top.","operationId":"apply_preset_v1_settings_apply_preset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyPresetIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`unknown_preset`: No such preset","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/llm/credentials":{"put":{"tags":["AI"],"summary":"Store an AI provider key","description":"Store your own API key for Anthropic, OpenAI or Gemini (encrypted; never returned). One slot per provider, so switching `llm.provider` in settings needs no re-entry. Ollama needs no key.","operationId":"put_key_v1_llm_credentials_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMKeyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMKeysOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/llm/credentials/{provider}":{"delete":{"tags":["AI"],"summary":"Remove an AI provider key","description":"Delete the stored key for one provider.","operationId":"delete_key_v1_llm_credentials__provider__delete","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"enum":["anthropic","openai","gemini"],"type":"string","title":"Provider"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/llm/test":{"post":{"tags":["AI"],"summary":"Test the AI provider","description":"Make one small structured call with the account's provider, model, effort and key, and report latency, token counts and the answer. Use it after changing `llm` settings or storing a key.","operationId":"test_llm_v1_llm_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMTestIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMTestOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`llm_key_missing`: No API key stored for that AI provider","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`llm_error`: The AI provider returned an error","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`quota_exhausted`: Today's free AI limit is used up","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/channels":{"post":{"tags":["Channels"],"summary":"Add channels","description":"Resolve a public channel by link or @username (no joining needed), or a private channel you have already joined by its numeric id. With `join: true` your Telegram user joins first, by username or invite link. Send `refs` to add several at once (for example the Telegram ids listed by GET /v1/telegram/dialogs): the answer is 200 with `added` and `skipped` (each with its error code). Collection starts on the next run.","operationId":"add_channel_v1_channels_post","security":[{"ApiKeyAdmin":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIn"}}}},"responses":{"201":{"description":"One channel added (`ref`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOut"}}}},"200":{"description":"Several (`refs`): what was added and what was skipped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelBatchOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action; `channel_private`: Channel is private; join it in Telegram first","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`not_authorized`: Telegram is not connected; `duplicate`: Already exists; `join_request_sent`: A request to join was sent and awaits approval","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`channel_limit`: Channel limit reached; `channels_too_much`: Telegram's limit on channels is reached; `chat_type_disabled`: This kind of chat is not allowed by collection.chat_types; `validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`channel_not_found`: Telegram channel not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`flood_wait`: Telegram asked us to wait; `cooldown`: Telegram cooldown in effect","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-postman-capture":{"channel_id":"id"}},"get":{"tags":["Channels"],"summary":"List channels","description":"Monitored channels with their health, newest first.","operationId":"list_channels_v1_channels_get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(ok|error|inaccessible)$"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Matches title, username or label.","title":"Q"},"description":"Matches title, username or label."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/channels/{channel_id}":{"get":{"tags":["Channels"],"summary":"Get a channel","description":"One channel with its health.","operationId":"get_channel_v1_channels__channel_id__get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Channels"],"summary":"Edit or pause a channel","description":"Change label, tags or language hint, or pause/resume with `enabled`.","operationId":"patch_channel_v1_channels__channel_id__patch","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["Channels"],"summary":"Remove a channel","description":"Stop monitoring. Collected posts are kept (their channel link is cleared) unless `purge=true`, which deletes them too.","operationId":"delete_channel_v1_channels__channel_id__delete","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"purge","in":"query","required":false,"schema":{"type":"boolean","description":"Also delete this channel's posts.","default":false,"title":"Purge"},"description":"Also delete this channel's posts."}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs":{"post":{"tags":["Runs"],"summary":"Run now","description":"Queue a collection, report or publish run immediately. If another run is active for the account, this one waits behind it. Poll `GET /v1/runs/{id}` for the result.","operationId":"create_run_v1_runs_post","security":[{"ApiKeyAdmin":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`not_authorized`: Telegram is not connected","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-postman-capture":{"run_id":"id"}},"get":{"tags":["Runs"],"summary":"Run history","description":"Scheduled and manual runs, newest first, with counts per channel and stage.","operationId":"list_runs_v1_runs_get","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(collect|report|publish|roundup|housekeeping)$"},{"type":"null"}],"title":"Kind"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(queued|running|succeeded|partial|failed|deferred)$"},{"type":"null"}],"title":"Status"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}":{"get":{"tags":["Runs"],"summary":"Get a run","description":"One run with per-channel and per-stage counts.","operationId":"get_run_v1_runs__run_id__get","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/posts":{"get":{"tags":["Posts"],"summary":"List collected posts","description":"Raw posts as collected, newest first. `q` searches the text ignoring case (works for Cyrillic).","operationId":"list_posts_v1_posts_get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"posted at or after (with offset)","title":"From"},"description":"posted at or after (with offset)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"posted before (with offset)","title":"To"},"description":"posted before (with offset)"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"analysis_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(pending|awaiting_media|skipped|done|failed)$"},{"type":"null"}],"title":"Analysis Status"}},{"name":"has_items","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true: only posts that produced items; false: only those that did not","title":"Has Items"},"description":"true: only posts that produced items; false: only those that did not"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/posts/retry":{"post":{"tags":["Posts"],"summary":"Retry failed posts","description":"Queue failed posts for analysis again. Nothing is analysed in this request: the next collection (or a report, when analysis happens at report time) does it, within the same limits and privacy rules.","operationId":"retry_posts_v1_posts_retry_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/items":{"get":{"tags":["Items"],"summary":"List items","description":"Events, narratives or other extracted items with original-language `data`, `translations` and `sources`. `sort=occurs_at` (default when a date filter is given) lists by date ascending; `sort=-updated_at` lists most recently changed first. For incremental sync pass `updated_since`: hidden items then come back as tombstones (`status: hidden`, no data) so you know to remove them. `q` searches all text ignoring case. `lang=en` adds a `localized` view.","operationId":"list_items_v1_items_get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"occurs_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"YYYY-MM-DD (local)","title":"Occurs From"},"description":"YYYY-MM-DD (local)"},{"name":"occurs_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"YYYY-MM-DD (local)","title":"Occurs To"},"description":"YYYY-MM-DD (local)"},{"name":"updated_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated Since"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(active|cancelled|hidden)$"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z]{2,3}$"},{"type":"null"}],"title":"Lang"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"enum":["occurs_at","-updated_at"],"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-postman-capture":{"item_id":"data.0.id"}}},"/v1/items/{item_id}":{"get":{"tags":["Items"],"summary":"Get an item","description":"One item with every source post.","operationId":"get_item_v1_items__item_id__get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z]{2,3}$"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Items"],"summary":"Correct or hide an item","description":"Correct fields (they are then locked, so later automatic updates never overwrite them), or set `status` to hidden / cancelled / active. Hidden items are not listed (except as tombstones to `updated_since` syncs) and never posted. Every change bumps `version` and `updated_at`.","operationId":"patch_item_v1_items__item_id__patch","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/reports":{"get":{"tags":["Reports"],"summary":"List reports","description":"Digests, newest first. `?limit=1` gives the latest.","operationId":"list_reports_v1_reports_get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"period starting at or after (UTC)","title":"From"},"description":"period starting at or after (UTC)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"period ending at or before (UTC)","title":"To"},"description":"period ending at or before (UTC)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-postman-capture":{"report_id":"data.0.id"}}},"/v1/reports/{report_id}":{"get":{"tags":["Reports"],"summary":"Get a report","description":"`format=json` (default) returns the report with structured data; `format=markdown` returns the Markdown text; `format=telegram_html` returns the exact message chunks that posting would send.","operationId":"get_report_v1_reports__report_id__get","security":[{"ApiKeyRead":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"format","in":"query","required":false,"schema":{"enum":["json","markdown","telegram_html"],"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ReportOut"},{"$ref":"#/components/schemas/TelegramChunks"}],"title":"Response Get Report V1 Reports  Report Id  Get"}},"text/markdown":{}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/telegram/bot":{"put":{"tags":["Publishing"],"summary":"Create, adopt or store a bot token","description":"Give your account a bot in one of three ways: `bot_token` (a token from @BotFather), `create` (we create the bot with your logged-in Telegram user) or `adopt` (we fetch the token of a bot you own). The token is checked with Telegram (getMe), stored encrypted and never returned.","operationId":"put_bot_v1_telegram_bot_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotIn"},"examples":{"token":{"summary":"Store a token","value":{"bot_token":"123456789:AA…"}},"create":{"summary":"Create a bot","value":{"create":{"name":"My events","username":"my_events_bot"}}},"adopt":{"summary":"Use a bot you own","value":{"adopt":"my_events_bot"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`bot_token_invalid`: Bot token is not valid; `bot_limit`: Telegram's limit on bots is reached; `validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`bot_exists`: A bot token is already stored; `not_authorized`: Telegram is not connected; `bot_username_taken`: That bot username is taken","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`bot_not_owned`: Your Telegram user does not own that bot","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`botfather_rate_limited`: @BotFather asked us to wait; `flood_wait`: Telegram asked us to wait; `cooldown`: Telegram cooldown in effect","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`botfather_unexpected`: @BotFather gave an unexpected answer; `telegram_error`: Telegram returned an error","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]},"delete":{"tags":["Publishing"],"summary":"Remove the bot token","description":"Delete the stored bot token. Destinations that post via the bot will fail until a new one is stored.","operationId":"delete_bot_v1_telegram_bot_delete","responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]}},"/v1/publish-targets":{"get":{"tags":["Publishing"],"summary":"List posting destinations","description":"Every destination with its options.","operationId":"list_targets_v1_publish_targets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}]},"post":{"tags":["Publishing"],"summary":"Add a posting destination","description":"A chat to post to, as your bot (default) or as your logged-in Telegram user, and what to post there: individual items, a scheduled round-up, both, and/or reports. Permission to post is checked now. With `create_channel` the channel is made first; a bot that cannot post yet is made an administrator by your logged-in user (`make_bot_admin`). `steps` lists what was done. Posting as the user returns a notice (or is refused when `publish.identity_policy = require_bot`).","operationId":"create_target_v1_publish_targets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`bot_not_configured`: No bot token is stored; `cannot_post`: The posting identity cannot post in that chat; `cannot_promote`: The bot cannot be made an administrator; `channels_too_much`: Telegram's limit on channels is reached; `identity_policy`: Account policy requires posting through a bot; `target_limit`: Publish target limit reached; `validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`chat_not_found`: Chat not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`not_authorized`: Telegram is not connected","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`flood_wait`: Telegram asked us to wait","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"ApiKeyAdmin":[]}],"x-postman-capture":{"target_id":"id"}}},"/v1/publish-targets/{target_id}":{"patch":{"tags":["Publishing"],"summary":"Change a posting destination","description":"Change what it posts, item mode, round-up schedule and layout, template, language, or pause it with `enabled: false`. `roundup` is merged into the current round-up settings.","operationId":"patch_target_v1_publish_targets__target_id__patch","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","title":"Target Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`validation_error`: Request is not valid","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["Publishing"],"summary":"Remove a posting destination","description":"Stop posting there. Publication history for it is removed too.","operationId":"delete_target_v1_publish_targets__target_id__delete","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","title":"Target Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/publish-targets/{target_id}/test":{"post":{"tags":["Publishing"],"summary":"Send a test message","description":"Post a short test message to prove the destination works.","operationId":"test_target_v1_publish_targets__target_id__test_post","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","title":"Target Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`bot_not_configured`: No bot token is stored; `cannot_post`: The posting identity cannot post in that chat","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"502":{"description":"`telegram_error`: Telegram returned an error","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/reports/{report_id}/publish":{"post":{"tags":["Publishing"],"summary":"Post a report now","description":"Post a report to destinations that take reports (or only `target_ids`). Each destination gets a report once; calling again retries a failed post. `dry_run: true` returns the exact message chunks without sending or recording anything.","operationId":"publish_report_v1_reports__report_id__publish_post","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`no_publish_target`: Auto-post needs at least one enabled publish target; `private_content`: Holds private-chat content, which this account does not post","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/items/{item_id}/publish":{"post":{"tags":["Publishing"],"summary":"Post an item now","description":"Post one item to destinations that take items (or only `target_ids`), using each destination's language and template. Once per destination; `dry_run` shows the message without sending.","operationId":"publish_item_v1_items__item_id__publish_post","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"`item_hidden`: Item is hidden","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"`no_publish_target`: Auto-post needs at least one enabled publish target; `private_content`: Holds private-chat content, which this account does not post","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/publications":{"get":{"tags":["Publishing"],"summary":"Posting history","description":"What was posted where, and what failed (with the error), newest first.","operationId":"list_publications_v1_publications_get","security":[{"ApiKeyAdmin":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(queued|sent|failed)$"},{"type":"null"}],"title":"Status"}},{"name":"target_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"`forbidden_scope`: This key's scope does not allow this action","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/invites":{"post":{"tags":["Operator"],"summary":"Create an invite code","description":"Create an invite code for registration. The code is returned once.","operationId":"create_invite_route_v1_admin_invites_post","security":[{"OperatorKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreatedOut"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-postman-capture":{"invite_code":"code"}},"get":{"tags":["Operator"],"summary":"List invite codes","description":"Invites and how many times each was used. Codes themselves are not stored.","operationId":"list_invites_v1_admin_invites_get","security":[{"OperatorKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/accounts":{"get":{"tags":["Operator"],"summary":"List accounts","description":"Every registered account, newest first.","operationId":"list_accounts_v1_admin_accounts_get","security":[{"OperatorKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAccountList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/emails":{"get":{"tags":["Operator"],"summary":"Read recorded emails","description":"Every email the service produced, newest first, with delivery status. While EMAIL_BACKEND=sink nothing is sent, and the full text and one-time code are shown here so sign-in can be tested.","operationId":"list_emails_v1_admin_emails_get","security":[{"OperatorKey":[]}],"parameters":[{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by recipient address.","title":"To"},"description":"Filter by recipient address."},{"name":"purpose","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by purpose, e.g. register, recovery.","title":"Purpose"},"description":"Filter by purpose, e.g. register, recovery."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (default 50, max 200).","default":50,"title":"Limit"},"description":"Page size (default 50, max 200)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailList"}}}},"401":{"description":"`unauthorized`: Missing or invalid API key","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"`not_found`: Not found","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"`rate_limited`: Too many requests","content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-postman-capture":{"email_code":"data.0.code"}}}},"components":{"schemas":{"AccountOut":{"properties":{"id":{"type":"string","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","status","created_at"],"title":"AccountOut"},"AdminAccountList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AdminAccountOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"AdminAccountList"},"AdminAccountOut":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"telegram_status":{"type":"string","title":"Telegram Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","name","status","telegram_status","created_at"],"title":"AdminAccountOut"},"ApplyPresetIn":{"properties":{"preset":{"type":"string","title":"Preset"},"overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Overrides","description":"Merge-patch applied on top of the preset."}},"additionalProperties":false,"type":"object","required":["preset"],"title":"ApplyPresetIn","example":{"overrides":{"collection":{"every_minutes":30}},"preset":"events"}},"BotCreate":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Display name."},"username":{"type":"string","pattern":"^@?[A-Za-z][A-Za-z0-9_]{1,28}[Bb][Oo][Tt]$","title":"Username","description":"5-32 characters, ending in `bot`."}},"additionalProperties":false,"type":"object","required":["name","username"],"title":"BotCreate"},"BotIn":{"properties":{"bot_token":{"anyOf":[{"type":"string","pattern":"^\\d{5,15}:[A-Za-z0-9_-]{30,}$"},{"type":"null"}],"title":"Bot Token","description":"A token you got from @BotFather."},"create":{"anyOf":[{"$ref":"#/components/schemas/BotCreate"},{"type":"null"}],"description":"Create a new bot with your logged-in Telegram user."},"adopt":{"anyOf":[{"type":"string","pattern":"^@?[A-Za-z][A-Za-z0-9_]{1,28}[Bb][Oo][Tt]$"},{"type":"null"}],"title":"Adopt","description":"Username of a bot your Telegram user already owns."},"replace":{"type":"boolean","title":"Replace","description":"Allow `create` or `adopt` to replace a stored token.","default":false}},"additionalProperties":false,"type":"object","title":"BotIn","description":"Exactly one of ``bot_token``, ``create`` or ``adopt``.","example":{"bot_token":"123456789:AA…"}},"BotOut":{"properties":{"set":{"type":"boolean","title":"Set"},"hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint"},"bot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bot"},"created":{"type":"boolean","title":"Created","default":false},"token_changed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Token Changed","description":"Whether the token differs from the one stored before."},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"}},"type":"object","required":["set","hint"],"title":"BotOut"},"ChallengeOut":{"properties":{"challenge_id":{"type":"string","title":"Challenge Id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"message":{"type":"string","title":"Message","default":"If the request can be honoured, a one-time code has been emailed."}},"type":"object","required":["challenge_id","expires_at"],"title":"ChallengeOut"},"ChannelBatchOut":{"properties":{"added":{"items":{"$ref":"#/components/schemas/ChannelOut"},"type":"array","title":"Added"},"skipped":{"items":{"$ref":"#/components/schemas/SkippedRef"},"type":"array","title":"Skipped"}},"type":"object","required":["added","skipped"],"title":"ChannelBatchOut"},"ChannelIn":{"properties":{"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref","description":"A t.me link, @username, the Telegram id of a channel or group you have joined (the `id` from GET /v1/telegram/dialogs), or (with join) an invite link."},"refs":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Refs","description":"Several at once, in any of the forms of `ref` (typically Telegram ids from GET /v1/telegram/dialogs). Answers 200 with `added` and `skipped` instead of one channel."},"join":{"type":"boolean","title":"Join","description":"Join the channel with your Telegram user first.","default":false},"label":{"type":"string","maxLength":200,"title":"Label","default":""},"tags":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Tags"},"language":{"anyOf":[{"type":"string","pattern":"^[a-z]{2,3}$"},{"type":"null"}],"title":"Language","description":"Language hint, e.g. uk."},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","title":"ChannelIn","example":{"ref":"https://t.me/kyivnochnoy","tags":["nightlife"]}},"ChannelList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ChannelOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"ChannelList"},"ChannelOut":{"properties":{"id":{"type":"string","title":"Id"},"telegram_id":{"type":"integer","title":"Telegram Id","description":"Telegram's own permanent id of the channel or group."},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"title":{"type":"string","title":"Title"},"url":{"type":"string","title":"Url"},"is_private":{"type":"boolean","title":"Is Private"},"kind":{"type":"string","title":"Kind","description":"channel | group | private (a person) | bot","default":"channel"},"label":{"type":"string","title":"Label"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"enabled":{"type":"boolean","title":"Enabled"},"status":{"type":"string","title":"Status","description":"ok | error | inaccessible"},"last_message_id":{"type":"integer","title":"Last Message Id"},"last_collected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Collected At"},"last_post_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Post At"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"}},"type":"object","required":["id","telegram_id","username","title","url","is_private","label","tags","language","enabled","status","last_message_id","last_collected_at","last_post_at","consecutive_failures","last_error","created_at"],"title":"ChannelOut"},"ChannelPatch":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Tags"},"language":{"anyOf":[{"type":"string","pattern":"^[a-z]{2,3}$"},{"type":"null"}],"title":"Language"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"ChannelPatch","example":{"enabled":false}},"CodeIn":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"CodeIn","example":{"code":"12345"}},"CreateChannel":{"properties":{"title":{"type":"string","maxLength":128,"minLength":1,"title":"Title"},"about":{"type":"string","maxLength":255,"title":"About","default":""},"username":{"anyOf":[{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{4,31}$"},{"type":"null"}],"title":"Username","description":"Omit for private."}},"additionalProperties":false,"type":"object","required":["title"],"title":"CreateChannel"},"CredentialsIn":{"properties":{"api_id":{"type":"string","title":"Api Id","description":"From https://my.telegram.org → API development tools."},"api_hash":{"type":"string","title":"Api Hash"}},"type":"object","required":["api_id","api_hash"],"title":"CredentialsIn","example":{"api_hash":"0123456789abcdef0123456789abcdef","api_id":"1234567"}},"DeleteAccountIn":{"properties":{"confirm":{"type":"string","title":"Confirm","description":"The account's email address, to confirm deletion."}},"type":"object","required":["confirm"],"title":"DeleteAccountIn","example":{"confirm":"ops@example.com"}},"DialogList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DialogOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"DialogList"},"DialogOut":{"properties":{"id":{"type":"integer","title":"Id","description":"Telegram's own permanent id (titles and usernames can change). Pass it in `refs`/`ref` to POST /v1/channels, or as `chat` for a publish target."},"title":{"type":"string","title":"Title"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"kind":{"type":"string","title":"Kind","description":"channel | group | private (a person) | bot"},"is_private":{"type":"boolean","title":"Is Private","description":"No public username: readable because your user is a member."},"is_broadcast":{"type":"boolean","title":"Is Broadcast","description":"True for a channel, false for a group."},"can_post":{"type":"boolean","title":"Can Post","description":"Whether the logged-in user can post there."},"monitored":{"type":"boolean","title":"Monitored","description":"Already monitored by this account."},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"This account's channel id when monitored."}},"type":"object","required":["id","title","username","kind","is_private","is_broadcast","can_post","monitored"],"title":"DialogOut"},"EmailChangeIn":{"properties":{"new_email":{"type":"string","title":"New Email"}},"type":"object","required":["new_email"],"title":"EmailChangeIn","example":{"new_email":"new-ops@example.com"}},"EmailChangedOut":{"properties":{"email":{"type":"string","title":"Email"},"changed_at":{"type":"string","format":"date-time","title":"Changed At"}},"type":"object","required":["email","changed_at"],"title":"EmailChangedOut"},"EmailList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EmailOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"EmailList"},"EmailOut":{"properties":{"id":{"type":"string","title":"Id"},"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"purpose":{"type":"string","title":"Purpose"},"backend":{"type":"string","title":"Backend"},"status":{"type":"string","title":"Status"},"attempts":{"type":"integer","title":"Attempts"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Full text (email sink only)."},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"The one-time code in the message (email sink only)."}},"type":"object","required":["id","to","subject","purpose","backend","status","attempts","error","created_at","sent_at"],"title":"EmailOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Health":{"properties":{"status":{"type":"string","title":"Status"},"version":{"type":"string","title":"Version"},"database":{"type":"string","title":"Database"},"scheduler":{"type":"string","title":"Scheduler"}},"type":"object","required":["status","version","database","scheduler"],"title":"Health"},"InviteCreatedOut":{"properties":{"id":{"type":"string","title":"Id"},"note":{"type":"string","title":"Note"},"max_uses":{"type":"integer","title":"Max Uses"},"uses":{"type":"integer","title":"Uses"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"code":{"type":"string","title":"Code","description":"The invite code. Shown once."}},"type":"object","required":["id","note","max_uses","uses","expires_at","revoked_at","created_at","code"],"title":"InviteCreatedOut"},"InviteIn":{"properties":{"note":{"type":"string","maxLength":500,"title":"Note","default":""},"max_uses":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Max Uses","default":1},"expires_in_hours":{"anyOf":[{"type":"integer","maximum":8760.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Hours","description":"Null for no expiry.","default":168}},"type":"object","title":"InviteIn","example":{"expires_in_hours":168,"max_uses":1,"note":"kyivcool"}},"InviteList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InviteOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"InviteList"},"InviteOut":{"properties":{"id":{"type":"string","title":"Id"},"note":{"type":"string","title":"Note"},"max_uses":{"type":"integer","title":"Max Uses"},"uses":{"type":"integer","title":"Uses"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","note","max_uses","uses","expires_at","revoked_at","created_at"],"title":"InviteOut"},"ItemList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ItemOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"ItemList"},"ItemOut":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status","description":"active | cancelled | hidden"},"version":{"type":"integer","title":"Version"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"occurs_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurs At","description":"Local date or date-time (YYYY-MM-DD or YYYY-MM-DDTHH:MM)"},"occurs_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurs End"},"time_known":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Time Known"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"source_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Language"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data","description":"All extracted fields, original language"},"translations":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Translations","description":"e.g. {\"en\": {...}}"},"localized":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Localized","description":"With ?lang=: data with translated fields replaced"},"sources":{"anyOf":[{"items":{"$ref":"#/components/schemas/SourceOut"},"type":"array"},{"type":"null"}],"title":"Sources"},"first_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Seen At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","kind","status","version","updated_at"],"title":"ItemOut"},"ItemPatch":{"properties":{"status":{"anyOf":[{"type":"string","enum":["active","cancelled","hidden"]},{"type":"null"}],"title":"Status"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data","description":"Fields to correct; they are then locked against automatic updates."},"translations":{"anyOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object"},{"type":"null"}],"title":"Translations"}},"additionalProperties":false,"type":"object","title":"ItemPatch","example":{"data":{"venue":"ORIGIN STAGE"},"translations":{"en":{"venue":"ORIGIN STAGE"}}}},"KeyCreateIn":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"scope":{"type":"string","enum":["admin","read"],"title":"Scope"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"Optional expiry (UTC)."}},"type":"object","required":["name","scope"],"title":"KeyCreateIn","example":{"name":"website","scope":"read"}},"KeyCreatedOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scope":{"type":"string","title":"Scope"},"last4":{"type":"string","title":"Last4"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"key":{"type":"string","title":"Key","description":"The full API key. Shown once; store it now."}},"type":"object","required":["id","name","scope","last4","created_at","expires_at","last_used_at","revoked_at","key"],"title":"KeyCreatedOut"},"KeyList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KeyOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"KeyList"},"KeyOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scope":{"type":"string","title":"Scope"},"last4":{"type":"string","title":"Last4"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","scope","last4","created_at","expires_at","last_used_at","revoked_at"],"title":"KeyOut"},"LLMKeyIn":{"properties":{"provider":{"type":"string","enum":["anthropic","openai","gemini"],"title":"Provider"},"api_key":{"type":"string","maxLength":500,"minLength":10,"title":"Api Key"}},"additionalProperties":false,"type":"object","required":["provider","api_key"],"title":"LLMKeyIn","example":{"api_key":"sk-ant-…","provider":"anthropic"}},"LLMKeysOut":{"properties":{"keys":{"additionalProperties":true,"type":"object","title":"Keys","description":"Per provider: whether a key is stored (never the key)."}},"type":"object","required":["keys"],"title":"LLMKeysOut"},"LLMTestIn":{"properties":{"text":{"type":"string","maxLength":2000,"title":"Text","default":"Концерт у суботу о 19:00, вхід вільний."}},"additionalProperties":false,"type":"object","title":"LLMTestIn","example":{"text":"Концерт у суботу о 19:00"}},"LLMTestOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort"},"thinking":{"type":"string","title":"Thinking"},"latency_ms":{"type":"integer","title":"Latency Ms"},"sample":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sample"},"usage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Usage"},"stop":{"type":"string","title":"Stop"}},"type":"object","required":["ok","provider","model","effort","thinking","latency_ms","sample","usage","stop"],"title":"LLMTestOut"},"LoginIn":{"properties":{"phone":{"type":"string","title":"Phone","description":"International format, e.g. +380501234567."}},"type":"object","required":["phone"],"title":"LoginIn","example":{"phone":"+380501234567"}},"LoginOut":{"properties":{"status":{"type":"string","title":"Status"},"delivery":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery","description":"How Telegram sent the code (app, sms, …)."},"timeout_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeout Seconds"},"password_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password Hint"},"user":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User"}},"type":"object","required":["status"],"title":"LoginOut"},"NewKeyOut":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key","description":"The full API key. Shown once; store it now."},"name":{"type":"string","title":"Name"},"scope":{"type":"string","title":"Scope"}},"type":"object","required":["id","key","name","scope"],"title":"NewKeyOut"},"PasswordIn":{"properties":{"password":{"type":"string","maxLength":256,"minLength":1,"title":"Password","description":"Used once and never stored."}},"type":"object","required":["password"],"title":"PasswordIn","example":{"password":"your two-step password"}},"PostList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PostOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"PostList"},"PostOut":{"properties":{"id":{"type":"string","title":"Id"},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"tg_message_id":{"type":"integer","title":"Tg Message Id"},"url":{"type":"string","title":"Url"},"posted_at":{"type":"string","format":"date-time","title":"Posted At"},"text":{"type":"string","title":"Text"},"views":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Views"},"forwards":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Forwards"},"media":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Media","description":"Media type and count; `images_read` when photos were read by the AI (plan §23.2)."},"album_message_ids":{"items":{"type":"integer"},"type":"array","title":"Album Message Ids"},"forwarded_from":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Forwarded From"},"keyword_tags":{"items":{"type":"string"},"type":"array","title":"Keyword Tags"},"analysis_status":{"type":"string","title":"Analysis Status"},"skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skip Reason"},"analysis_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Error","description":"Why analysis failed (`analysis_status: failed`), or, on a `done` post, a note that an invalid record was dropped (`extraction.invalid_records`)."},"collected_at":{"type":"string","format":"date-time","title":"Collected At"}},"type":"object","required":["id","channel_id","channel","tg_message_id","url","posted_at","text","views","forwards","album_message_ids","forwarded_from","keyword_tags","analysis_status","skip_reason","collected_at"],"title":"PostOut"},"PresetList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PresetOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"PresetList"},"PresetOut":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"}},"type":"object","required":["name","description","settings"],"title":"PresetOut"},"Problem":{"properties":{"type":{"type":"string","title":"Type"},"title":{"type":"string","title":"Title"},"status":{"type":"integer","title":"Status"},"code":{"type":"string","title":"Code"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance"},"errors":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Errors"}},"type":"object","required":["type","title","status","code"],"title":"Problem","description":"Schema of every error response (for OpenAPI)."},"PublicationList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PublicationOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"PublicationList"},"PublicationOut":{"properties":{"id":{"type":"string","title":"Id"},"target_id":{"type":"string","title":"Target Id"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"roundup_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roundup Period"},"status":{"type":"string","title":"Status"},"tg_message_ids":{"items":{"type":"integer"},"type":"array","title":"Tg Message Ids"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["id","target_id","item_id","report_id","roundup_period","status","tg_message_ids","error","created_at","sent_at"],"title":"PublicationOut"},"PublishIn":{"properties":{"target_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Target Ids"},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"additionalProperties":false,"type":"object","title":"PublishIn","example":{"dry_run":true}},"PublishOut":{"properties":{"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"PublishOut"},"RecoveryIn":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"RecoveryIn","example":{"email":"ops@example.com"}},"RegisterIn":{"properties":{"invite_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite Code","description":"Required while REGISTRATION_MODE=invite."},"email":{"type":"string","title":"Email"},"name":{"type":"string","maxLength":200,"title":"Name","default":""}},"type":"object","required":["email"],"title":"RegisterIn","example":{"email":"ops@example.com","invite_code":"INV-7QK2-M9XD","name":"kyiv-events"}},"ReportList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ReportSummary"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"ReportList"},"ReportOut":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"title":{"type":"string","title":"Title"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"body_markdown":{"type":"string","title":"Body Markdown"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"stats":{"additionalProperties":true,"type":"object","title":"Stats"},"llm":{"additionalProperties":true,"type":"object","title":"Llm"}},"type":"object","required":["id","kind","title","period_start","period_end","status","created_at","body_markdown","data","stats","llm"],"title":"ReportOut"},"ReportSummary":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"title":{"type":"string","title":"Title"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","title","period_start","period_end","status","created_at"],"title":"ReportSummary"},"RetryIn":{"properties":{"post_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":200},{"type":"null"}],"title":"Post Ids","description":"Only these posts."},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"Only this channel's posts."},"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From","description":"Posted at or after (with offset)."},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To","description":"Posted before (with offset)."},"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","description":"Queue at most this many, newest first.","default":200}},"additionalProperties":false,"type":"object","title":"RetryIn","example":{"limit":50}},"RetryOut":{"properties":{"requeued":{"type":"integer","title":"Requeued"},"remaining_failed":{"type":"integer","title":"Remaining Failed","description":"Failed posts of this account still failed after this call."},"skipped":{"additionalProperties":{"type":"integer"},"type":"object","title":"Skipped","description":"Not queued, by reason: not_found, not_failed, filtered_out, extraction_off, chat_type_off, channel_removed_or_paused, private_not_allowed, not_reportable, no_keywords, past_retention, no_content."},"notices":{"items":{"type":"string"},"type":"array","title":"Notices"}},"type":"object","required":["requeued","remaining_failed","skipped","notices"],"title":"RetryOut"},"RunIn":{"properties":{"kind":{"type":"string","enum":["collect","report","publish"],"title":"Kind"},"channel_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Channel Ids","description":"collect: only these channels."},"target_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Target Ids","description":"publish: only these destinations."},"roundup":{"type":"boolean","title":"Roundup","description":"publish: post a round-up now.","default":false},"period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period Start","description":"report: window start (UTC)."},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End","description":"report: window end (UTC, exclusive)."},"dry_run":{"type":"boolean","title":"Dry Run","description":"publish: return what would be sent without sending.","default":false}},"additionalProperties":false,"type":"object","required":["kind"],"title":"RunIn","example":{"kind":"collect"}},"RunList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RunOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"RunList"},"RunOut":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"trigger":{"type":"string","title":"Trigger"},"status":{"type":"string","title":"Status","description":"queued | running | succeeded | partial | failed | deferred"},"run_at":{"type":"string","format":"date-time","title":"Run At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"stats":{"additionalProperties":true,"type":"object","title":"Stats"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","trigger","status","run_at","started_at","finished_at","params","stats","error","created_at"],"title":"RunOut"},"SettingsOut":{"properties":{"settings":{"additionalProperties":true,"type":"object","title":"Settings","description":"Effective settings: your changes plus every default."},"requeued_posts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requeued Posts","description":"Posts put back in the queue by this change: text-less or short posts when `media.read_images` was widened, and private ones inside `extraction.private_backfill_days` when cloud analysis of private chats was allowed."},"notices":{"items":{"type":"string"},"type":"array","title":"Notices","description":"What to know about groups and private chats (whether they reach a cloud AI, stay local, or stay out of reports and posts) and about a weekly report keeping posts longer."}},"type":"object","required":["settings"],"title":"SettingsOut"},"SkippedRef":{"properties":{"ref":{"type":"string","title":"Ref"},"code":{"type":"string","title":"Code","description":"Error code, e.g. duplicate, channel_not_found, channel_private."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["ref","code"],"title":"SkippedRef"},"SourceOut":{"properties":{"post_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Post Id"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"url":{"type":"string","title":"Url"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"}},"type":"object","required":["post_id","channel","url","posted_at"],"title":"SourceOut"},"TargetIn":{"properties":{"chat":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat","description":"@username, t.me link, or numeric id (-100… for channels)."},"create_channel":{"anyOf":[{"$ref":"#/components/schemas/CreateChannel"},{"type":"null"}],"description":"Create a new channel with your logged-in Telegram user and post there."},"make_bot_admin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Make Bot Admin","description":"Make the bot an administrator if it cannot post (default: publish.auto_make_bot_admin)."},"bot_admin_rights":{"anyOf":[{"items":{"type":"string","enum":["post_messages","edit_messages","delete_messages"]},"type":"array"},{"type":"null"}],"title":"Bot Admin Rights","description":"Default: publish.bot_admin_rights."},"via":{"type":"string","enum":["bot","user"],"title":"Via","default":"bot"},"content":{"type":"string","enum":["items","reports","both"],"title":"Content","default":"items"},"item_mode":{"type":"string","enum":["each","roundup","both"],"title":"Item Mode","default":"each"},"roundup":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Roundup","description":"mode daily|weekly, at HH:MM, day, days_ahead, title, line_template, max_items"},"item_template":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Item Template","description":"Message layout with {field} placeholders."},"language":{"type":"string","pattern":"^(original|[a-z]{2,3})$","title":"Language","default":"original"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","title":"TargetIn","example":{"chat":"@my_events_channel","content":"items","item_mode":"each","language":"en","via":"bot"}},"TargetList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TargetOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"TargetList"},"TargetOut":{"properties":{"id":{"type":"string","title":"Id"},"chat":{"type":"string","title":"Chat"},"title":{"type":"string","title":"Title"},"via":{"type":"string","title":"Via"},"content":{"type":"string","title":"Content"},"item_mode":{"type":"string","title":"Item Mode"},"roundup":{"additionalProperties":true,"type":"object","title":"Roundup"},"item_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Template"},"language":{"type":"string","title":"Language"},"enabled":{"type":"boolean","title":"Enabled"},"last_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Verified At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"notice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notice"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"}},"type":"object","required":["id","chat","title","via","content","item_mode","roundup","item_template","language","enabled","last_verified_at","created_at"],"title":"TargetOut"},"TargetPatch":{"properties":{"content":{"anyOf":[{"type":"string","enum":["items","reports","both"]},{"type":"null"}],"title":"Content"},"item_mode":{"anyOf":[{"type":"string","enum":["each","roundup","both"]},{"type":"null"}],"title":"Item Mode"},"roundup":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Roundup"},"item_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Template"},"language":{"anyOf":[{"type":"string","pattern":"^(original|[a-z]{2,3})$"},{"type":"null"}],"title":"Language"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"TargetPatch","example":{"item_mode":"both","roundup":{"at":"10:00"}}},"TelegramChunks":{"properties":{"chunks":{"items":{"type":"string"},"type":"array","title":"Chunks","description":"Telegram HTML messages, each at most 4096 characters, tags never split."}},"type":"object","required":["chunks"],"title":"TelegramChunks"},"TelegramStatus":{"properties":{"status":{"type":"string","title":"Status","description":"not_configured | credentials_set | code_sent | password_required | authorized | reauth_required"},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials"},"phone":{"additionalProperties":true,"type":"object","title":"Phone"},"user":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User"},"cooldown_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cooldown Until"},"bot":{"additionalProperties":true,"type":"object","title":"Bot"}},"type":"object","required":["status","credentials","phone","user","cooldown_until","bot"],"title":"TelegramStatus"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifiedOut":{"properties":{"account":{"$ref":"#/components/schemas/AccountOut"},"api_key":{"anyOf":[{"$ref":"#/components/schemas/NewKeyOut"},{"type":"null"}]},"active_key_count":{"type":"integer","title":"Active Key Count"},"notice":{"type":"string","title":"Notice"}},"type":"object","required":["account","active_key_count","notice"],"title":"VerifiedOut"},"VerifyIn":{"properties":{"code":{"type":"string","maxLength":32,"minLength":6,"title":"Code"},"revoke_existing_keys":{"type":"boolean","title":"Revoke Existing Keys","description":"Recovery only: revoke every other key of the account.","default":false}},"type":"object","required":["code"],"title":"VerifyIn","example":{"code":"K7M2Q-9XD4R"}}},"securitySchemes":{"ApiKeyRead":{"type":"http","description":"Any API key (admin or read). Read keys see results only: account summary, channels, posts, items, reports, presets.","scheme":"bearer","bearerFormat":"tsk_<key_id>_<secret>"},"ApiKeyAdmin":{"type":"http","description":"An API key with scope `admin`.","scheme":"bearer","bearerFormat":"tsk_<key_id>_<secret>"},"OperatorKey":{"type":"apiKey","description":"The operator key configured on the server. Operator endpoints are disabled when it is unset.","in":"header","name":"X-Operator-Key"}}},"tags":[{"name":"System","description":"Health and documentation."},{"name":"Account","description":"Register with an invite and an emailed code, recover access, manage the account."},{"name":"API keys","description":"Admin and read-only keys."},{"name":"Telegram","description":"Connect your own Telegram user: app credentials, login code, two-step password."},{"name":"Settings","description":"Per-account settings document and presets."},{"name":"AI","description":"AI provider keys (encrypted, never returned) and a one-call test."},{"name":"Channels","description":"Channels to monitor: add, list, edit, pause, remove."},{"name":"Runs","description":"Run a collection, report or publish now; run history."},{"name":"Posts","description":"Raw collected posts."},{"name":"Items","description":"Structured results: events, narratives, ... in the original language and English."},{"name":"Reports","description":"Digests over a time window, as JSON, Markdown or Telegram HTML."},{"name":"Publishing","description":"Post items, round-ups and reports to Telegram as your bot or your user."},{"name":"Operator","description":"Server operator endpoints, authenticated with X-Operator-Key."}]}