{"openapi":"3.1.0","info":{"title":"Repost MultiPlatform Public API","version":"2026-09-22","description":"Versioned server-to-server API. Operations require a scoped Bearer API key. Delivery status is reported separately for each target.","contact":{"name":"Repost MultiPlatform","url":"https://repost.anmalishev.ru"}},"servers":[{"url":"/api/v1"}],"tags":[{"name":"Meta","description":"API version and runtime metadata"},{"name":"Bundles","description":"Source-to-destination publishing rules"},{"name":"Publications","description":"Immediate and scheduled delivery jobs"},{"name":"Analytics","description":"Published posts and available metric snapshots"},{"name":"Webhooks","description":"Signed outbound event subscriptions"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"rmp_live API key"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"object","additionalProperties":true}}},"Page":{"type":"object","required":["limit","nextCursor"],"properties":{"limit":{"type":"integer","minimum":1,"maximum":200},"nextCursor":{"type":["string","null"]}}},"BundleReceiver":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","enum":["vk_group","vk_max","whatsapp","telegram","zen"]},"targetId":{"type":"string","maxLength":200},"integrationId":{"type":"string","maxLength":200}}},"BundleInput":{"type":"object","required":["sourceName","sourceChannel","receivers"],"properties":{"sourceName":{"type":"string","minLength":1,"maxLength":200},"sourceChannel":{"type":"string","minLength":1,"maxLength":200},"receivers":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/BundleReceiver"}}}},"Bundle":{"allOf":[{"$ref":"#/components/schemas/BundleInput"},{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","paused","error"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}]},"Platform":{"type":"string","enum":["vk_group","vk_max","whatsapp","telegram","zen","instagram","facebook_page","threads","tiktok","youtube","rutube","pinterest","vk_video"]},"PublicationTarget":{"type":"object","required":["platform"],"properties":{"platform":{"$ref":"#/components/schemas/Platform"},"targetId":{"type":"string","maxLength":200},"integrationId":{"type":"string","maxLength":200},"name":{"type":"string","minLength":1,"maxLength":200},"textOverride":{"type":"string","maxLength":20000}}},"Media":{"type":"object","required":["type","url"],"properties":{"type":{"type":"string","enum":["photo","video","document"]},"url":{"type":"string","format":"uri","maxLength":2000}}},"PublicationInput":{"type":"object","required":["text","targets"],"properties":{"text":{"type":"string","minLength":1,"maxLength":20000},"scheduledAt":{"type":"string","format":"date-time"},"bundleId":{"type":"string","maxLength":200},"targets":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/PublicationTarget"}},"media":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/Media"}}}},"Delivery":{"type":"object","properties":{"id":{"type":"string"},"platform":{"$ref":"#/components/schemas/Platform"},"status":{"type":"string","enum":["pending","processing","published","failed","cancelled"]},"targetId":{"type":"string"},"externalPostId":{"type":"string"},"error":{"type":"string"}}},"WebhookInput":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://","maxLength":2000},"events":{"type":"array","minItems":1,"maxItems":4,"uniqueItems":true,"items":{"type":"string","enum":["publication.queued","delivery.published","delivery.failed","delivery.cancelled"]}}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"createdAt":{"type":"string","format":"date-time"}}},"ApiMetadata":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"database":{"type":"string","enum":["available","unavailable"]},"documentation":{"type":"string"},"resources":{"type":"array","items":{"type":"string"}}}}},"parameters":{"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":100}},"AnalyticsLimit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},"Platform":{"name":"platform","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Platform"}},"Id":{"name":"id","in":"path","required":true,"schema":{"type":"string"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Required for POST /publications. Replays the original result for 24 hours per API credential.","schema":{"type":"string","minLength":1,"maxLength":255}}},"responses":{"Unauthorized":{"description":"Missing, invalid, expired, or revoked Bearer key","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"API key is missing the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Per-key rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"Database is unavailable; the write was not accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"security":[{"bearerAuth":[]}],"paths":{"/":{"get":{"tags":["Meta"],"summary":"Get API metadata","description":"Requires bundles:read.","x-required-scope":"bundles:read","responses":{"200":{"description":"API metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiMetadata"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/bundles":{"get":{"tags":["Bundles"],"summary":"List bundles","x-required-scope":"bundles:read","parameters":[{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Bundle page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Bundle"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"tags":["Bundles"],"summary":"Create a bundle","x-required-scope":"bundles:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BundleInput"}}}},"responses":{"201":{"description":"Created bundle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bundle"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/publications":{"get":{"tags":["Publications"],"summary":"List delivery jobs","x-required-scope":"publications:read","parameters":[{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Delivery page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"page":{"$ref":"#/components/schemas/Page"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"tags":["Publications"],"summary":"Queue or schedule publication deliveries","description":"Scheduled requests return 201; immediate requests return 202. Each target gets a separate delivery. Platform/API availability is evaluated by the worker.","x-required-scope":"publications:write","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationInput"}}}},"responses":{"201":{"description":"Scheduled publication accepted"},"202":{"description":"Immediate deliveries queued"},"400":{"description":"Validation or idempotency header error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Matching idempotency request is still processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/publications/{id}":{"get":{"tags":["Publications"],"summary":"Get delivery status","x-required-scope":"publications:read","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Delivery item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delivery"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}},"delete":{"tags":["Publications"],"summary":"Cancel a pending delivery","description":"Only pending items can be cancelled. Processing and completed deliveries return 409.","x-required-scope":"publications:write","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Delivery cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delivery"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Delivery is no longer pending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/analytics":{"get":{"tags":["Analytics"],"summary":"List published posts and available metrics","x-required-scope":"analytics:read","parameters":[{"$ref":"#/components/parameters/AnalyticsLimit"},{"$ref":"#/components/parameters/Platform"}],"responses":{"200":{"description":"Posts and metric snapshots; unsupported metrics are not fabricated"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook subscriptions","x-required-scope":"webhooks:read","responses":{"200":{"description":"Webhook subscriptions without their secrets"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"tags":["Webhooks"],"summary":"Create signed outbound webhook","description":"HTTPS DNS hostname required; IP literals, local hostnames, URL credentials and redirects are blocked. The signing secret is returned once. Events are persisted to a durable DynamoDB outbox; the worker retries transient errors with bounded backoff and moves permanent/exhausted deliveries to the dead-letter state.","x-required-scope":"webhooks:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"201":{"description":"Subscription created; signing secret returned once","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/Webhook"},"secret":{"type":"string"}}}}}},"400":{"description":"HTTPS URL or event validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get webhook delivery status","x-required-scope":"webhooks:read","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Delivery state and retry information; payload and secret are never returned"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Webhook delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"tags":["Webhooks"],"summary":"Replay a dead-letter webhook delivery","x-required-scope":"webhooks:write","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"202":{"description":"Delivery returned to the retry queue"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Webhook delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Only dead-letter deliveries can be replayed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}}}}