{"openapi":"3.1.0","info":{"title":"Automate10x Agentic Publishing API","version":"2.0.0","description":"Turn content into published posts across every platform. Multi-destination publish in one call, idempotent writes, dry-run validation, a capability manifest, and async jobs. Auth: `Authorization: Bearer sk_...`.","x-llms":"https://automate10x.com/llms-full.txt"},"servers":[{"url":"https://automate10x.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_..."}},"schemas":{"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["auth_error","validation_error","not_found","rate_limited","insufficient_credits","platform_error","conflict","internal_error"]},"code":{"type":"string"},"message":{"type":"string"},"field":{"type":"string"},"docs":{"type":"string"},"requestId":{"type":"string"}},"required":["type","code","message","requestId"]}}},"Target":{"type":"object","properties":{"accountId":{"type":"string","description":"A connected account id from GET /v2/accounts."},"text":{"type":"string","description":"Per-target text override (else top-level text is used)."},"media":{"type":"array","items":{"type":"string","format":"uri"}},"channelId":{"type":"string","description":"Page/board/playlist for this account (platform-agnostic). Routed to the post target channel and satisfies a platform’s page/board requirement without naming the per-platform option."},"options":{"type":"object","additionalProperties":true,"description":"Per-platform options validated against GET /v2/capabilities (pageId, boardId, privacyLevel, title, privacyStatus, altText, truncate, ...). Unknown keys are rejected."}},"required":["accountId"]},"ReportSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"brandId":{"type":"string","format":"uuid"},"period":{"type":"string","example":"2026-09"},"periodStart":{"type":"string","format":"date"},"periodEnd":{"type":"string","format":"date"},"status":{"type":"string","enum":["generating","ready","sent","failed","insufficient"]},"schema":{"type":"string","example":"report.v1"},"generatedAt":{"type":"string","format":"date-time"},"sentAt":{"type":"string","format":"date-time","nullable":true},"shareUrl":{"type":"string","nullable":true,"description":"Public read-only page; null on Starter, when the owner turned the link off, or when the month had too little activity."}}},"Report":{"allOf":[{"$ref":"#/components/schemas/ReportSummary"},{"type":"object","properties":{"data":{"type":"object","description":"report.v1 JSON: headline { postsScheduled, postsDelivered, deliveredRate, impressions, engagementTotal, engagementRate } each { value, prev, deltaPct } (null = unknown, never 0), platforms[], topPosts[], bestDay, loop, delivery, coverage[], insufficient, generatedAt."},"narrative":{"type":"string","nullable":true,"description":"Two to four validated sentences; null when the validator rejected the model output (the report still ships)."},"narrativeModel":{"type":"string","nullable":true}}}]},"Engagement":{"type":"object","description":"Current engagement for one published post. Metric values are null when the platform does not track the metric or no data has been collected yet — a null is \"unknown/untracked\", a 0 is a real zero.","properties":{"id":{"type":"string","format":"uuid"},"publishedPostId":{"type":"string","format":"uuid"},"brandId":{"type":"string","format":"uuid"},"platform":{"type":"string"},"publishedAt":{"type":"string","format":"date-time"},"externalPostUrl":{"type":"string","nullable":true},"nativePostId":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"integer","nullable":true},"impressionsUnique":{"type":"integer","nullable":true},"views":{"type":"integer","nullable":true},"viewsUnique":{"type":"integer","nullable":true},"likes":{"type":"integer","nullable":true},"dislikes":{"type":"integer","nullable":true},"comments":{"type":"integer","nullable":true},"shares":{"type":"integer","nullable":true},"saves":{"type":"integer","nullable":true}}},"engagementTotal":{"type":"integer","nullable":true,"description":"likes + comments + shares + saves (tracked metrics only)."},"platformMetrics":{"type":"object","nullable":true,"description":"Platform-specific extras beyond the standard vocabulary."},"syncStatus":{"type":"string","enum":["pending","active","completed","unsupported","error","disabled"]},"lastRefreshedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}}}},"parameters":{"Limit":{"name":"limit","in":"query","schema":{"type":"integer","maximum":100},"description":"Opt into cursor pagination."},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from a prior page."}}},"paths":{"/api/v2/users/me":{"get":{"operationId":"getMe","summary":"Verify the API key and return identity, plan, credits, scopes.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"activeBrandId":{"type":"string","nullable":true},"plan":{"type":"object"},"creditsRemaining":{"type":"integer"},"scopes":{"type":"array","items":{"type":"string"}},"keyId":{"type":"string"},"keyLastFour":{"type":"string","nullable":true}}}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/capabilities":{"get":{"operationId":"getCapabilities","summary":"Per-platform rules (char limits, media, required/optional options) + your accounts with channel ids.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"type":"object","additionalProperties":{"type":"object"}},"accounts":{"type":"array","items":{"type":"object"}}}}}}}}}},"/api/v2/posts":{"post":{"operationId":"publish","summary":"Publish one idea to many destinations (the publish button).","parameters":[{"name":"dryRun","in":"query","schema":{"type":"boolean"},"description":"Validate every target, queue nothing."},{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"Safe retries (replayed 24h)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"title":"Multi-destination (recommended)","type":"object","properties":{"text":{"type":"string"},"media":{"type":"array","items":{"type":"string","format":"uri"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/Target"},"minItems":1},"schedule":{"type":"object","properties":{"mode":{"type":"string","enum":["now","at","next_free_slot"]},"time":{"type":"string","format":"date-time"},"platform":{"type":"string"}}}},"required":["targets"]},{"title":"Legacy single account","type":"object","properties":{"accountId":{"type":"string"},"body":{"type":"string"},"mediaUrls":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"string"}},"required":["accountId","body"]}]}}}},"responses":{"200":{"description":"Job created (multi-destination body).","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"targets":{"type":"array","items":{"type":"object"}},"poll":{"type":"string"},"credits":{"type":"object"}}}}}},"201":{"description":"Single row created (legacy body)."},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Idempotency-Key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/posts/{jobId}":{"get":{"operationId":"getJob","summary":"Poll a multi-destination publish. Partial failure is first-class.","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","partially_failed","failed"]},"targets":{"type":"array","items":{"type":"object","description":"One target per account. `status: success` = the vendor ACCEPTED the post; `deliveryState` is whether the platform actually has it (Closed Loop M1).","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","success","failed"]},"scheduledAt":{"type":"string","format":"date-time"},"url":{"type":["string","null"]},"externalId":{"type":["string","null"]},"deliveryState":{"type":["string","null"],"enum":["pending","delivered","undelivered","unverifiable",null],"description":"null until accepted by the vendor."},"deliveryVerifiedAt":{"type":["string","null"],"format":"date-time"},"vendorError":{"type":["object","null"],"properties":{"code":{"type":["string","null"]},"message":{"type":["string","null"]},"retryability":{"type":"string","enum":["retryable","non_retryable","unknown"]}}},"retryCount":{"type":"integer"},"holdReason":{"type":["string","null"],"description":"Set while the account needs reconnecting; the post publishes on release."},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"404":{"description":"No such job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/accounts":{"get":{"operationId":"listAccounts","summary":"Connected social accounts.","responses":{"200":{"description":"OK"}}}},"/api/v2/sources":{"post":{"operationId":"createSource","summary":"Research feedstock: resolve an article(URL)/youtube/tiktok/pdf/audio/perplexity/text source. Returns a poll URL (text resolves immediately).","responses":{"201":{"description":"Queued; poll GET /api/v2/sources/{id}"}}}},"/api/v2/sources/{id}":{"get":{"operationId":"getSource","summary":"Poll a source resolution until status=ready (resolvedContent + tokens).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v2/accounts/{id}/subaccounts":{"get":{"operationId":"listSubaccounts","summary":"Resolvable channels for an account (LinkedIn/Facebook pages, YouTube channels).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v2/accounts/{id}/boards":{"get":{"operationId":"listBoards","summary":"Pinterest boards for an account.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v2/slots":{"get":{"operationId":"listSlots","summary":"Scheduling slots that back schedule.mode=next_free_slot. Filter: platform.","parameters":[{"name":"platform","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"post":{"operationId":"createSlot","summary":"Create a posting slot (platform, timeOfDay HH:MM, dayMask 1..127).","responses":{"201":{"description":"Created"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/media/{id}":{"get":{"operationId":"getMedia","summary":"Media processing status (ready|processing) + content type/size for a mediaId.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not a valid mediaId"}}}},"/api/v2/visuals":{"post":{"operationId":"createVisual","summary":"Generate a visual as a job (kind: quote_card | slideshow | carousel). Poll GET /api/v2/visuals/{id}; visual.ready webhook fires on completion.","responses":{"201":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"poll":{"type":"string"},"credits":{"type":"object"}}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/visuals/{id}":{"get":{"operationId":"getVisual","summary":"Poll a visual job (status: queued|rendering|ready|failed) for its url.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v2/media":{"post":{"operationId":"createMedia","summary":"Presigned upload for local files. PUT bytes to uploadUrl, then reference publicUrl in media[].","responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mediaId":{"type":"string"},"uploadUrl":{"type":"string"},"publicUrl":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}}}}}}}}},"/api/v2/posts/{jobId}/retry":{"post":{"operationId":"retryJob","summary":"Retry every FAILED target of a job. Before re-queuing, the platform is asked about the prior attempt so a retry never double-posts; refusals are returned per target: already_delivered, still_processing, not_retryable, retry_limit. Scope posts:write.","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"retried":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"scheduledAt":{"type":"string"},"retryCount":{"type":"integer"}}}},"refused":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"code":{"type":"string"},"error":{"type":"string"}}}}}}}}},"404":{"description":"Job not found for this key"}}}},"/api/v2/scheduled-posts":{"get":{"operationId":"listScheduled","summary":"Scheduled posts (filters: status, platform, jobId, from, to). Each row carries holdReason (non-null while its account needs reconnecting), retryCount and retryOfId.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"jobId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/api/v2/published-posts":{"get":{"operationId":"listPublished","summary":"Posts accepted for publishing — one row per post (its latest attempt) — each with deliveryState (pending | delivered | undelivered | unverifiable), deliveryVerifiedAt, the permalink once delivered, and vendorError { code, message, retryability } when the platform rejected it. Pass include=engagement to embed current engagement metrics per post (Social Loop).","parameters":[{"name":"include","in":"query","schema":{"type":"string","enum":["engagement"]},"description":"include=engagement embeds { metrics, engagementTotal, syncStatus, lastRefreshedAt } per post (null when not yet tracked)."},{"name":"delivery","in":"query","schema":{"type":"string","enum":["pending","delivered","undelivered","unverifiable"]},"description":"Filter by delivery truth (Closed Loop)."}],"responses":{"200":{"description":"OK"}}}},"/api/v2/engagement":{"get":{"operationId":"listEngagement","summary":"Current engagement metrics for published posts (Social Loop). Untracked metrics are null, never 0 — platforms differ (X has no data source; LinkedIn covers a trailing 30 days). Requires the engagement:read scope.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"brandId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"platform","in":"query","schema":{"type":"string"}},{"name":"syncStatus","in":"query","schema":{"type":"string","enum":["pending","active","completed","unsupported","error"]}},{"name":"publishedFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"publishedTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["engagementTotal","likes","comments","shares","saves","impressions","views"]},"description":"Metric sorts return the top page (no cursor); default order is recency with cursor pagination."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Engagement"}}}},"401":{"description":"Invalid key or missing engagement:read scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/engagement/{publishedPostId}/history":{"get":{"operationId":"getEngagementHistory","summary":"Daily engagement snapshots for one published post (oldest first). Automate10x archives these permanently; the vendor only retains 30 days.","parameters":[{"name":"publishedPostId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK"},"404":{"description":"No engagement record for that post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/reports":{"get":{"operationId":"listReports","summary":"Monthly performance reports for your brands (Closed Loop). One row per brand per calendar month with status (ready | sent | insufficient | failed) and shareUrl (null on Starter, when the link is turned off, or when the month had too little activity). Requires the engagement:read scope.","parameters":[{"name":"brandId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"period","in":"query","schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"description":"Calendar month, YYYY-MM."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportSummary"}}}}},"401":{"description":"Invalid key or missing engagement:read scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/reports/{id}":{"get":{"operationId":"getReport","summary":"One monthly report: the report.v1 data JSON (headline with month-over-month deltas, per-platform table, top posts, Loop learnings, delivery, coverage notes), the validated narrative (null when it failed validation) and the share URL. Requires the engagement:read scope.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"404":{"description":"Not found (or a preview)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/reports/generate":{"post":{"operationId":"generateReport","summary":"Generate the report for a calendar month (idempotent per brand + month: an existing report is returned with 200; a new one is created inline and returned with 202). Never emails — use the app to send. Fires the report.ready webhook. Requires the engagement:write scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["brandId","period"],"properties":{"brandId":{"type":"string","format":"uuid"},"period":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$","example":"2026-09"}}}}}},"responses":{"200":{"description":"Existing report for that month","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSummary"}}}},"202":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Brand not found or reports not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v2/generate":{"post":{"operationId":"generate","summary":"Generate post variants from a prompt/sources.","responses":{"200":{"description":"OK"}}}},"/api/v2/brands":{"get":{"operationId":"listBrands","summary":"The key owner's brands.","responses":{"200":{"description":"OK"}}}},"/api/v2/webhooks":{"post":{"operationId":"createWebhook","summary":"Subscribe to signed events (post.published, post.failed, post.delivered, post.undelivered, account.reconnect_needed, report.ready, job.completed, ...). Returns the signing secret once.","responses":{"201":{"description":"Created (secret returned once)"}}},"get":{"operationId":"listWebhooks","summary":"List your webhook subscriptions (no secret).","responses":{"200":{"description":"OK"}}}},"/api/v2/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","summary":"Delete a webhook subscription.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Not found"}}}},"/api/v2/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"Recent delivery attempts for a webhook (status, response code, attempts).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}}}}