{"openapi":"3.1.0","info":{"title":"apublished","version":"1.0.0","description":"A publishing substrate. Connect social accounts once, then compose content once and publish it to N platforms at scheduled times, with per-platform adaptation, validation before send, and a durable record of what actually went out.\n\nAgents and humans are equal citizens: the web app calls these exact endpoints.\n\nSCOPE: this document covers the publishing surface — discovery, channels, validation and the post lifecycle. The rest of `/v1` (media, imports, API keys, members, attention, connect sessions, webhooks) is real and is documented at /docs/agents, but is not described here yet. An endpoint being absent from this file means it is undocumented, never that it does not exist — and everything that IS here is checked against the running server by a contract test, responses included.","contact":{"url":"https://apublished.com/docs"}},"servers":[{"url":"https://apublished.com/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer ap_live_… — scoped, revocable and attributable in the audit log. `ap_test_` keys publish only against the simulator and are free forever."}},"schemas":{"Problem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false},"CreatePost":{"type":"object","properties":{"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"targets":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","format":"uuid"},"content":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"settings":{"type":"object","additionalProperties":{},"default":{}}},"required":["channelId"],"additionalProperties":false},"minItems":1},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"],"default":"AT"},"scheduledAt":{"type":"string","format":"date-time"},"useQueue":{"type":"boolean"},"timezone":{"type":"string"},"randomizeQueueTime":{"type":"boolean","default":false},"latePolicy":{"type":"string","enum":["PUBLISH_WHEN_POSSIBLE","SKIP_IF_LATE_BY","RESCHEDULE_NEXT_SLOT"],"default":"PUBLISH_WHEN_POSSIBLE"},"skipIfLateByMs":{"type":"integer","exclusiveMinimum":true,"minimum":0},"tags":{"type":"array","items":{"type":"string"},"default":[]},"draft":{"type":"boolean","default":false},"repeat":{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":52,"default":1},"weekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"maxItems":7},"count":{"type":"integer","minimum":1,"maximum":100},"until":{"type":"string","format":"date-time"}},"required":["frequency"],"additionalProperties":false}},"required":["body","targets"],"additionalProperties":false},"Post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","PUBLISHING","COMPLETED","PARTIALLY_FAILED","FAILED","CANCELED"]},"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"]},"createdAt":{"type":"string","format":"date-time"},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"state":{"type":"string","enum":["PENDING","STAGING","READY","PUBLISHING","AWAITING_PLATFORM","PUBLISHED","FAILED","CANCELED","SKIPPED"]},"targetAt":{"type":"string","format":"date-time"},"runAt":{"type":"string","format":"date-time"},"dispatchedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"liveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"locksAt":{"type":"string","format":"date-time"},"lockedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"attempt":{"type":"integer"},"remotePostId":{"type":["string","null"]},"remoteUrl":{"type":["string","null"]},"remoteDeletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"riskReason":{"type":["string","null"]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verificationIssue":{"anyOf":[{},{"type":"null"}]},"settings":{"type":"object","additionalProperties":{}},"error":{"anyOf":[{},{"type":"null"}]}},"required":["id","channelId","provider","state","targetAt","runAt","dispatchedAt","liveAt","locksAt","lockedAt","attempt","remotePostId","remoteUrl","remoteDeletedAt","riskReason","verifiedAt","settings"],"additionalProperties":false}},"approvalState":{"type":"string","enum":["NOT_REQUIRED","PENDING","APPROVED","REJECTED"]},"approvalUrl":{"type":["string","null"]},"seriesId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":["string","null"]},"note":{"type":"string"}},"required":["kind","url","note"],"additionalProperties":false},"series":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"count":{"type":"integer"},"truncated":{"type":"boolean"}},"required":["id","count","truncated"],"additionalProperties":false},"canceled":{"type":"integer"}},"required":["id","status","body","scheduledAt","scheduleMode","createdAt","targets","approvalState","approvalUrl","seriesId"],"additionalProperties":false},"Channel":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"handle":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","NEEDS_REAUTH","DISABLED","DEGRADED","PAUSED"]},"statusReason":{"type":["string","null"]},"brandId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"connectedAt":{"type":"string","format":"date-time"},"lastPublishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reauthUrl":{"type":["string","null"]},"credentialExpiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","provider","handle","displayName","avatarUrl","status","statusReason","brandId","connectedAt","lastPublishedAt","reauthUrl","credentialExpiresAt"],"additionalProperties":false}}},"paths":{"/capabilities":{"get":{"operationId":"listCapabilities","summary":"Every provider manifest","description":"Hard constraints as data: max characters, allowed media types, aspect ratios, duration bounds, rate limits, and the JSON Schema for each provider’s settings. Read this instead of discovering limits by trial and error.","tags":["discovery"],"parameters":[{"name":"fields","in":"query","schema":{"type":"string"},"description":"Narrow the response. Discovery that costs 15k tokens is discovery an agent stops calling."}],"responses":{"200":{"description":"Provider manifests"}}}},"/capabilities/{provider}":{"get":{"operationId":"getCapabilities","summary":"One provider manifest, including its settings JSON Schema","tags":["discovery"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Provider manifest"},"404":{"description":"Unknown provider","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false}}}}}}},"/channels":{"get":{"operationId":"listChannels","summary":"Connected channels, with health and remaining quota","tags":["channels"],"parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"provider","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Channels","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string"},"handle":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","NEEDS_REAUTH","DISABLED","DEGRADED","PAUSED"]},"statusReason":{"type":["string","null"]},"brandId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"connectedAt":{"type":"string","format":"date-time"},"lastPublishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reauthUrl":{"type":["string","null"]},"credentialExpiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","provider","handle","displayName","avatarUrl","status","statusReason","brandId","connectedAt","lastPublishedAt","reauthUrl","credentialExpiresAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` for the next page. Null on the last one."},"hasMore":{"type":"boolean"}}}}}}}}},"/channels/{id}/limits":{"get":{"operationId":"getChannelLimits","summary":"Live remaining quota for this channel today","tags":["channels"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Remaining budget","content":{"application/json":{"schema":{"type":"object","properties":{"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["account","app","tenant"]},"remaining":{"type":"integer"},"limit":{"type":"integer"},"resetAt":{"type":"string","format":"date-time"}},"required":["name","scope","remaining","limit","resetAt"],"additionalProperties":false}},"quotas":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["hard","advisory"]},"used":{"type":"integer"},"ceiling":{"type":"integer"},"remaining":{"type":"integer"}},"required":["name","kind","used","ceiling","remaining"],"additionalProperties":false}}},"required":["channelId","provider","buckets","quotas"],"additionalProperties":false}}}}}}},"/posts:validate":{"post":{"operationId":"validatePost","summary":"Dry run: violations, transformations and preview in one round trip","description":"No side effects. Returns the exact set of violations per channel, plus the `transformations` we would apply on your behalf — silent adaptation without disclosure is how agents build wrong models of the system.","tags":["posts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"targets":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","format":"uuid"},"content":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"settings":{"type":"object","additionalProperties":{},"default":{}}},"required":["channelId"],"additionalProperties":false},"minItems":1},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"],"default":"AT"},"scheduledAt":{"type":"string","format":"date-time"},"useQueue":{"type":"boolean"},"timezone":{"type":"string"},"randomizeQueueTime":{"type":"boolean","default":false},"latePolicy":{"type":"string","enum":["PUBLISH_WHEN_POSSIBLE","SKIP_IF_LATE_BY","RESCHEDULE_NEXT_SLOT"],"default":"PUBLISH_WHEN_POSSIBLE"},"skipIfLateByMs":{"type":"integer","exclusiveMinimum":true,"minimum":0},"tags":{"type":"array","items":{"type":"string"},"default":[]},"draft":{"type":"boolean","default":false},"repeat":{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":52,"default":1},"weekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"maxItems":7},"count":{"type":"integer","minimum":1,"maximum":100},"until":{"type":"string","format":"date-time"}},"required":["frequency"],"additionalProperties":false},"include":{"type":"array","items":{"type":"string","enum":["preview"]},"default":[]}},"required":["body","targets"],"additionalProperties":false}}}},"responses":{"200":{"description":"Per-channel validation","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"ok":{"type":"boolean"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"transformations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"preview":{}},"required":["channelId","provider","ok","violations","warnings","transformations"],"additionalProperties":false}}},"required":["ok","targets"],"additionalProperties":false}}}},"422":{"description":"The request itself was malformed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false}}}}}}},"/posts":{"post":{"operationId":"createPost","summary":"Create a post (draft, scheduled, or publish now)","tags":["posts"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Agents retry. Replaying a mutation with the same key returns the ORIGINAL response rather than creating a second post. 24-hour window."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"targets":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","format":"uuid"},"content":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"settings":{"type":"object","additionalProperties":{},"default":{}}},"required":["channelId"],"additionalProperties":false},"minItems":1},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"],"default":"AT"},"scheduledAt":{"type":"string","format":"date-time"},"useQueue":{"type":"boolean"},"timezone":{"type":"string"},"randomizeQueueTime":{"type":"boolean","default":false},"latePolicy":{"type":"string","enum":["PUBLISH_WHEN_POSSIBLE","SKIP_IF_LATE_BY","RESCHEDULE_NEXT_SLOT"],"default":"PUBLISH_WHEN_POSSIBLE"},"skipIfLateByMs":{"type":"integer","exclusiveMinimum":true,"minimum":0},"tags":{"type":"array","items":{"type":"string"},"default":[]},"draft":{"type":"boolean","default":false},"repeat":{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":52,"default":1},"weekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"maxItems":7},"count":{"type":"integer","minimum":1,"maximum":100},"until":{"type":"string","format":"date-time"}},"required":["frequency"],"additionalProperties":false}},"required":["body","targets"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","PUBLISHING","COMPLETED","PARTIALLY_FAILED","FAILED","CANCELED"]},"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"]},"createdAt":{"type":"string","format":"date-time"},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"state":{"type":"string","enum":["PENDING","STAGING","READY","PUBLISHING","AWAITING_PLATFORM","PUBLISHED","FAILED","CANCELED","SKIPPED"]},"targetAt":{"type":"string","format":"date-time"},"runAt":{"type":"string","format":"date-time"},"dispatchedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"liveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"locksAt":{"type":"string","format":"date-time"},"lockedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"attempt":{"type":"integer"},"remotePostId":{"type":["string","null"]},"remoteUrl":{"type":["string","null"]},"remoteDeletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"riskReason":{"type":["string","null"]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verificationIssue":{"anyOf":[{},{"type":"null"}]},"settings":{"type":"object","additionalProperties":{}},"error":{"anyOf":[{},{"type":"null"}]}},"required":["id","channelId","provider","state","targetAt","runAt","dispatchedAt","liveAt","locksAt","lockedAt","attempt","remotePostId","remoteUrl","remoteDeletedAt","riskReason","verifiedAt","settings"],"additionalProperties":false}},"approvalState":{"type":"string","enum":["NOT_REQUIRED","PENDING","APPROVED","REJECTED"]},"approvalUrl":{"type":["string","null"]},"seriesId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":["string","null"]},"note":{"type":"string"}},"required":["kind","url","note"],"additionalProperties":false},"series":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"count":{"type":"integer"},"truncated":{"type":"boolean"}},"required":["id","count","truncated"],"additionalProperties":false},"canceled":{"type":"integer"}},"required":["id","status","body","scheduledAt","scheduleMode","createdAt","targets","approvalState","approvalUrl","seriesId"],"additionalProperties":false}}}},"409":{"description":"Idempotency key reused with a different body","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false}}}},"422":{"description":"Validation failed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false}}}}}},"get":{"operationId":"listPosts","summary":"List posts","tags":["posts"],"parameters":[{"name":"state","in":"query","schema":{"type":"string"}},{"name":"channel","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Posts","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","PUBLISHING","COMPLETED","PARTIALLY_FAILED","FAILED","CANCELED"]},"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"]},"createdAt":{"type":"string","format":"date-time"},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"state":{"type":"string","enum":["PENDING","STAGING","READY","PUBLISHING","AWAITING_PLATFORM","PUBLISHED","FAILED","CANCELED","SKIPPED"]},"targetAt":{"type":"string","format":"date-time"},"runAt":{"type":"string","format":"date-time"},"dispatchedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"liveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"locksAt":{"type":"string","format":"date-time"},"lockedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"attempt":{"type":"integer"},"remotePostId":{"type":["string","null"]},"remoteUrl":{"type":["string","null"]},"remoteDeletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"riskReason":{"type":["string","null"]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verificationIssue":{"anyOf":[{},{"type":"null"}]},"settings":{"type":"object","additionalProperties":{}},"error":{"anyOf":[{},{"type":"null"}]}},"required":["id","channelId","provider","state","targetAt","runAt","dispatchedAt","liveAt","locksAt","lockedAt","attempt","remotePostId","remoteUrl","remoteDeletedAt","riskReason","verifiedAt","settings"],"additionalProperties":false}},"approvalState":{"type":"string","enum":["NOT_REQUIRED","PENDING","APPROVED","REJECTED"]},"approvalUrl":{"type":["string","null"]},"seriesId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":["string","null"]},"note":{"type":"string"}},"required":["kind","url","note"],"additionalProperties":false},"series":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"count":{"type":"integer"},"truncated":{"type":"boolean"}},"required":["id","count","truncated"],"additionalProperties":false},"canceled":{"type":"integer"}},"required":["id","status","body","scheduledAt","scheduleMode","createdAt","targets","approvalState","approvalUrl","seriesId"],"additionalProperties":false}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` for the next page. Null on the last one."},"hasMore":{"type":"boolean"}}}}}}}}},"/posts/{id}":{"get":{"operationId":"getPost","summary":"One post, with per-channel target state","tags":["posts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","PUBLISHING","COMPLETED","PARTIALLY_FAILED","FAILED","CANCELED"]},"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"]},"createdAt":{"type":"string","format":"date-time"},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"state":{"type":"string","enum":["PENDING","STAGING","READY","PUBLISHING","AWAITING_PLATFORM","PUBLISHED","FAILED","CANCELED","SKIPPED"]},"targetAt":{"type":"string","format":"date-time"},"runAt":{"type":"string","format":"date-time"},"dispatchedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"liveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"locksAt":{"type":"string","format":"date-time"},"lockedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"attempt":{"type":"integer"},"remotePostId":{"type":["string","null"]},"remoteUrl":{"type":["string","null"]},"remoteDeletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"riskReason":{"type":["string","null"]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verificationIssue":{"anyOf":[{},{"type":"null"}]},"settings":{"type":"object","additionalProperties":{}},"error":{"anyOf":[{},{"type":"null"}]}},"required":["id","channelId","provider","state","targetAt","runAt","dispatchedAt","liveAt","locksAt","lockedAt","attempt","remotePostId","remoteUrl","remoteDeletedAt","riskReason","verifiedAt","settings"],"additionalProperties":false}},"approvalState":{"type":"string","enum":["NOT_REQUIRED","PENDING","APPROVED","REJECTED"]},"approvalUrl":{"type":["string","null"]},"seriesId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":["string","null"]},"note":{"type":"string"}},"required":["kind","url","note"],"additionalProperties":false},"series":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"count":{"type":"integer"},"truncated":{"type":"boolean"}},"required":["id","count","truncated"],"additionalProperties":false},"canceled":{"type":"integer"}},"required":["id","status","body","scheduledAt","scheduleMode","createdAt","targets","approvalState","approvalUrl","seriesId"],"additionalProperties":false}}}},"404":{"description":"No such post","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false}}}}}}},"/posts/{id}:cancel":{"post":{"operationId":"cancelPost","summary":"Cancel a post","description":"Available right through PUBLISHING, and best-effort past it: where the platform exposes a delete and the post already went out, cancellation becomes a delete.","tags":["posts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","PUBLISHING","COMPLETED","PARTIALLY_FAILED","FAILED","CANCELED"]},"body":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"kind":{"type":"string","enum":["POST","REPLY","COMMENT"]},"text":{"type":"string","default":""},"media":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"profile":{"type":"string"},"altText":{"type":"string","maxLength":1000}},"additionalProperties":false},"default":[]},"delaySeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0}},"additionalProperties":false},"minItems":1}},"required":["items"],"additionalProperties":false},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scheduleMode":{"type":"string","enum":["NOW","AT","NEXT_SLOT"]},"createdAt":{"type":"string","format":"date-time"},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channelId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"state":{"type":"string","enum":["PENDING","STAGING","READY","PUBLISHING","AWAITING_PLATFORM","PUBLISHED","FAILED","CANCELED","SKIPPED"]},"targetAt":{"type":"string","format":"date-time"},"runAt":{"type":"string","format":"date-time"},"dispatchedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"liveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"locksAt":{"type":"string","format":"date-time"},"lockedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"attempt":{"type":"integer"},"remotePostId":{"type":["string","null"]},"remoteUrl":{"type":["string","null"]},"remoteDeletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"riskReason":{"type":["string","null"]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"verificationIssue":{"anyOf":[{},{"type":"null"}]},"settings":{"type":"object","additionalProperties":{}},"error":{"anyOf":[{},{"type":"null"}]}},"required":["id","channelId","provider","state","targetAt","runAt","dispatchedAt","liveAt","locksAt","lockedAt","attempt","remotePostId","remoteUrl","remoteDeletedAt","riskReason","verifiedAt","settings"],"additionalProperties":false}},"approvalState":{"type":"string","enum":["NOT_REQUIRED","PENDING","APPROVED","REJECTED"]},"approvalUrl":{"type":["string","null"]},"seriesId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":["string","null"]},"note":{"type":"string"}},"required":["kind","url","note"],"additionalProperties":false},"series":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"count":{"type":"integer"},"truncated":{"type":"boolean"}},"required":["id","count","truncated"],"additionalProperties":false},"canceled":{"type":"integer"}},"required":["id","status","body","scheduledAt","scheduleMode","createdAt","targets","approvalState","approvalUrl","seriesId"],"additionalProperties":false}}}},"404":{"description":"No such post","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer"},"remediation":{"type":"string"},"violations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"field":{"type":"string"},"message":{"type":"string"},"actual":{},"limit":{},"allowed":{"type":"array","items":{}},"remediation":{"type":"string"},"didYouMean":{"type":"string"},"schemaUrl":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"nextAction":{"type":"object","properties":{"kind":{"type":"string"},"url":{"type":"string"}},"required":["kind","url"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}}},"required":["type","title","status","code"],"additionalProperties":false}}}}}}},"/changes":{"get":{"operationId":"listChanges","summary":"Incremental change feed","description":"Webhooks get missed and agents restart. This is how an agent reconciles without walking every post. Monotonic cursor, 30-day retention.","tags":["events"],"parameters":[{"name":"since","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Changes since the cursor","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"cursor":{"type":"string"},"event":{"type":"string"},"at":{"type":"string","format":"date-time"},"subject":{"type":"object","additionalProperties":{}},"payload":{"type":"object","additionalProperties":{}}},"required":["cursor","event","at","subject","payload"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"],"additionalProperties":false}}}}}}}},"x-error-codes":{"unauthorized":{"status":401,"title":"Authentication required"},"invalid_key":{"status":401,"title":"API key is invalid or revoked"},"key_expired":{"status":401,"title":"API key has expired"},"insufficient_scope":{"status":403,"title":"The key lacks the required scope"},"channel_not_permitted":{"status":403,"title":"The key is not scoped to this channel"},"channel_reauth_required":{"status":409,"title":"The channel must be reconnected"},"channel_disabled":{"status":409,"title":"The channel is disabled"},"channel_paused":{"status":409,"title":"The channel is paused"},"channel.has_queue":{"status":409,"title":"The channel has scheduled posts"},"validation_failed":{"status":422,"title":"The post is not valid for one or more channels"},"settings.unknown_field":{"status":422,"title":"Unknown provider setting"},"content_rejected_by_platform":{"status":422,"title":"The platform rejected this content"},"media_rejected":{"status":422,"title":"The platform rejected this media"},"post.locked":{"status":409,"title":"The post is already staged with the platform"},"post.already_published":{"status":409,"title":"The post has already been published"},"not_found":{"status":404,"title":"No such endpoint"},"post_not_found":{"status":404,"title":"No such post"},"channel_not_found":{"status":404,"title":"No such channel"},"brand_not_found":{"status":404,"title":"No such brand"},"request_too_large":{"status":413,"title":"The request body is too large"},"rate_limited":{"status":429,"title":"Too many requests"},"quota_exhausted":{"status":429,"title":"The platform quota for today is exhausted"},"plan.limit_reached":{"status":402,"title":"The plan limit has been reached"},"idempotency_key_reused":{"status":409,"title":"This Idempotency-Key was used with a different body"},"bad_request":{"status":400,"title":"The request could not be parsed"},"internal":{"status":500,"title":"Something went wrong on our side"}}}