{"components":{"parameters":{"AttachedChannelID":{"description":"Attached channel identifier.","in":"path","name":"id","required":true,"schema":{"type":"string"}},"BotID":{"description":"Bot identifier.","in":"path","name":"id","required":true,"schema":{"type":"string"}},"ChannelID":{"description":"Channel identifier.","in":"path","name":"channelId","required":true,"schema":{"type":"string"}},"Limit":{"description":"Maximum number of items to return.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},"Offset":{"description":"Return updates with `update_id \u003e offset`.","in":"query","name":"offset","required":false,"schema":{"minimum":0,"type":"integer"}},"ReplayLimit":{"description":"Maximum number of failed updates to requeue.","in":"query","name":"limit","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},"Timeout":{"description":"Long polling timeout in seconds. Current maximum is 30 seconds.","in":"query","name":"timeout","required":false,"schema":{"maximum":30,"minimum":0,"type":"integer"}}},"responses":{"BadRequestError":{"content":{"application/json":{"example":{"error":"malformed input or invalid parameter value"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Malformed input or invalid parameter value."},"ForbiddenError":{"content":{"application/json":{"example":{"error":"authenticated but not allowed to perform this action"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Authenticated but not allowed to perform this action."},"NotFoundError":{"content":{"application/json":{"example":{"error":"referenced resource was not found"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Referenced resource was not found."},"TooManyRequestsError":{"content":{"application/json":{"example":{"error":"rate limit exceeded"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limit exceeded."},"UnauthorizedError":{"content":{"application/json":{"example":{"error":"missing or invalid bearer token"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer token."}},"schemas":{"AttachChannelResult":{"properties":{"attached_by":{"type":"string"},"bot_id":{"type":"string"},"channel_id":{"type":"string"},"role":{"type":"string"}},"type":"object"},"Bot":{"properties":{"bot_user_id":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"description":{"type":"string"},"disabled_at":{"format":"date-time","type":"string"},"display_name":{"type":"string"},"id":{"type":"string"},"owner_user_id":{"type":"string"},"updated_at":{"format":"date-time","type":"string"},"username":{"type":"string"},"webhook_url":{"type":"string"}},"type":"object"},"BotChannel":{"properties":{"bot_role":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"description":{"type":"string"},"id":{"type":"string"},"last_activity_at":{"format":"date-time","type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"type":"object"},"BotChannelListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BotChannel"},"type":"array"}},"type":"object"},"BotIdentity":{"properties":{"bot_user_id":{"type":"string"},"display_name":{"type":"string"},"id":{"type":"string"},"username":{"type":"string"}},"type":"object"},"BotListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Bot"},"type":"array"}},"type":"object"},"BotPost":{"properties":{"author_username":{"type":"string"},"body":{"type":"string"},"channel_id":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"}},"type":"object"},"BotStats":{"properties":{"attached_channel_count":{"type":"integer"},"bot_id":{"type":"string"},"delivered_updates":{"type":"integer"},"last_attempted_at":{"format":"date-time","type":"string"},"last_delivered_at":{"format":"date-time","type":"string"},"last_update_at":{"format":"date-time","type":"string"},"pending_updates":{"type":"integer"},"scheduled_retries":{"type":"integer"},"terminal_failed_updates":{"type":"integer"},"total_updates":{"type":"integer"}},"type":"object"},"BotToken":{"properties":{"created_at":{"format":"date-time","type":"string"},"token":{"type":"string"}},"type":"object"},"BotUpdate":{"properties":{"created_at":{"format":"date-time","type":"string"},"event_type":{"type":"string"},"payload":{"additionalProperties":true,"type":"object"},"update_id":{"type":"integer"}},"type":"object"},"BotUpdateListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BotUpdate"},"type":"array"}},"type":"object"},"BotWithToken":{"properties":{"bot":{"$ref":"#/components/schemas/Bot"},"token":{"$ref":"#/components/schemas/BotToken"}},"type":"object"},"CreateBotRequest":{"properties":{"description":{"type":"string"},"display_name":{"type":"string"},"username":{"type":"string"}},"required":["username"],"type":"object"},"CreateChannelPostRequest":{"properties":{"body":{"type":"string"},"media":{"items":{"type":"object"},"type":"array"}},"required":["body"],"type":"object"},"DeleteStatus":{"properties":{"status":{"type":"string"}},"type":"object"},"Error":{"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"},"OwnerUpdate":{"properties":{"created_at":{"format":"date-time","type":"string"},"delivered_webhook_at":{"format":"date-time","type":"string"},"event_type":{"type":"string"},"last_attempted_at":{"format":"date-time","type":"string"},"last_delivery_error":{"type":"string"},"next_retry_at":{"format":"date-time","type":"string"},"payload":{"additionalProperties":true,"type":"object"},"update_id":{"type":"integer"},"webhook_attempt_count":{"type":"integer"}},"type":"object"},"OwnerUpdateListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OwnerUpdate"},"type":"array"}},"type":"object"},"PutWebhookRequest":{"properties":{"secret_token":{"type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"ReplayResult":{"properties":{"bot_id":{"type":"string"},"max_window":{"type":"integer"},"requeued":{"type":"integer"}},"type":"object"},"WebhookConfig":{"properties":{"has_secret_token":{"type":"boolean"},"last_attempted_at":{"format":"date-time","type":"string"},"last_delivered_at":{"format":"date-time","type":"string"},"last_delivery_error":{"type":"string"},"next_retry_at":{"format":"date-time","type":"string"},"pending_update_count":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"WebhookError":{"properties":{"created_at":{"format":"date-time","type":"string"},"delivered_webhook_at":{"format":"date-time","type":"string"},"event_type":{"type":"string"},"last_attempted_at":{"format":"date-time","type":"string"},"last_delivery_error":{"type":"string"},"next_retry_at":{"format":"date-time","type":"string"},"update_id":{"type":"integer"},"webhook_attempt_count":{"type":"integer"}},"type":"object"},"WebhookErrorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WebhookError"},"type":"array"}},"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT or bot token","scheme":"bearer","type":"http"}}},"info":{"description":"Public reference for owner-side management and bot-token runtime endpoints.","title":"Bot API Docs","version":"v1"},"openapi":"3.1.0","paths":{"/v1/bot-api/bots":{"get":{"description":"Returns every bot owned by the current account.","responses":{"200":{"content":{"application/json":{"example":{"items":[{"bot_user_id":"b63c...","created_at":"2026-04-21T10:00:00Z","description":"Publishes Russia news","display_name":"News Bot Russia","id":"7f9d...","owner_user_id":"25c0...","updated_at":"2026-04-21T10:30:00Z","username":"newsbot_russia_v1","webhook_url":"https://bot.example.test/webhook"}]},"schema":{"$ref":"#/components/schemas/BotListResponse"}}},"description":"Returns every bot owned by the current account."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"List bots","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots","id":"list-bots","request_example":null,"response_example":{"items":[{"bot_user_id":"b63c...","created_at":"2026-04-21T10:00:00Z","description":"Publishes Russia news","display_name":"News Bot Russia","id":"7f9d...","owner_user_id":"25c0...","updated_at":"2026-04-21T10:30:00Z","username":"newsbot_russia_v1","webhook_url":"https://bot.example.test/webhook"}]},"surface":"owner"}},"post":{"description":"Creates a new bot and returns the initial token once.","requestBody":{"content":{"application/json":{"example":{"description":"Publishes verified news","display_name":"News Bot","username":"news_tatarstan_bot"},"schema":{"$ref":"#/components/schemas/CreateBotRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"bot":{"bot_user_id":"b63c...","created_at":"2026-04-21T10:00:00Z","description":"Publishes verified news","display_name":"News Bot","id":"7f9d...","owner_user_id":"25c0...","updated_at":"2026-04-21T10:00:00Z","username":"news_tatarstan_bot"},"token":{"created_at":"2026-04-21T10:00:00Z","token":"bot_..."}},"schema":{"$ref":"#/components/schemas/BotWithToken"}}},"description":"Creates a new bot and returns the initial token once."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Create bot","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -X POST https://api.yullama.ru/v1/bot-api/bots \\\n  -H \"Authorization: Bearer \u003cowner_token\u003e\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"news_tatarstan_bot\",\"display_name\":\"News Bot\",\"description\":\"Publishes verified news\"}'","id":"create-bot","request_example":{"description":"Publishes verified news","display_name":"News Bot","username":"news_tatarstan_bot"},"response_example":{"bot":{"bot_user_id":"b63c...","created_at":"2026-04-21T10:00:00Z","description":"Publishes verified news","display_name":"News Bot","id":"7f9d...","owner_user_id":"25c0...","updated_at":"2026-04-21T10:00:00Z","username":"news_tatarstan_bot"},"token":{"created_at":"2026-04-21T10:00:00Z","token":"bot_..."}},"surface":"owner"}}},"/v1/bot-api/bots/{id}":{"get":{"description":"Returns one bot owned by the current account.","parameters":[{"$ref":"#/components/parameters/BotID"}],"responses":{"200":{"content":{"application/json":{"example":{"bot_user_id":"b63c...","created_at":"2026-04-21T10:00:00Z","description":"Publishes Russia news","display_name":"News Bot Russia","id":"7f9d...","owner_user_id":"25c0...","updated_at":"2026-04-21T10:30:00Z","username":"newsbot_russia_v1","webhook_url":"https://bot.example.test/webhook"},"schema":{"$ref":"#/components/schemas/Bot"}}},"description":"Returns one bot owned by the current account."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Get bot","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e","id":"get-bot","request_example":null,"response_example":{"bot_user_id":"b63c...","created_at":"2026-04-21T10:00:00Z","description":"Publishes Russia news","display_name":"News Bot Russia","id":"7f9d...","owner_user_id":"25c0...","updated_at":"2026-04-21T10:30:00Z","username":"newsbot_russia_v1","webhook_url":"https://bot.example.test/webhook"},"surface":"owner"}}},"/v1/bot-api/bots/{id}/channels":{"get":{"description":"Lists channels attached to one bot.","parameters":[{"$ref":"#/components/parameters/BotID"}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"bot_role":"moderator","created_at":"2026-04-21T10:00:00Z","description":"Owned channel for bot publishing","id":"22d6...","slug":"news-russia","title":"News Russia"}]},"schema":{"$ref":"#/components/schemas/BotChannelListResponse"}}},"description":"Lists channels attached to one bot."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"List attached channels","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/channels","id":"list-owned-channels","request_example":null,"response_example":{"items":[{"bot_role":"moderator","created_at":"2026-04-21T10:00:00Z","description":"Owned channel for bot publishing","id":"22d6...","slug":"news-russia","title":"News Russia"}]},"surface":"owner"}}},"/v1/bot-api/bots/{id}/channels/{channelId}":{"post":{"description":"Attaches a bot to one owned channel with moderator role.","parameters":[{"$ref":"#/components/parameters/BotID"},{"$ref":"#/components/parameters/ChannelID"}],"responses":{"200":{"content":{"application/json":{"example":{"attached_by":"25c0...","bot_id":"7f9d...","channel_id":"22d6...","role":"moderator"},"schema":{"$ref":"#/components/schemas/AttachChannelResult"}}},"description":"Attaches a bot to one owned channel with moderator role."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Attach bot to channel","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -X POST https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/channels/\u003cchannel_id\u003e \\\n  -H \"Authorization: Bearer \u003cowner_token\u003e\"","id":"attach-channel","request_example":null,"response_example":{"attached_by":"25c0...","bot_id":"7f9d...","channel_id":"22d6...","role":"moderator"},"surface":"owner"}}},"/v1/bot-api/bots/{id}/stats":{"get":{"description":"Returns queue and delivery counters for one bot.","parameters":[{"$ref":"#/components/parameters/BotID"}],"responses":{"200":{"content":{"application/json":{"example":{"attached_channel_count":2,"bot_id":"7f9d...","delivered_updates":16,"last_attempted_at":"2026-04-21T10:42:02Z","last_delivered_at":"2026-04-21T10:42:02Z","last_update_at":"2026-04-21T10:42:00Z","pending_updates":1,"scheduled_retries":1,"terminal_failed_updates":1,"total_updates":18},"schema":{"$ref":"#/components/schemas/BotStats"}}},"description":"Returns queue and delivery counters for one bot."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Bot stats","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/stats","id":"bot-stats","request_example":null,"response_example":{"attached_channel_count":2,"bot_id":"7f9d...","delivered_updates":16,"last_attempted_at":"2026-04-21T10:42:02Z","last_delivered_at":"2026-04-21T10:42:02Z","last_update_at":"2026-04-21T10:42:00Z","pending_updates":1,"scheduled_retries":1,"terminal_failed_updates":1,"total_updates":18},"surface":"owner"}}},"/v1/bot-api/bots/{id}/token":{"post":{"description":"Issues a new bot token and invalidates the previous one.","parameters":[{"$ref":"#/components/parameters/BotID"}],"responses":{"200":{"content":{"application/json":{"example":{"created_at":"2026-04-21T10:30:00Z","token":"bot_..."},"schema":{"$ref":"#/components/schemas/BotToken"}}},"description":"Issues a new bot token and invalidates the previous one."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Rotate bot token","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -X POST https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/token -H \"Authorization: Bearer \u003cowner_token\u003e\"","id":"rotate-token","request_example":null,"response_example":{"created_at":"2026-04-21T10:30:00Z","token":"bot_..."},"surface":"owner"}}},"/v1/bot-api/bots/{id}/updates":{"get":{"description":"Returns recent bot_api_updates rows with payload and delivery state.","parameters":[{"$ref":"#/components/parameters/BotID"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":"2026-04-21T10:42:00Z","delivered_webhook_at":"2026-04-21T10:42:02Z","event_type":"channel.post_created","last_attempted_at":"2026-04-21T10:42:02Z","last_delivery_error":"","payload":{"body":"Owner update for history","channel_id":"22d6...","post_id":"90ab..."},"update_id":41,"webhook_attempt_count":1}]},"schema":{"$ref":"#/components/schemas/OwnerUpdateListResponse"}}},"description":"Returns recent bot_api_updates rows with payload and delivery state."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Recent updates","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/updates?limit=20","id":"bot-updates","request_example":null,"response_example":{"items":[{"created_at":"2026-04-21T10:42:00Z","delivered_webhook_at":"2026-04-21T10:42:02Z","event_type":"channel.post_created","last_attempted_at":"2026-04-21T10:42:02Z","last_delivery_error":"","payload":{"body":"Owner update for history","channel_id":"22d6...","post_id":"90ab..."},"update_id":41,"webhook_attempt_count":1}]},"surface":"owner"}}},"/v1/bot-api/bots/{id}/webhook":{"delete":{"description":"Disables webhook delivery for one bot.","parameters":[{"$ref":"#/components/parameters/BotID"}],"responses":{"200":{"content":{"application/json":{"example":{"status":"ok"},"schema":{"$ref":"#/components/schemas/DeleteStatus"}}},"description":"Disables webhook delivery for one bot."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Delete webhook config","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -X DELETE https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/webhook -H \"Authorization: Bearer \u003cowner_token\u003e\"","id":"delete-webhook","request_example":null,"response_example":{"status":"ok"},"surface":"owner"}},"get":{"description":"Returns webhook URL, secret presence, and delivery health.","parameters":[{"$ref":"#/components/parameters/BotID"}],"responses":{"200":{"content":{"application/json":{"example":{"has_secret_token":true,"last_attempted_at":"2026-04-21T10:42:02Z","last_delivered_at":"2026-04-21T10:42:02Z","last_delivery_error":"","next_retry_at":null,"pending_update_count":0,"url":"https://bot.example.test/webhook"},"schema":{"$ref":"#/components/schemas/WebhookConfig"}}},"description":"Returns webhook URL, secret presence, and delivery health."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Get webhook config","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/webhook","id":"get-webhook","request_example":null,"response_example":{"has_secret_token":true,"last_attempted_at":"2026-04-21T10:42:02Z","last_delivered_at":"2026-04-21T10:42:02Z","last_delivery_error":"","next_retry_at":null,"pending_update_count":0,"url":"https://bot.example.test/webhook"},"surface":"owner"}},"put":{"description":"Sets webhook URL and optional secret token.","parameters":[{"$ref":"#/components/parameters/BotID"}],"requestBody":{"content":{"application/json":{"example":{"secret_token":"secret-123","url":"https://bot.example.test/webhook"},"schema":{"$ref":"#/components/schemas/PutWebhookRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"has_secret_token":true,"last_attempted_at":"2026-04-21T10:42:02Z","last_delivered_at":"2026-04-21T10:42:02Z","last_delivery_error":"","next_retry_at":null,"pending_update_count":0,"url":"https://bot.example.test/webhook"},"schema":{"$ref":"#/components/schemas/WebhookConfig"}}},"description":"Sets webhook URL and optional secret token."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Update webhook config","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -X PUT https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/webhook \\\n  -H \"Authorization: Bearer \u003cowner_token\u003e\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"https://bot.example.test/webhook\",\"secret_token\":\"secret-123\"}'","id":"put-webhook","request_example":{"secret_token":"secret-123","url":"https://bot.example.test/webhook"},"response_example":{"has_secret_token":true,"last_attempted_at":"2026-04-21T10:42:02Z","last_delivered_at":"2026-04-21T10:42:02Z","last_delivery_error":"","next_retry_at":null,"pending_update_count":0,"url":"https://bot.example.test/webhook"},"surface":"owner"}}},"/v1/bot-api/bots/{id}/webhook/errors":{"get":{"description":"Returns concrete webhook delivery failures.","parameters":[{"$ref":"#/components/parameters/BotID"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":"2026-04-21T10:52:00Z","event_type":"channel.post_created","last_attempted_at":"2026-04-21T10:52:02Z","last_delivery_error":"500 Internal Server Error","next_retry_at":"2026-04-21T10:52:04Z","update_id":44,"webhook_attempt_count":1}]},"schema":{"$ref":"#/components/schemas/WebhookErrorListResponse"}}},"description":"Returns concrete webhook delivery failures."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Webhook error log","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -H \"Authorization: Bearer \u003cowner_token\u003e\" https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/webhook/errors?limit=20","id":"webhook-errors","request_example":null,"response_example":{"items":[{"created_at":"2026-04-21T10:52:00Z","event_type":"channel.post_created","last_attempted_at":"2026-04-21T10:52:02Z","last_delivery_error":"500 Internal Server Error","next_retry_at":"2026-04-21T10:52:04Z","update_id":44,"webhook_attempt_count":1}]},"surface":"owner"}}},"/v1/bot-api/bots/{id}/webhook/replay":{"post":{"description":"Resets failed rows back into the delivery queue.","parameters":[{"$ref":"#/components/parameters/BotID"},{"$ref":"#/components/parameters/ReplayLimit"}],"responses":{"200":{"content":{"application/json":{"example":{"bot_id":"7f9d...","max_window":6,"requeued":3},"schema":{"$ref":"#/components/schemas/ReplayResult"}}},"description":"Resets failed rows back into the delivery queue."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Replay failed webhook deliveries","tags":["owner"],"x-yullama-docs":{"auth":"Bearer owner token","curl_example":"curl -X POST \"https://api.yullama.ru/v1/bot-api/bots/\u003cbot_id\u003e/webhook/replay?limit=100\" \\\n  -H \"Authorization: Bearer \u003cowner_token\u003e\"","id":"replay-webhook","request_example":null,"response_example":{"bot_id":"7f9d...","max_window":6,"requeued":3},"surface":"owner"}}},"/v1/bot-api/channels":{"get":{"description":"Lists channels available to the current bot token.","responses":{"200":{"content":{"application/json":{"example":{"items":[{"bot_role":"moderator","created_at":"2026-04-21T10:00:00Z","description":"Owned channel for bot publishing","id":"22d6...","slug":"news-russia","title":"News Russia"}]},"schema":{"$ref":"#/components/schemas/BotChannelListResponse"}}},"description":"Lists channels available to the current bot token."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"List bot channels","tags":["bot-runtime"],"x-yullama-docs":{"auth":"Bearer bot token","curl_example":"curl -H \"Authorization: Bearer \u003cbot_token\u003e\" https://api.yullama.ru/v1/bot-api/channels","id":"bot-channels","request_example":null,"response_example":{"items":[{"bot_role":"moderator","created_at":"2026-04-21T10:00:00Z","description":"Owned channel for bot publishing","id":"22d6...","slug":"news-russia","title":"News Russia"}]},"surface":"bot"}}},"/v1/bot-api/channels/{id}/posts":{"post":{"description":"Publishes a post as the bot into an attached channel.","parameters":[{"$ref":"#/components/parameters/AttachedChannelID"}],"requestBody":{"content":{"application/json":{"example":{"body":"Bot API production news update"},"schema":{"$ref":"#/components/schemas/CreateChannelPostRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"author_username":"newsbot_russia_v1","body":"Bot API production news update","channel_id":"22d6...","created_at":"2026-04-21T10:55:00Z","id":"90ab..."},"schema":{"$ref":"#/components/schemas/BotPost"}}},"description":"Publishes a post as the bot into an attached channel."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Create channel post","tags":["bot-runtime"],"x-yullama-docs":{"auth":"Bearer bot token","curl_example":"curl -X POST https://api.yullama.ru/v1/bot-api/channels/\u003cchannel_id\u003e/posts \\\n  -H \"Authorization: Bearer \u003cbot_token\u003e\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"body\":\"Bot API production news update\"}'","id":"bot-create-post","request_example":{"body":"Bot API production news update"},"response_example":{"author_username":"newsbot_russia_v1","body":"Bot API production news update","channel_id":"22d6...","created_at":"2026-04-21T10:55:00Z","id":"90ab..."},"surface":"bot"}}},"/v1/bot-api/me":{"get":{"description":"Returns bot identity for the current bot token.","responses":{"200":{"content":{"application/json":{"example":{"bot_user_id":"b63c...","display_name":"News Bot Russia","id":"7f9d...","username":"newsbot_russia_v1"},"schema":{"$ref":"#/components/schemas/BotIdentity"}}},"description":"Returns bot identity for the current bot token."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Get current bot","tags":["bot-runtime"],"x-yullama-docs":{"auth":"Bearer bot token","curl_example":"curl -H \"Authorization: Bearer \u003cbot_token\u003e\" https://api.yullama.ru/v1/bot-api/me","id":"bot-me","request_example":null,"response_example":{"bot_user_id":"b63c...","display_name":"News Bot Russia","id":"7f9d...","username":"newsbot_russia_v1"},"surface":"bot"}}},"/v1/bot-api/updates":{"get":{"description":"Consumes bot events using offset/limit/timeout semantics.","parameters":[{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Timeout"}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":"2026-04-21T10:42:00Z","event_type":"channel.post_created","payload":{"body":"Owner published to channel","channel_id":"22d6...","post_id":"90ab..."},"update_id":41}]},"schema":{"$ref":"#/components/schemas/BotUpdateListResponse"}}},"description":"Consumes bot events using offset/limit/timeout semantics."},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"}},"security":[{"bearerAuth":[]}],"summary":"Poll updates","tags":["bot-runtime"],"x-yullama-docs":{"auth":"Bearer bot token","curl_example":"curl -H \"Authorization: Bearer \u003cbot_token\u003e\" \"https://api.yullama.ru/v1/bot-api/updates?offset=0\u0026limit=50\u0026timeout=30\"","id":"bot-updates-polling","request_example":null,"response_example":{"items":[{"created_at":"2026-04-21T10:42:00Z","event_type":"channel.post_created","payload":{"body":"Owner published to channel","channel_id":"22d6...","post_id":"90ab..."},"update_id":41}]},"surface":"bot"}}}},"servers":[{"url":"https://api.yullama.ru"}],"tags":[{"description":"Owner-side Bot API management endpoints.","name":"owner"},{"description":"Bot-token runtime endpoints used by deployed bot services.","name":"bot-runtime"}]}
