{"openapi":"3.1.0","info":{"title":"Marsial API","version":"1.0.0","description":"Publish to every social network from one API. Every response wraps its result in `data`; errors use `{ error: { code, message } }`.","license":{"name":"Proprietary","url":"https://marsial.dev/condiciones"},"contact":{"name":"Marsial","url":"https://marsial.dev","email":"soporte@twofacesco.com"}},"servers":[{"url":"https://api.marsial.dev"}],"security":[{"apiKey":[]}],"tags":[{"name":"workspace","description":"Your workspace and who is calling."},{"name":"team","description":"Members and invitations. Owners and admins manage the team; members publish and answer."},{"name":"profiles","description":"A profile is one brand or end customer. Social accounts are connected to a profile."},{"name":"queue","description":"Recurring weekly slots per profile. Posts sent with `queue: true` take the next free one."},{"name":"connect","description":"Connect a social account or a site: send the user to the URL, Marsial brings them back to your redirectUrl."},{"name":"accounts","description":"Connected social accounts, whether they can post, and their boards, playlists and subreddits."},{"name":"account-groups","description":"Saved selections of accounts, to post to them together."},{"name":"ads","description":"Ad campaigns on Meta, Google, LinkedIn, TikTok, Pinterest, X and Reddit through an ads connection (platform `meta-ads`, `google-ads`…): list them with spend and results, pause, resume, change budgets, boost published posts, create campaigns and send conversions. Budgets are whole currency units, never cents."},{"name":"whatsapp","description":"WhatsApp Business numbers: templates Meta reviews, writing first with an approved template (POST /inbox/conversations) and broadcasts to many numbers. Replies inside 24 hours go through the inbox. These accounts take no posts."},{"name":"blogs","description":"Articles on WordPress, Shopify, Wix and Webflow sites: list, draft, schedule, publish, update and delete. These accounts take articles, not posts."},{"name":"posts","description":"Publish now, schedule, queue or save drafts to one or many accounts."},{"name":"media","description":"Upload images and videos to Marsial before posting them."},{"name":"inbox","description":"Direct messages, comments and reviews of a profile’s accounts. Lists take the profile; actions take the account the item belongs to."},{"name":"automations","description":"Comment-to-DM: when someone comments a keyword, answer with a private message (Instagram, Facebook) or a public reply (every network)."},{"name":"analytics","description":"Followers, daily totals, best times to post and top posts, per profile or per account."},{"name":"billing","description":"A free trial, then a prepaid balance. New workspaces publish for free for 7 days from their first published post (14 days at most from signing up); X and phone numbers need balance. After the first top-up, connected accounts are charged day by day and usage (X API, messages, phone numbers, calls, SMS) as it happens. Topping it up happens in the dashboard."},{"name":"phone-numbers","description":"Phone numbers for calls and SMS: browse countries and prices, buy one (countries that regulate numbers ask for the registrant's identity first: KYC), set where inbound calls go and turn SMS on. Owners and admins manage them; numbers bill monthly from the balance."},{"name":"sms","description":"Send SMS and MMS from your numbers. Replies arrive in the inbox (platform `sms`) and as `message.received` events."},{"name":"calls","description":"Call from your numbers (Marsial rings the person and connects them with your phone, a SIP address or an AI voice agent), read the call history with recordings and transcripts, and estimate what a call costs."},{"name":"webhooks","description":"Receive Marsial events at your HTTPS endpoint."},{"name":"api-keys","description":"Manage API keys. Only from the dashboard, so a leaked key cannot mint new ones."},{"name":"agents","description":"AI agents connected through the MCP server (OAuth). The dashboard approves and disconnects them; agents use https://api.marsial.dev/mcp."}],"paths":{"/v1/me":{"get":{"operationId":"getMe","tags":["workspace"],"summary":"Who is calling","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"workspaceId":{"type":"string"},"user":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"}},"required":["userId"]},{"type":"null"}],"description":"Null when called with an API key."},"role":{"anyOf":[{"type":"string","enum":["owner","admin","member"]},{"type":"null"}],"description":"The dashboard user’s role; null with an API key."}},"required":["workspaceId","user","role"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspace":{"get":{"operationId":"getWorkspace","tags":["workspace"],"summary":"Get the workspace","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"usage":{"anyOf":[{"type":"string","enum":["api","self"]},{"type":"null"}]},"requireApproval":{"type":"boolean","description":"Posts by members wait for an owner or admin to approve them."},"requireAdsApproval":{"type":"boolean","description":"Ad changes that spend money by members and AI agents wait for an owner or admin."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","usage","requireApproval","requireAdsApproval","createdAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateWorkspace","tags":["workspace"],"summary":"Update the workspace","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"usage":{"type":"string","enum":["api","self"]},"requireApproval":{"description":"Posts by members wait for an owner or admin to approve them.","type":"boolean"},"requireAdsApproval":{"description":"Ad changes that spend money by members and AI agents wait for an owner or admin to approve them.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"usage":{"anyOf":[{"type":"string","enum":["api","self"]},{"type":"null"}]},"requireApproval":{"type":"boolean","description":"Posts by members wait for an owner or admin to approve them."},"requireAdsApproval":{"type":"boolean","description":"Ad changes that spend money by members and AI agents wait for an owner or admin."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","usage","requireApproval","requireAdsApproval","createdAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/team":{"get":{"operationId":"getTeam","tags":["team"],"summary":"List members and invitations","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"joinedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"you":{"type":"boolean"}},"required":["userId","role","joinedAt","you"]}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","email","role","createdAt","expiresAt"]}}},"required":["members","invitations"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/team/invitations":{"post":{"operationId":"inviteMember","tags":["team"],"summary":"Invite someone","description":"Returns a link to send to them. They join by signing in with the invited email.","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Who to invite; they must sign in with this email to accept."},"role":{"default":"member","description":"`admin` manages the team, API keys and webhooks; `member` publishes and answers.","type":"string","enum":["admin","member"]}},"required":["email"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","email","role","createdAt","expiresAt"]},"url":{"type":"string","format":"uri","description":"The link to send. Shown only now; valid for 7 days."}},"required":["invitation","url"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/team/invitations/{id}":{"delete":{"operationId":"cancelInvitation","tags":["team"],"summary":"Cancel an invitation","x-dashboard-only":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/team/members/{userId}":{"patch":{"operationId":"changeMemberRole","tags":["team"],"summary":"Change a role","x-dashboard-only":true,"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"role":{"type":"string","enum":["admin","member"]}},"required":["role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]},"joinedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"you":{"type":"boolean"}},"required":["userId","role","joinedAt","you"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"removeMember","tags":["team"],"summary":"Remove someone, or leave","x-dashboard-only":true,"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invitations/accept":{"post":{"operationId":"acceptInvitation","tags":["team"],"summary":"Accept an invitation","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":200,"description":"The token in the invitation link."}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"workspaceId":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member"]}},"required":["workspaceId","role"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/profiles":{"get":{"operationId":"listProfiles","tags":["profiles"],"summary":"List profiles","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"externalId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","createdAt","updatedAt"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createProfile","tags":["profiles"],"summary":"Create a profile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Brand or end-customer name."},"timezone":{"description":"IANA timezone, e.g. Europe/Madrid. Used by the queue.","type":"string","maxLength":64},"externalId":{"description":"Your own id for this customer, returned as is.","type":"string","maxLength":200}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"externalId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/profiles/{id}":{"get":{"operationId":"getProfile","tags":["profiles"],"summary":"Get a profile","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"externalId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateProfile","tags":["profiles"],"summary":"Update a profile","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Brand or end-customer name."},"timezone":{"description":"IANA timezone, e.g. Europe/Madrid. Used by the queue.","type":"string","maxLength":64},"externalId":{"description":"Your own id for this customer, returned as is.","type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"externalId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteProfile","tags":["profiles"],"summary":"Delete a profile","description":"Also disconnects its accounts.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/profiles/{id}/queue":{"get":{"operationId":"getQueue","tags":["queue"],"summary":"Get a profile's queue","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"slots":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 = Sunday … 6 = Saturday"},"time":{"type":"string","description":"HH:mm"}},"required":["dayOfWeek","time"]}},"nextSlots":{"type":"array","items":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"The next free slots, soonest first."}},"required":["timezone","slots","nextSlots"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"setQueue","tags":["queue"],"summary":"Set the queue slots","description":"Replaces every slot. Days go from 0 (Sunday) to 6 (Saturday); times are HH:mm in the queue timezone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string","minLength":1,"maxLength":64},"slots":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["dayOfWeek","time"]}}},"required":["slots"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"slots":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 = Sunday … 6 = Saturday"},"time":{"type":"string","description":"HH:mm"}},"required":["dayOfWeek","time"]}},"nextSlots":{"type":"array","items":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"The next free slots, soonest first."}},"required":["timezone","slots","nextSlots"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteQueue","tags":["queue"],"summary":"Delete the queue","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/{platform}":{"get":{"operationId":"getConnectUrl","tags":["connect"],"summary":"Start connecting an account","description":"Returns the URL to send the user to. When they finish, Marsial redirects to `redirectUrl` with `connected=<platform>&accountId=…`, with `error=…` if it failed, or with `select=<sessionId>` when the user must pick a page, organization, board, location or profile (Facebook, LinkedIn, Pinterest, Google Business, Snapchat) a channel (Slack) or a number (WhatsApp). In that case list the options and select one. Shopify needs `shop` (the store's myshopify.com domain). `wordpress` here connects WordPress.com sites; self-hosted sites use POST /connect/wordpress.","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]}},{"name":"profileId","in":"query","required":true,"description":"The profile the account will belong to.","schema":{"type":"string","minLength":1}},{"name":"redirectUrl","in":"query","required":true,"description":"Where Marsial sends the user back when the connection finishes.","schema":{"type":"string","format":"uri"}},{"name":"shop","in":"query","required":false,"description":"Shopify only, required there: the store's myshopify.com domain (or its prefix).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]*(\\.myshopify\\.com)?$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Send the user here to authorize the network."}},"required":["url"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/wordpress":{"post":{"operationId":"connectWordPress","tags":["connect"],"summary":"Connect a self-hosted WordPress site","description":"Self-hosted WordPress has no OAuth: create an Application Password in the WordPress profile of the user who will publish (Users → Profile → Application Passwords) and send it with that user's login. Marsial checks the site and the permissions before saving. The password is not stored by Marsial; revoke it in WordPress to cut access.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"profileId":{"type":"string","minLength":1,"description":"The profile the site will belong to."},"siteUrl":{"type":"string","format":"starts_with","pattern":"^https:\\/\\/.*","description":"The public root of the site, e.g. https://example.com."},"username":{"type":"string","minLength":1,"maxLength":200,"description":"The WordPress login of the user who will publish."},"applicationPassword":{"type":"string","minLength":8,"maxLength":200,"description":"An Application Password created in that user's WordPress profile."}},"required":["profileId","siteUrl","username","applicationPassword"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"profileId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":"string","format":"uri"},"status":{"type":"string","enum":["active","needs_reconnection","disconnected"]},"connectedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","profileId","platform","status","connectedAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/sessions/{id}/options":{"get":{"operationId":"listConnectOptions","tags":["connect"],"summary":"List what the user can pick","description":"The `id` is the `select` value Marsial added to your redirectUrl. Sessions expire after one hour.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"detail":{"type":"string"},"imageUrl":{"type":"string","format":"uri"}},"required":["id","name"]}}},"required":["platform","options"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/sessions/{id}/select":{"post":{"operationId":"selectConnectOption","tags":["connect"],"summary":"Pick an option and finish connecting","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"optionId":{"type":"string","minLength":1,"maxLength":200}},"required":["optionId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"profileId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":"string","format":"uri"},"status":{"type":"string","enum":["active","needs_reconnection","disconnected"]},"connectedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","profileId","platform","status","connectedAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts":{"get":{"operationId":"listAccounts","tags":["accounts"],"summary":"List connected accounts","parameters":[{"name":"profileId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"profileId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":"string","format":"uri"},"status":{"type":"string","enum":["active","needs_reconnection","disconnected"]},"connectedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","profileId","platform","status","connectedAt","updatedAt"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}":{"get":{"operationId":"getAccount","tags":["accounts"],"summary":"Get a connected account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"profileId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":"string","format":"uri"},"status":{"type":"string","enum":["active","needs_reconnection","disconnected"]},"connectedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","profileId","platform","status","connectedAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"disconnectAccount","tags":["accounts"],"summary":"Disconnect an account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/health":{"get":{"operationId":"getAccountsHealth","tags":["accounts"],"summary":"Check whether accounts can post","description":"Asks each network right now. Accounts that need reconnecting are updated to `needs_reconnection`.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"status":{"type":"string","enum":["healthy","warning","error"]},"canPost":{"type":"boolean"},"needsReconnection":{"type":"boolean"},"issues":{"type":"array","items":{"type":"string"}}},"required":["accountId","platform","status","canPost","needsReconnection","issues"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/health":{"get":{"operationId":"getAccountHealth","tags":["accounts"],"summary":"Check whether one account can post","description":"The same check as the profile’s, for one account. Sites, CRMs and ads connections never take posts (`canPost: false`).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"status":{"type":"string","enum":["healthy","warning","error"]},"canPost":{"type":"boolean"},"needsReconnection":{"type":"boolean"},"issues":{"type":"array","items":{"type":"string"}}},"required":["accountId","platform","status","canPost","needsReconnection","issues"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/{kind}":{"get":{"operationId":"listAccountResources","tags":["accounts"],"summary":"List boards, playlists, subreddits or flairs","description":"`kind` is `pinterest-boards`, `youtube-playlists`, `reddit-subreddits` or `reddit-flairs` (with `subreddit`). Use the ids in the post options.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","enum":["pinterest-boards","youtube-playlists","reddit-subreddits","reddit-flairs"]}},{"name":"subreddit","in":"query","required":false,"description":"Required for reddit-flairs.","schema":{"type":"string","pattern":"^\\w{2,21}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Send it as boardId, playlistId, subreddit or flairId."},"name":{"type":"string"},"detail":{"type":"string"},"isDefault":{"description":"The account's default, used when a post does not pick one.","type":"boolean"}},"required":["id","name"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/requests/{id}":{"get":{"operationId":"getAuthorizationRequest","tags":["agents"],"summary":"See who asks for access","description":"Dashboard only. The id comes from the `request` parameter of the consent page; requests last 10 minutes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientName":{"type":"string","description":"The name the agent registered with."},"redirectHost":{"type":"string","description":"Where the user goes back to after deciding."},"workspaceName":{"type":"string"}},"required":["clientName","redirectHost","workspaceName"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/requests/{id}/approve":{"post":{"operationId":"approveAuthorizationRequest","tags":["agents"],"summary":"Let the agent in","description":"Dashboard only. The agent acts as the caller, with their role, until disconnected.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"redirectTo":{"type":"string","description":"Send the browser here: the agent gets a code or an error."}},"required":["redirectTo"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/requests/{id}/deny":{"post":{"operationId":"denyAuthorizationRequest","tags":["agents"],"summary":"Refuse the agent","description":"Dashboard only.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"redirectTo":{"type":"string","description":"Send the browser here: the agent gets a code or an error."}},"required":["redirectTo"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/grants":{"get":{"operationId":"listGrants","tags":["agents"],"summary":"List connected agents","description":"Dashboard only.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientName":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastUsedAt":{"description":"The last day the agent called Marsial.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"yours":{"type":"boolean","description":"Whether the caller let it in."}},"required":["id","clientName","createdAt","yours"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/grants/{id}":{"delete":{"operationId":"revokeGrant","tags":["agents"],"summary":"Disconnect an agent","description":"Dashboard only. Its tokens stop working at once. Members disconnect their own; owners and admins any.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/ads/ad-accounts":{"get":{"operationId":"listAdAccounts","tags":["ads"],"summary":"List ad accounts","description":"The ad accounts an ads connection reaches. Their id is the adAccountId of every other ads call.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Send it as adAccountId (Meta act_…, Google customer id…)."},"name":{"type":"string"},"currency":{"description":"Budgets and bids are whole units of it.","type":"string"},"timezone":{"type":"string"},"usable":{"type":"boolean","description":"False when the network will not run ads on it (disabled, no payment method…)."}},"required":["id","name","usable"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/ads/campaigns":{"get":{"operationId":"listAdCampaigns","tags":["ads"],"summary":"List campaigns with their results","description":"Campaigns created in Marsial and in the network's ads manager, with spend, impressions and clicks for the period.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"adAccountId","in":"query","required":false,"description":"Only this ad account (GET …/ads/ad-accounts).","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"from","in":"query","required":false,"description":"First day of the metrics (YYYY-MM-DD). 90 days ago by default.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"description":"Last day of the metrics (YYYY-MM-DD). Today by default.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The network's campaign id."},"accountId":{"type":"string","description":"The ads connection."},"network":{"type":"string","description":"facebook, instagram, google, linkedin, tiktok, pinterest, twitter or reddit."},"name":{"type":"string"},"status":{"type":"string"},"reviewStatus":{"type":"string"},"adAccountId":{"type":"string"},"adAccountName":{"type":"string"},"currency":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]},"adCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"metrics":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"clicks":{"type":"number"},"reach":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"cpc":{"type":"number"},"cpm":{"type":"number"}},"required":["spend","impressions","clicks"]}},"required":["id","accountId","network","name","status","adAccountId","adCount","metrics"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAdCampaign","tags":["ads"],"summary":"Create a campaign","description":"Campaign, ad group and ad in one call, in the network's own terms (adAccountId, goal, budgetAmount, budgetType, the creative, targeting…): see the ads guide. Marsial fills the connection in.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The network's campaign spec, as in the ads guide: adAccountId, goal, budget, creative, targeting…"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":["string","null"]}},"required":["campaignId"]}}}}}},"202":{"description":"Waiting for an owner or admin to approve it (workspace setting `requireAdsApproval`); nothing reached the network yet.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"adr_…"},"change":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"update_campaign"},"accountId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"currency":{"type":"string"},"current":{"type":"object","properties":{"status":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["status"],"description":"The campaign when the change was asked for."},"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["kind","accountId","campaignId","campaignName","current"]},{"type":"object","properties":{"kind":{"type":"string","const":"boost_post"},"postId":{"type":"string"},"boost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The boost body as sent."}},"required":["kind","postId","boost"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_campaign"},"accountId":{"type":"string"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","accountId","spec"]}],"description":"What reaches the network on approval."},"status":{"type":"string","enum":["pending","approved","rejected","failed"],"description":"`failed`: approved, but the network refused it (see `error`)."},"requestedBy":{"description":"The user who asked, or for whom an AI agent asked.","type":"string"},"via":{"type":"string","enum":["agent","person"]},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"},"campaignId":{"description":"The campaign an approved boost or new campaign created.","type":"string"},"error":{"type":"string"}},"required":["id","change","status","via","requestedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/ads/campaigns/{campaignId}":{"patch":{"operationId":"updateAdCampaign","tags":["ads"],"summary":"Pause, resume or change the budget","description":"Pausing always applies at once. Resuming and budgets answer 202 when the workspace requires approval for the caller.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"campaignId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"description":"Whole units of the ad account currency: 50 is 50.00, never cents."},"type":{"type":"string","enum":["daily","lifetime"]}},"required":["amount","type"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The network's campaign id."},"accountId":{"type":"string","description":"The ads connection."},"network":{"type":"string","description":"facebook, instagram, google, linkedin, tiktok, pinterest, twitter or reddit."},"name":{"type":"string"},"status":{"type":"string"},"reviewStatus":{"type":"string"},"adAccountId":{"type":"string"},"adAccountName":{"type":"string"},"currency":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]},"adCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"metrics":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"clicks":{"type":"number"},"reach":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"cpc":{"type":"number"},"cpm":{"type":"number"}},"required":["spend","impressions","clicks"]}},"required":["id","accountId","network","name","status","adAccountId","adCount","metrics"]}}}}}},"202":{"description":"Waiting for an owner or admin to approve it (workspace setting `requireAdsApproval`); nothing reached the network yet.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"adr_…"},"change":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"update_campaign"},"accountId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"currency":{"type":"string"},"current":{"type":"object","properties":{"status":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["status"],"description":"The campaign when the change was asked for."},"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["kind","accountId","campaignId","campaignName","current"]},{"type":"object","properties":{"kind":{"type":"string","const":"boost_post"},"postId":{"type":"string"},"boost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The boost body as sent."}},"required":["kind","postId","boost"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_campaign"},"accountId":{"type":"string"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","accountId","spec"]}],"description":"What reaches the network on approval."},"status":{"type":"string","enum":["pending","approved","rejected","failed"],"description":"`failed`: approved, but the network refused it (see `error`)."},"requestedBy":{"description":"The user who asked, or for whom an AI agent asked.","type":"string"},"via":{"type":"string","enum":["agent","person"]},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"},"campaignId":{"description":"The campaign an approved boost or new campaign created.","type":"string"},"error":{"type":"string"}},"required":["id","change","status","via","requestedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/ads/conversions":{"post":{"operationId":"sendAdConversions","tags":["ads"],"summary":"Send conversions","description":"Server-side events for the network: Meta Conversions API, Google offline conversions, LinkedIn and TikTok.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Conversion events for the network (pixel or conversion id, events with their user data and value)."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["received"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/boost":{"post":{"operationId":"boostPost","tags":["ads"],"summary":"Boost a published post","description":"Turns one published copy of the post (its accountId) into an ad paid by adAccountId. The network reviews it before it delivers.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The post's account whose published copy to promote."},"adAccountId":{"type":"string","minLength":1,"maxLength":100,"description":"The ad account that pays (GET /v1/accounts/{id}/ads/ad-accounts on the ads connection)."},"name":{"type":"string","minLength":1,"maxLength":200},"goal":{"type":"string","enum":["engagement","traffic","awareness","video_views","lead_generation","conversions","app_promotion"],"description":"What the network optimises for. Each network takes a subset."},"budget":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"description":"Whole units of the ad account currency: 50 is 50.00, never cents."},"type":{"type":"string","enum":["daily","lifetime"]}},"required":["amount","type"],"additionalProperties":false},"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"description":"Required with a lifetime budget.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"targeting":{"type":"object","properties":{"countries":{"description":"ISO country codes.","maxItems":50,"type":"array","items":{"type":"string","minLength":2,"maxLength":2}},"ageMin":{"type":"integer","minimum":13,"maximum":65},"ageMax":{"type":"integer","minimum":13,"maximum":65}},"additionalProperties":false},"callToAction":{"description":"e.g. LEARN_MORE, SHOP_NOW; needs linkUrl.","type":"string","maxLength":50},"linkUrl":{"type":"string","format":"uri"}},"required":["accountId","adAccountId","name","goal","budget"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":["string","null"]}},"required":["campaignId"]}}}}}},"202":{"description":"Waiting for an owner or admin to approve it (workspace setting `requireAdsApproval`); nothing reached the network yet.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"adr_…"},"change":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"update_campaign"},"accountId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"currency":{"type":"string"},"current":{"type":"object","properties":{"status":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["status"],"description":"The campaign when the change was asked for."},"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["kind","accountId","campaignId","campaignName","current"]},{"type":"object","properties":{"kind":{"type":"string","const":"boost_post"},"postId":{"type":"string"},"boost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The boost body as sent."}},"required":["kind","postId","boost"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_campaign"},"accountId":{"type":"string"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","accountId","spec"]}],"description":"What reaches the network on approval."},"status":{"type":"string","enum":["pending","approved","rejected","failed"],"description":"`failed`: approved, but the network refused it (see `error`)."},"requestedBy":{"description":"The user who asked, or for whom an AI agent asked.","type":"string"},"via":{"type":"string","enum":["agent","person"]},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"},"campaignId":{"description":"The campaign an approved boost or new campaign created.","type":"string"},"error":{"type":"string"}},"required":["id","change","status","via","requestedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ads/requests":{"get":{"operationId":"listAdChangeRequests","tags":["ads"],"summary":"List ad changes waiting for approval","description":"With `requireAdsApproval` on, members and AI agents (MCP) ask for ad changes that spend money instead of making them. Newest first, with what became of each.","parameters":[{"name":"status","in":"query","required":false,"description":"Only changes in this state; all of them, newest first, otherwise.","schema":{"type":"string","enum":["pending","approved","rejected","failed"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"adr_…"},"change":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"update_campaign"},"accountId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"currency":{"type":"string"},"current":{"type":"object","properties":{"status":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["status"],"description":"The campaign when the change was asked for."},"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["kind","accountId","campaignId","campaignName","current"]},{"type":"object","properties":{"kind":{"type":"string","const":"boost_post"},"postId":{"type":"string"},"boost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The boost body as sent."}},"required":["kind","postId","boost"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_campaign"},"accountId":{"type":"string"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","accountId","spec"]}],"description":"What reaches the network on approval."},"status":{"type":"string","enum":["pending","approved","rejected","failed"],"description":"`failed`: approved, but the network refused it (see `error`)."},"requestedBy":{"description":"The user who asked, or for whom an AI agent asked.","type":"string"},"via":{"type":"string","enum":["agent","person"]},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"},"campaignId":{"description":"The campaign an approved boost or new campaign created.","type":"string"},"error":{"type":"string"}},"required":["id","change","status","via","requestedAt"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ads/requests/{id}":{"get":{"operationId":"getAdChangeRequest","tags":["ads"],"summary":"Get an ad change request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"adr_…"},"change":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"update_campaign"},"accountId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"currency":{"type":"string"},"current":{"type":"object","properties":{"status":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["status"],"description":"The campaign when the change was asked for."},"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["kind","accountId","campaignId","campaignName","current"]},{"type":"object","properties":{"kind":{"type":"string","const":"boost_post"},"postId":{"type":"string"},"boost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The boost body as sent."}},"required":["kind","postId","boost"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_campaign"},"accountId":{"type":"string"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","accountId","spec"]}],"description":"What reaches the network on approval."},"status":{"type":"string","enum":["pending","approved","rejected","failed"],"description":"`failed`: approved, but the network refused it (see `error`)."},"requestedBy":{"description":"The user who asked, or for whom an AI agent asked.","type":"string"},"via":{"type":"string","enum":["agent","person"]},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"},"campaignId":{"description":"The campaign an approved boost or new campaign created.","type":"string"},"error":{"type":"string"}},"required":["id","change","status","via","requestedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ads/requests/{id}/review":{"post":{"operationId":"reviewAdChangeRequest","tags":["ads"],"summary":"Approve or reject an ad change","description":"Owners and admins (and API keys). Approving sends it to the network at once; if the network refuses, the request ends `failed` with the reason. AI agents cannot review.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"],"description":"`approve` sends the change to the network now; `reject` drops it."},"note":{"description":"Why, for whoever asked for it.","type":"string","maxLength":1000}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"adr_…"},"change":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"update_campaign"},"accountId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"currency":{"type":"string"},"current":{"type":"object","properties":{"status":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["status"],"description":"The campaign when the change was asked for."},"status":{"type":"string","enum":["active","paused"]},"budget":{"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string"}},"required":["amount","type"]}},"required":["kind","accountId","campaignId","campaignName","current"]},{"type":"object","properties":{"kind":{"type":"string","const":"boost_post"},"postId":{"type":"string"},"boost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The boost body as sent."}},"required":["kind","postId","boost"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_campaign"},"accountId":{"type":"string"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","accountId","spec"]}],"description":"What reaches the network on approval."},"status":{"type":"string","enum":["pending","approved","rejected","failed"],"description":"`failed`: approved, but the network refused it (see `error`)."},"requestedBy":{"description":"The user who asked, or for whom an AI agent asked.","type":"string"},"via":{"type":"string","enum":["agent","person"]},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"type":"string"},"campaignId":{"description":"The campaign an approved boost or new campaign created.","type":"string"},"error":{"type":"string"}},"required":["id","change","status","via","requestedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/countries":{"get":{"operationId":"listNumberCountries","tags":["phone-numbers"],"summary":"Countries and prices","description":"Where numbers can be bought, per number type: monthly price (cents), whether KYC is needed, SMS and stock.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"ISO 3166-1 alpha-2."},"needsKyc":{"type":"boolean"},"types":{"type":"array","items":{"type":"object","properties":{"numberType":{"type":"string","enum":["local","mobile","national","toll_free"]},"monthlyPrice":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Cents of euro per month."},"needsKyc":{"type":"boolean"},"sms":{"type":"boolean"},"calls":{"type":"boolean"},"inStock":{"type":"boolean"},"preOrderable":{"type":"boolean","description":"Out of stock but orderable through KYC (usually 2 to 4 weeks)."}},"required":["numberType","monthlyPrice","needsKyc","sms","calls","inStock","preOrderable"]},"description":"The default type first."}},"required":["code","needsKyc","types"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/available":{"get":{"operationId":"searchAvailableNumbers","tags":["phone-numbers"],"summary":"Search available numbers","description":"Live inventory of a country. Any result can be bought exactly with POST /phone-numbers (except in countries that need KYC).","parameters":[{"name":"country","in":"query","required":true,"description":"ISO 3166-1 alpha-2 (GET /v1/phone-numbers/countries).","schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}},{"name":"numberType","in":"query","required":false,"description":"local, mobile, national or toll_free; the country's default when left out.","schema":{"type":"string","enum":["local","mobile","national","toll_free"]}},{"name":"areaCode","in":"query","required":false,"description":"Area code (91, 415) or a city name.","schema":{"type":"string","maxLength":40}},{"name":"locality","in":"query","required":false,"description":"A city of the country.","schema":{"type":"string","maxLength":80}},{"name":"contains","in":"query","required":false,"description":"Digits the number must contain.","schema":{"type":"string","pattern":"^\\d{1,10}$"}},{"name":"sms","in":"query","required":false,"description":"Only numbers that can also send SMS.","schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"E.164."},"features":{"type":"array","items":{"type":"string"},"description":"voice, sms, mms…"},"locality":{"type":"string"},"bestEffort":{"type":"boolean","description":"Added because too few matched: may be outside the requested area."}},"required":["phoneNumber","features","bestEffort"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers":{"get":{"operationId":"listNumbers","tags":["phone-numbers"],"summary":"List a profile’s numbers","description":"Active numbers and those in review (declined ones stay listed for 30 days, with the reason).","parameters":[{"name":"profileId","in":"query","required":false,"description":"The profile whose numbers to list; without it, every profile's.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"num_…"},"profileId":{"type":"string"},"phoneNumber":{"description":"E.164; null until the carrier assigns it.","type":["string","null"]},"country":{"type":"string"},"numberType":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_regulatory","regulatory_declined","provisioning","verifying","active","suspended","releasing","released"],"description":"`pending_regulatory` while the carrier reviews the KYC; `regulatory_declined` with the reason in `regulatory`."},"monthlyPrice":{"description":"Cents of euro per month, fixed when it was bought.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"object","properties":{"enabled":{"type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://….","type":"string"},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string"},"recordingEnabled":{"type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"type":"string"},"businessHours":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"string"},"close":{"type":"string"}},"required":["day","open","close"]}},"blockedCallers":{"type":"array","items":{"type":"string"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"required":["enabled"]},"sms":{"type":"object","properties":{"enabled":{"type":"boolean"},"capable":{"type":"boolean"},"sendApproved":{"description":"Texts deliver (US numbers need a carrier registration first).","type":"boolean"},"domesticOnly":{"description":"Can only text numbers of its own country.","type":"boolean"}},"required":["enabled"]},"regulatory":{"type":"object","properties":{"declineReason":{"type":"string"},"reviewComment":{"type":"string"},"actionRequired":{"type":"boolean"},"idVerificationUrl":{"description":"Identity check for the registrant, once the order is placed (some countries).","type":"string"}},"required":["actionRequired"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"smsNotice":{"description":"After turning SMS on, what else it needs.","type":"string"}},"required":["id","profileId","phoneNumber","country","status","calls","sms"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"buyNumber","tags":["phone-numbers"],"summary":"Buy a number","description":"Owners and admins. Needs at least one month of the number in the balance. Countries that regulate numbers answer 202 `kyc_required`: send the registrant's identity with POST /phone-numbers/kyc.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"profileId":{"type":"string","minLength":1},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"},"numberType":{"type":"string","enum":["local","mobile","national","toll_free"],"description":"local, mobile, national or toll_free; the country's default when left out."},"phoneNumber":{"description":"One exact number from GET /v1/phone-numbers/available. Not for countries that need KYC.","type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"areaCode":{"description":"Any number in this area (when phoneNumber is left out).","type":"string","pattern":"^\\d{1,4}$"},"sms":{"description":"Pick a number that can send SMS and turn SMS on.","type":"boolean"},"idempotencyKey":{"description":"Send the same value when retrying, so a retry never buys a second number.","type":"string","maxLength":100}},"required":["profileId","country"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"num_…"},"profileId":{"type":"string"},"phoneNumber":{"description":"E.164; null until the carrier assigns it.","type":["string","null"]},"country":{"type":"string"},"numberType":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_regulatory","regulatory_declined","provisioning","verifying","active","suspended","releasing","released"],"description":"`pending_regulatory` while the carrier reviews the KYC; `regulatory_declined` with the reason in `regulatory`."},"monthlyPrice":{"description":"Cents of euro per month, fixed when it was bought.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"object","properties":{"enabled":{"type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://….","type":"string"},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string"},"recordingEnabled":{"type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"type":"string"},"businessHours":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"string"},"close":{"type":"string"}},"required":["day","open","close"]}},"blockedCallers":{"type":"array","items":{"type":"string"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"required":["enabled"]},"sms":{"type":"object","properties":{"enabled":{"type":"boolean"},"capable":{"type":"boolean"},"sendApproved":{"description":"Texts deliver (US numbers need a carrier registration first).","type":"boolean"},"domesticOnly":{"description":"Can only text numbers of its own country.","type":"boolean"}},"required":["enabled"]},"regulatory":{"type":"object","properties":{"declineReason":{"type":"string"},"reviewComment":{"type":"string"},"actionRequired":{"type":"boolean"},"idVerificationUrl":{"description":"Identity check for the registrant, once the order is placed (some countries).","type":"string"}},"required":["actionRequired"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"smsNotice":{"description":"After turning SMS on, what else it needs.","type":"string"}},"required":["id","profileId","phoneNumber","country","status","calls","sms"]}}}}}},"202":{"description":"The country needs KYC first: get the form with GET /phone-numbers/kyc and submit it.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","const":"kyc_required"},"country":{"type":"string"},"numberType":{"type":"string"}},"required":["status","country"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/kyc":{"get":{"operationId":"getNumberKycForm","tags":["phone-numbers"],"summary":"The KYC form of a country","description":"What the carrier needs to know about whoever holds the number: text, date, address, documents, and sometimes an identity check done later (`action`).","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}},{"name":"numberType","in":"query","required":false,"description":"local, mobile, national or toll_free; the country's default when left out.","schema":{"type":"string","enum":["local","mobile","national","toll_free"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"country":{"type":"string"},"numberType":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"requirementId":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["text","date","address","file","action"],"description":"`file`: upload it first; `action`: an identity check done later through a link."},"description":{"type":"string"},"example":{"type":"string"},"localTo":{"description":"ISO country the value must be local to.","type":"string"}},"required":["requirementId","label","kind"]}}},"required":["country","fields"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"submitNumberKyc","tags":["phone-numbers"],"summary":"Order a number with KYC","description":"Orders the number of a regulated country with the registrant's identity. It waits in the carrier's review (`pending_regulatory`, usually 1 to 3 business days) and bills only once active. When the form had an identity check, the number gets `regulatory.idVerificationUrl` to send to the registrant.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"profileId":{"type":"string","minLength":1},"country":{"type":"string","pattern":"^[A-Za-z]{2}$"},"numberType":{"type":"string","enum":["local","mobile","national","toll_free"],"description":"local, mobile, national or toll_free; the country's default when left out."},"values":{"description":"requirementId → value, for `text` and `date` fields.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":2000}},"documents":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"requirementId":{"type":"string","minLength":1},"documentId":{"type":"string","minLength":1,"description":"From POST /v1/phone-numbers/kyc/documents."}},"required":["requirementId","documentId"],"additionalProperties":false}},"address":{"type":"object","properties":{"requirementId":{"type":"string","minLength":1},"countryCode":{"type":"string","pattern":"^[A-Za-z]{2}$"},"streetAddress":{"type":"string","minLength":1,"maxLength":200},"extendedAddress":{"type":"string","maxLength":200},"locality":{"type":"string","minLength":1,"maxLength":100},"administrativeArea":{"type":"string","maxLength":100},"postalCode":{"type":"string","minLength":1,"maxLength":20}},"required":["requirementId","countryCode","streetAddress","locality","postalCode"],"additionalProperties":false},"endUserFirstName":{"description":"Legal first name, when the form has an identity check (`action`).","type":"string","maxLength":100},"endUserLastName":{"type":"string","maxLength":100},"areaCode":{"type":"string","pattern":"^\\d{1,4}$"},"phoneNumber":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"sms":{"type":"boolean"},"preOrder":{"description":"Accept sourcing a number when the area has no stock (usually 2 to 4 weeks).","type":"boolean"},"submissionId":{"description":"Send the same value when retrying, so a retry never orders a second number.","type":"string","maxLength":100}},"required":["profileId","country"],"additionalProperties":false}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"numbers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"num_…"},"profileId":{"type":"string"},"phoneNumber":{"description":"E.164; null until the carrier assigns it.","type":["string","null"]},"country":{"type":"string"},"numberType":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_regulatory","regulatory_declined","provisioning","verifying","active","suspended","releasing","released"],"description":"`pending_regulatory` while the carrier reviews the KYC; `regulatory_declined` with the reason in `regulatory`."},"monthlyPrice":{"description":"Cents of euro per month, fixed when it was bought.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"object","properties":{"enabled":{"type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://….","type":"string"},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string"},"recordingEnabled":{"type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"type":"string"},"businessHours":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"string"},"close":{"type":"string"}},"required":["day","open","close"]}},"blockedCallers":{"type":"array","items":{"type":"string"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"required":["enabled"]},"sms":{"type":"object","properties":{"enabled":{"type":"boolean"},"capable":{"type":"boolean"},"sendApproved":{"description":"Texts deliver (US numbers need a carrier registration first).","type":"boolean"},"domesticOnly":{"description":"Can only text numbers of its own country.","type":"boolean"}},"required":["enabled"]},"regulatory":{"type":"object","properties":{"declineReason":{"type":"string"},"reviewComment":{"type":"string"},"actionRequired":{"type":"boolean"},"idVerificationUrl":{"description":"Identity check for the registrant, once the order is placed (some countries).","type":"string"}},"required":["actionRequired"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"smsNotice":{"description":"After turning SMS on, what else it needs.","type":"string"}},"required":["id","profileId","phoneNumber","country","status","calls","sms"]}},"preOrder":{"type":"boolean","description":"The carrier sources the number (usually 2 to 4 weeks); nothing is billed until it is active."}},"required":["numbers","preOrder"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/kyc/documents":{"post":{"operationId":"uploadNumberKycDocument","tags":["phone-numbers"],"summary":"Upload a KYC document","description":"One file (PDF, JPEG or PNG, up to 4 MB, in base64). It goes straight to the carrier; Marsial keeps nothing. Use the returned id in POST /phone-numbers/kyc.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"type":"string","enum":["application/pdf","image/jpeg","image/png"]},"data":{"type":"string","minLength":1,"maxLength":6000000,"description":"The file in base64, up to 4 MB. For an ID card, both sides in one file."}},"required":["filename","contentType","data"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"documentId":{"type":"string","description":"kdoc_…"}},"required":["documentId"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}":{"get":{"operationId":"getNumber","tags":["phone-numbers"],"summary":"Get a number","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"num_…"},"profileId":{"type":"string"},"phoneNumber":{"description":"E.164; null until the carrier assigns it.","type":["string","null"]},"country":{"type":"string"},"numberType":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_regulatory","regulatory_declined","provisioning","verifying","active","suspended","releasing","released"],"description":"`pending_regulatory` while the carrier reviews the KYC; `regulatory_declined` with the reason in `regulatory`."},"monthlyPrice":{"description":"Cents of euro per month, fixed when it was bought.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"object","properties":{"enabled":{"type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://….","type":"string"},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string"},"recordingEnabled":{"type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"type":"string"},"businessHours":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"string"},"close":{"type":"string"}},"required":["day","open","close"]}},"blockedCallers":{"type":"array","items":{"type":"string"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"required":["enabled"]},"sms":{"type":"object","properties":{"enabled":{"type":"boolean"},"capable":{"type":"boolean"},"sendApproved":{"description":"Texts deliver (US numbers need a carrier registration first).","type":"boolean"},"domesticOnly":{"description":"Can only text numbers of its own country.","type":"boolean"}},"required":["enabled"]},"regulatory":{"type":"object","properties":{"declineReason":{"type":"string"},"reviewComment":{"type":"string"},"actionRequired":{"type":"boolean"},"idVerificationUrl":{"description":"Identity check for the registrant, once the order is placed (some countries).","type":"string"}},"required":["actionRequired"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"smsNotice":{"description":"After turning SMS on, what else it needs.","type":"string"}},"required":["id","profileId","phoneNumber","country","status","calls","sms"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"releaseNumber","tags":["phone-numbers"],"summary":"Release a number","description":"Owners and admins. Gives the number back and stops billing it; a number in review or a pre-order is cancelled. It cannot be recovered.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}/calls":{"patch":{"operationId":"updateNumberCalls","tags":["phone-numbers"],"summary":"Set up inbound calls","description":"Where calls go (a phone, a SIP address or an AI voice agent over wss://), voicemail, business hours, blocked callers, recording and transcription. Only the fields sent change.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"description":"false turns calls off on the number (settings are kept).","type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://… (an AI voice agent). Empty clears it.","anyOf":[{"type":"string","maxLength":500,"pattern":"^(tel:\\+[1-9]\\d{6,14}|sip:\\S+|wss:\\/\\/\\S+)$"},{"type":"string","const":""}]},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string","maxLength":500},"recordingEnabled":{"description":"Records calls (a consent notice plays first).","type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"description":"IANA time zone, e.g. Europe/Madrid.","type":"string","maxLength":60},"businessHours":{"maxItems":21,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6,"description":"0 is Sunday."},"open":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"close":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["day","open","close"],"additionalProperties":false}},"blockedCallers":{"description":"Replaces the whole list.","maxItems":500,"type":"array","items":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"num_…"},"profileId":{"type":"string"},"phoneNumber":{"description":"E.164; null until the carrier assigns it.","type":["string","null"]},"country":{"type":"string"},"numberType":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_regulatory","regulatory_declined","provisioning","verifying","active","suspended","releasing","released"],"description":"`pending_regulatory` while the carrier reviews the KYC; `regulatory_declined` with the reason in `regulatory`."},"monthlyPrice":{"description":"Cents of euro per month, fixed when it was bought.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"object","properties":{"enabled":{"type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://….","type":"string"},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string"},"recordingEnabled":{"type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"type":"string"},"businessHours":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"string"},"close":{"type":"string"}},"required":["day","open","close"]}},"blockedCallers":{"type":"array","items":{"type":"string"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"required":["enabled"]},"sms":{"type":"object","properties":{"enabled":{"type":"boolean"},"capable":{"type":"boolean"},"sendApproved":{"description":"Texts deliver (US numbers need a carrier registration first).","type":"boolean"},"domesticOnly":{"description":"Can only text numbers of its own country.","type":"boolean"}},"required":["enabled"]},"regulatory":{"type":"object","properties":{"declineReason":{"type":"string"},"reviewComment":{"type":"string"},"actionRequired":{"type":"boolean"},"idVerificationUrl":{"description":"Identity check for the registrant, once the order is placed (some countries).","type":"string"}},"required":["actionRequired"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"smsNotice":{"description":"After turning SMS on, what else it needs.","type":"string"}},"required":["id","profileId","phoneNumber","country","status","calls","sms"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listCalls","tags":["calls"],"summary":"Call history of a number","description":"Inbound and outbound, newest first.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"call_…"},"numberId":{"type":"string"},"channel":{"type":"string","description":"`pstn` (phone)."},"direction":{"type":"string","enum":["inbound","outbound"]},"from":{"type":"string"},"to":{"type":"string"},"status":{"type":"string","description":"dialing, ringing, answered, ended, failed, no_answer…"},"endReason":{"type":"string"},"durationSeconds":{"type":"number"},"recording":{"type":"boolean"},"transcriptSnippet":{"type":"string"},"transcript":{"description":"Only on GET /calls/{id}.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"at":{"type":"string"}},"required":["text"]}},"cost":{"description":"Euros.","type":"number"},"startedAt":{"type":"string"},"endedAt":{"type":"string"}},"required":["id","numberId","channel","direction","from","to","status","recording"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}/sms":{"put":{"operationId":"setNumberSms","tags":["phone-numbers"],"summary":"Turn SMS on or off","description":"Only numbers that can text. US numbers also need a carrier registration (10DLC) that Marsial does not offer yet.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"num_…"},"profileId":{"type":"string"},"phoneNumber":{"description":"E.164; null until the carrier assigns it.","type":["string","null"]},"country":{"type":"string"},"numberType":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_regulatory","regulatory_declined","provisioning","verifying","active","suspended","releasing","released"],"description":"`pending_regulatory` while the carrier reviews the KYC; `regulatory_declined` with the reason in `regulatory`."},"monthlyPrice":{"description":"Cents of euro per month, fixed when it was bought.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calls":{"type":"object","properties":{"enabled":{"type":"boolean"},"forwardTo":{"description":"Where inbound calls go: tel:+E164, sip:… or wss://….","type":"string"},"voicemailEnabled":{"type":"boolean"},"voicemailGreeting":{"type":"string"},"recordingEnabled":{"type":"boolean"},"transcriptionEnabled":{"type":"boolean"},"transcriptionLanguage":{"type":"string","enum":["auto","en","es"]},"businessHoursEnabled":{"type":"boolean"},"businessHoursTimezone":{"type":"string"},"businessHours":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"string"},"close":{"type":"string"}},"required":["day","open","close"]}},"blockedCallers":{"type":"array","items":{"type":"string"}},"forwardCallerId":{"type":"string","enum":["business","caller"]}},"required":["enabled"]},"sms":{"type":"object","properties":{"enabled":{"type":"boolean"},"capable":{"type":"boolean"},"sendApproved":{"description":"Texts deliver (US numbers need a carrier registration first).","type":"boolean"},"domesticOnly":{"description":"Can only text numbers of its own country.","type":"boolean"}},"required":["enabled"]},"regulatory":{"type":"object","properties":{"declineReason":{"type":"string"},"reviewComment":{"type":"string"},"actionRequired":{"type":"boolean"},"idVerificationUrl":{"description":"Identity check for the registrant, once the order is placed (some countries).","type":"string"}},"required":["actionRequired"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"smsNotice":{"description":"After turning SMS on, what else it needs.","type":"string"}},"required":["id","profileId","phoneNumber","country","status","calls","sms"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}/sms/opt-outs":{"get":{"operationId":"listSmsOptOuts","tags":["sms"],"summary":"Who replied STOP","description":"Texts from this number to them are refused.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"phoneNumber":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["phoneNumber"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sms/messages":{"post":{"operationId":"sendSms","tags":["sms"],"summary":"Send an SMS","description":"From one of your numbers with SMS on. Replies thread into the inbox conversation it returns.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"numberId":{"type":"string","minLength":1,"description":"The number that sends it (num_…), with SMS on."},"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"text":{"description":"Up to 10 SMS segments.","type":"string","maxLength":1530},"mediaUrls":{"description":"Public media URLs: sends an MMS where the carrier allows it.","maxItems":10,"type":"array","items":{"type":"string","format":"uri"}},"sendAt":{"description":"Schedule it for later.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"idempotencyKey":{"type":"string","maxLength":100}},"required":["numberId","to"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"description":"The inbox conversation (cnv_…) replies thread into.","type":["string","null"]},"status":{"type":"string","enum":["sent","scheduled"]}},"required":["conversationId","status"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls":{"post":{"operationId":"placeCall","tags":["calls"],"summary":"Call someone","description":"Marsial rings `to` from your number and, when they answer, connects them with `forwardTo` (your phone, a SIP address or an AI voice agent) or the number's inbound destination.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"numberId":{"type":"string","minLength":1,"description":"The number that calls (num_…)."},"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"Who to call."},"forwardTo":{"description":"Who to connect them with when they answer; the number's inbound destination otherwise.","type":"string","maxLength":500,"pattern":"^(tel:\\+[1-9]\\d{6,14}|sip:\\S+|wss:\\/\\/\\S+)$"},"greeting":{"description":"Spoken to them when they answer, before connecting.","type":"string","maxLength":500},"record":{"type":"boolean"},"transcribe":{"type":"boolean"},"idempotencyKey":{"type":"string","maxLength":100}},"required":["numberId","to"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"call_…"},"numberId":{"type":"string"},"channel":{"type":"string","description":"`pstn` (phone)."},"direction":{"type":"string","enum":["inbound","outbound"]},"from":{"type":"string"},"to":{"type":"string"},"status":{"type":"string","description":"dialing, ringing, answered, ended, failed, no_answer…"},"endReason":{"type":"string"},"durationSeconds":{"type":"number"},"recording":{"type":"boolean"},"transcriptSnippet":{"type":"string"},"transcript":{"description":"Only on GET /calls/{id}.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"at":{"type":"string"}},"required":["text"]}},"cost":{"description":"Euros.","type":"number"},"startedAt":{"type":"string"},"endedAt":{"type":"string"}},"required":["id","numberId","channel","direction","from","to","status","recording"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/estimate":{"get":{"operationId":"estimateCall","tags":["calls"],"summary":"What a call would cost","parameters":[{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"}},{"name":"minutes","in":"query","required":false,"schema":{"default":5,"type":"integer","minimum":1,"maximum":600}},{"name":"numberId","in":"query","required":false,"description":"The number that would call: the answer then says whether it can reach `to`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"destinationCountry":{"type":"string"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perMinute":{"type":"number","description":"Euros per minute."},"total":{"type":"number","description":"Euros for the minutes asked."},"reachable":{"description":"With `numberId`: false when that number only calls within its own country.","type":"boolean"},"note":{"type":"string"}},"required":["minutes","perMinute","total"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}":{"get":{"operationId":"getCall","tags":["calls"],"summary":"Get a call","description":"With its transcript when transcription was on.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"call_…"},"numberId":{"type":"string"},"channel":{"type":"string","description":"`pstn` (phone)."},"direction":{"type":"string","enum":["inbound","outbound"]},"from":{"type":"string"},"to":{"type":"string"},"status":{"type":"string","description":"dialing, ringing, answered, ended, failed, no_answer…"},"endReason":{"type":"string"},"durationSeconds":{"type":"number"},"recording":{"type":"boolean"},"transcriptSnippet":{"type":"string"},"transcript":{"description":"Only on GET /calls/{id}.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"at":{"type":"string"}},"required":["text"]}},"cost":{"description":"Euros.","type":"number"},"startedAt":{"type":"string"},"endedAt":{"type":"string"}},"required":["id","numberId","channel","direction","from","to","status","recording"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recording":{"get":{"operationId":"getCallRecording","tags":["calls"],"summary":"Recording of a call","description":"A link to the MP3 that works for 15 minutes. Only calls recorded (setting or per call).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","description":"Works for 15 minutes."}},"required":["url"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/end":{"post":{"operationId":"endCall","tags":["calls"],"summary":"Hang up","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/transfer":{"post":{"operationId":"transferCall","tags":["calls"],"summary":"Transfer a live call","description":"To another phone (+E164) or a SIP address; the call leaves your control.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":"string","pattern":"^(\\+[1-9]\\d{6,14}|sip:\\S+)$"}},"required":["to"],"additionalProperties":false}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/whatsapp/templates":{"get":{"operationId":"listWhatsAppTemplates","tags":["whatsapp"],"summary":"List templates","description":"Read live from Meta, one entry per name and language.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","description":"MARKETING, UTILITY or AUTHENTICATION."},"status":{"type":"string","description":"Meta's verdict: PENDING, APPROVED, REJECTED, IN_APPEAL, PAUSED, DISABLED or PENDING_DELETION. Only APPROVED can be sent."},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["id","name","language","category","status","components"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWhatsAppTemplate","tags":["whatsapp"],"summary":"Create a template","description":"Meta reviews it (up to 24 hours): it starts as PENDING and can only be sent once APPROVED. The category decides what Meta charges for each message.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,511}$"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"language":{"type":"string","minLength":2,"maxLength":10,"description":"Meta language code, e.g. es, en_US, pt_BR."},"components":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Meta's components: a BODY with its text ({{1}}, {{2}}…) and an example for each placeholder, plus optional HEADER, FOOTER and BUTTONS."}},"required":["name","category","language","components"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","description":"MARKETING, UTILITY or AUTHENTICATION."},"status":{"type":"string","description":"Meta's verdict: PENDING, APPROVED, REJECTED, IN_APPEAL, PAUSED, DISABLED or PENDING_DELETION. Only APPROVED can be sent."},"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["id","name","language","category","status","components"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/whatsapp/templates/{name}":{"delete":{"operationId":"deleteWhatsAppTemplate","tags":["whatsapp"],"summary":"Delete a template","description":"Every language of the name, or only `language`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"language","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":10}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/conversations":{"post":{"operationId":"startConversation","tags":["whatsapp"],"summary":"Write first with a template","description":"Opens a WhatsApp conversation (or continues one after 24 hours of silence) with an APPROVED template. Their answer arrives in the inbox and as `message.received`; from then on reply with POST /inbox/conversations/{id}/messages for 24 hours.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The WhatsApp account to write from."},"phone":{"type":"string","pattern":"^\\+?[0-9][0-9 ()-]{6,20}$","description":"Who to write to."},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512},"language":{"type":"string","minLength":2,"maxLength":10},"params":{"description":"Values for the placeholders, in order: header, body, then URL buttons.","maxItems":30,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["name","language"],"description":"An APPROVED template: the only way to write first, or after 24 hours of silence."}},"required":["accountId","phone","template"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"description":"The conversation in the inbox (cnv_…): replies arrive there.","type":["string","null"]}},"required":["conversationId"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listConversations","tags":["inbox"],"summary":"List conversations","description":"Direct messages on Facebook, Instagram, X, Bluesky, Reddit and Telegram, most recent first.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":4000}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque conversation id."},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"participant":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"}}},"lastMessage":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"status":{"type":"string","enum":["active","archived"]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"description":"Opens the conversation on the network.","type":"string","format":"uri"}},"required":["id","accountId","platform","participant","status","unreadCount"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/whatsapp/broadcasts":{"get":{"operationId":"listBroadcasts","tags":["whatsapp"],"summary":"List broadcasts","description":"With how many recipients each reached, read and failed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque broadcast id (bcs_…)."},"accountId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","description":"draft, scheduled, sending, completed, failed or cancelled."},"template":{"type":"string"},"scheduledAt":{"type":"string"},"recipientCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deliveredCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"readCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","accountId","name","status","recipientCount","sentCount","deliveredCount","readCount","failedCount"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sendBroadcast","tags":["whatsapp"],"summary":"Send or schedule a broadcast","description":"An APPROVED template to a list of numbers, now or at `scheduledFor`. Each recipient is one outbound message; Meta charges its template fee to your WhatsApp Business account. A new number reaches at most 250 people a day until Meta raises its tier.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512},"language":{"type":"string","minLength":2,"maxLength":10},"variables":{"description":"What fills {{1}}, {{2}}… for each recipient: one of their fields, or the same value for all.","maxItems":30,"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["name","phone","email","company"]}},"required":["field"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","maxLength":1024}},"required":["value"],"additionalProperties":false}]}}},"required":["name","language"]},"phones":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","pattern":"^\\+?[0-9][0-9 ()-]{6,20}$"},"description":"Recipients with their country code."},"scheduledFor":{"description":"Send at this time; now when omitted.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["name","template","phones"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"Opaque broadcast id (bcs_…)."},"accountId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","description":"draft, scheduled, sending, completed, failed or cancelled."},"template":{"type":"string"},"scheduledAt":{"type":"string"},"recipientCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deliveredCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"readCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","accountId","name","status","recipientCount","sentCount","deliveredCount","readCount","failedCount"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/whatsapp/broadcasts/{broadcastId}/cancel":{"post":{"operationId":"cancelBroadcast","tags":["whatsapp"],"summary":"Cancel a broadcast","description":"A scheduled one, or what is left of one being sent. Messages already sent stay sent.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"broadcastId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/crm-settings":{"get":{"operationId":"getCrmSettings","tags":["accounts"],"summary":"What a CRM account syncs","description":"HubSpot accounts take no posts: they turn the people who write to the profile's inbox into contacts and log every message on their timeline.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"syncContacts":{"type":"boolean","description":"Create a CRM contact for each new person who writes."},"logMessages":{"type":"boolean","description":"Log every inbox message on the contact's timeline."}},"required":["syncContacts","logMessages"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCrmSettings","tags":["accounts"],"summary":"Turn CRM sync on or off","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"syncContacts":{"description":"Create a CRM contact for each new person who writes.","type":"boolean"},"logMessages":{"description":"Log every inbox message on the contact's timeline.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"syncContacts":{"type":"boolean","description":"Create a CRM contact for each new person who writes."},"logMessages":{"type":"boolean","description":"Log every inbox message on the contact's timeline."}},"required":["syncContacts","logMessages"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/blogs":{"get":{"operationId":"listBlogs","tags":["blogs"],"summary":"List a site's blogs","description":"A Shopify store can have several blogs and a Webflow site one per CMS collection with a rich text field; WordPress and Wix have one.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Send it as blogId. WordPress and Wix sites have one blog, `1`."},"title":{"type":"string"},"handle":{"type":"string"}},"required":["id","title"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/blogs/{blogId}/articles":{"get":{"operationId":"listArticles","tags":["blogs"],"summary":"List articles","description":"Published, scheduled, drafts and, on WordPress, pending and private ones.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":4000}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The site's own id for the article."},"blogId":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["wordpress","shopify","wix","webflow"]},"title":{"type":"string"},"bodyHtml":{"type":"string"},"handle":{"type":"string"},"excerpt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"author":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string"}},"required":["url"]},"seo":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}}},"status":{"description":"Published, scheduled, draft, waiting for review or private.","type":"string","enum":["publish","future","draft","pending","private"]},"isPublished":{"type":"boolean"},"publishDate":{"type":"string"},"url":{"description":"The article on the site, once published.","type":"string","format":"uri"}},"required":["id","blogId","accountId","platform","title","tags","isPublished"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createArticle","tags":["blogs"],"summary":"Create an article","description":"A draft unless you send `isPublished: true`; with a future `publishDate` the site schedules it. The image is downloaded by the site from its URL (upload it first with POST /media/upload-url). `seo` works on Shopify and Wix; `fields` sets a Webflow collection's own fields.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"bodyHtml":{"type":"string","maxLength":500000,"description":"The article as HTML."},"handle":{"type":"string","maxLength":255,"description":"URL slug. Made from the title when omitted."},"excerpt":{"type":"string","maxLength":5000},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"description":"Replaces the whole list; missing tags are created."},"author":{"type":"string","minLength":1,"maxLength":200,"description":"WordPress: a user id. Shopify: a display name. Webflow: the author item id."},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":500}},"required":["url"],"additionalProperties":false,"description":"Featured image from a public URL (for example from POST /v1/media/upload-url)."},"seo":{"type":"object","properties":{"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":500}},"additionalProperties":false,"description":"Shopify and Wix only."},"isPublished":{"type":"boolean","description":"false keeps it as a draft."},"publishDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"A future date schedules it."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Webflow only: the collection's own fields, by slug."}},"required":["title"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The site's own id for the article."},"blogId":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["wordpress","shopify","wix","webflow"]},"title":{"type":"string"},"bodyHtml":{"type":"string"},"handle":{"type":"string"},"excerpt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"author":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string"}},"required":["url"]},"seo":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}}},"status":{"description":"Published, scheduled, draft, waiting for review or private.","type":"string","enum":["publish","future","draft","pending","private"]},"isPublished":{"type":"boolean"},"publishDate":{"type":"string"},"url":{"description":"The article on the site, once published.","type":"string","format":"uri"}},"required":["id","blogId","accountId","platform","title","tags","isPublished"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/blogs/{blogId}/articles/{articleId}":{"get":{"operationId":"getArticle","tags":["blogs"],"summary":"Get an article","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"articleId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The site's own id for the article."},"blogId":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["wordpress","shopify","wix","webflow"]},"title":{"type":"string"},"bodyHtml":{"type":"string"},"handle":{"type":"string"},"excerpt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"author":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string"}},"required":["url"]},"seo":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}}},"status":{"description":"Published, scheduled, draft, waiting for review or private.","type":"string","enum":["publish","future","draft","pending","private"]},"isPublished":{"type":"boolean"},"publishDate":{"type":"string"},"url":{"description":"The article on the site, once published.","type":"string","format":"uri"}},"required":["id","blogId","accountId","platform","title","tags","isPublished"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateArticle","tags":["blogs"],"summary":"Update, publish or unpublish an article","description":"Fields you leave out keep their value. `tags` replaces the whole list. `isPublished: false` takes it back to draft.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"articleId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"bodyHtml":{"type":"string","maxLength":500000,"description":"The article as HTML."},"handle":{"type":"string","maxLength":255,"description":"URL slug. Made from the title when omitted."},"excerpt":{"type":"string","maxLength":5000},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"description":"Replaces the whole list; missing tags are created."},"author":{"type":"string","minLength":1,"maxLength":200,"description":"WordPress: a user id. Shopify: a display name. Webflow: the author item id."},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":500}},"required":["url"],"additionalProperties":false,"description":"Featured image from a public URL (for example from POST /v1/media/upload-url)."},"seo":{"type":"object","properties":{"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":500}},"additionalProperties":false,"description":"Shopify and Wix only."},"isPublished":{"type":"boolean","description":"false keeps it as a draft."},"publishDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"A future date schedules it."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Webflow only: the collection's own fields, by slug."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"The site's own id for the article."},"blogId":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["wordpress","shopify","wix","webflow"]},"title":{"type":"string"},"bodyHtml":{"type":"string"},"handle":{"type":"string"},"excerpt":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"author":{"type":"string"},"image":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string"}},"required":["url"]},"seo":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}}},"status":{"description":"Published, scheduled, draft, waiting for review or private.","type":"string","enum":["publish","future","draft","pending","private"]},"isPublished":{"type":"boolean"},"publishDate":{"type":"string"},"url":{"description":"The article on the site, once published.","type":"string","format":"uri"}},"required":["id","blogId","accountId","platform","title","tags","isPublished"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteArticle","tags":["blogs"],"summary":"Delete an article","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"articleId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account-groups":{"get":{"operationId":"listAccountGroups","tags":["account-groups"],"summary":"List groups","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"accountIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","accountIds","createdAt","updatedAt"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAccountGroup","tags":["account-groups"],"summary":"Create a group","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"Unique within the workspace."},"accountIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1},"description":"Accounts of any profile."}},"required":["name","accountIds"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"accountIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","accountIds","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account-groups/{id}":{"patch":{"operationId":"updateAccountGroup","tags":["account-groups"],"summary":"Update a group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"Unique within the workspace."},"accountIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1},"description":"Accounts of any profile."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"accountIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","accountIds","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteAccountGroup","tags":["account-groups"],"summary":"Delete a group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts":{"post":{"operationId":"createPost","tags":["posts"],"summary":"Create a post","description":"Publishes now unless you send `scheduledFor`, `queue: true` or `draft: true`. Each target is one account and can carry its own text, media and network options (`instagram`, `youtube`, `tiktok`…). TikTok targets always need `tiktok` options. A `scheduledFor` in the past is refused (omit it to publish now).","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"content":{"type":"string","maxLength":10000,"description":"Text posted to every target that has no content of its own."},"media":{"description":"Images, videos or documents. Upload them first with POST /v1/media/upload-url.","maxItems":35,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"A connected account (GET /v1/accounts)."},"content":{"description":"Replaces the post text on this network.","type":"string","maxLength":10000},"media":{"maxItems":35,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"visibility":{"type":"string","enum":["public","unlisted","private"]},"madeForKids":{"type":"boolean"},"categoryId":{"type":"string","pattern":"^\\d{1,3}$"},"playlistId":{"type":"string","maxLength":100},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"firstComment":{"type":"string","maxLength":10000},"thumbnailUrl":{"type":"string","format":"uri"},"containsSyntheticMedia":{"type":"boolean"},"notifySubscribers":{"type":"boolean"}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"privacy":{"type":"string","enum":["public","friends","followers","private"]},"allowComments":{"type":"boolean"},"allowDuet":{"default":false,"type":"boolean"},"allowStitch":{"default":false,"type":"boolean"},"commercialContent":{"type":"string","enum":["own_brand","paid_partnership"]},"autoAddMusic":{"type":"boolean"},"consent":{"type":"boolean","const":true}},"required":["privacy","allowComments","consent"],"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["feed","reel","story"]},"shareToFeed":{"type":"boolean"},"collaborators":{"maxItems":3,"type":"array","items":{"type":"string","pattern":"^@?[\\w.]{1,30}$"}},"firstComment":{"type":"string","maxLength":2200},"coverUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["feed","reel","story"]},"reelTitle":{"type":"string","maxLength":255},"firstComment":{"type":"string","minLength":1,"maxLength":10000}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"firstComment":{"type":"string","minLength":1,"maxLength":10000},"disableLinkPreview":{"type":"boolean"},"documentTitle":{"type":"string","maxLength":400}},"additionalProperties":false},"x":{"type":"object","properties":{"thread":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"replySettings":{"type":"string","enum":["following","mentionedUsers","subscribers","verified"]}},"additionalProperties":false},"threads":{"type":"object","properties":{"thread":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"topicTag":{"type":"string","minLength":1,"maxLength":50},"firstComment":{"type":"string","minLength":1,"maxLength":10000}},"additionalProperties":false},"bluesky":{"type":"object","properties":{"thread":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","maxLength":100},"link":{"type":"string","format":"uri"},"boardId":{"type":"string","maxLength":100}},"additionalProperties":false},"googleBusiness":{"type":"object","properties":{"callToAction":{"type":"object","properties":{"type":{"type":"string","enum":["learn_more","book","order","shop","sign_up","call"]},"url":{"type":"string","format":"uri"}},"required":["type"],"additionalProperties":false}},"additionalProperties":false},"telegram":{"type":"object","properties":{"parseMode":{"type":"string","enum":["html","markdown"]},"disableLinkPreview":{"type":"boolean"},"silent":{"type":"boolean"},"protectContent":{"type":"boolean"}},"additionalProperties":false},"snapchat":{"type":"object","properties":{"format":{"type":"string","enum":["story","saved_story","spotlight"]}},"additionalProperties":false},"reddit":{"type":"object","properties":{"subreddit":{"type":"string","pattern":"^[\\w]{2,21}$"},"title":{"type":"string","maxLength":300},"link":{"type":"string","format":"uri"},"flairId":{"type":"string","maxLength":100},"nsfw":{"type":"boolean"},"spoiler":{"type":"boolean"}},"additionalProperties":false}},"required":["accountId"]}},"scheduledFor":{"description":"When to publish (ISO 8601 with offset). Omit to publish now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"timezone":{"description":"IANA timezone that scheduledFor refers to.","type":"string","maxLength":64},"queue":{"description":"Take the next free slot of the profile's queue.","type":"boolean"},"draft":{"description":"Save without publishing or scheduling.","type":"boolean"},"requiresApproval":{"description":"Hold it as `pending_approval` until an owner or admin approves it. Members of a workspace that requires approval always get it.","type":"boolean"}},"required":["content","targets"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"202":{"description":"The network has not confirmed the post yet (slow networks such as Instagram carousels or videos). It is kept as `publishing` (or `scheduled`) and confirmed within minutes, never published twice: follow it with GET /v1/posts/{id} or the webhooks.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listPosts","tags":["posts"],"summary":"List posts","description":"Newest first, optionally one profile's or one status, a page at a time.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":64}},{"name":"profileId","in":"query","required":false,"description":"Only posts to this profile's accounts.","schema":{"type":"string","minLength":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}},"nextCursor":{"type":["string","null"],"description":"Send it as cursor for the next page; null on the last one."}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/import":{"post":{"operationId":"importPosts","tags":["posts"],"summary":"Import posts from a CSV","description":"One post per row, up to 50 rows. Columns: `content`, `accounts` (ids separated by `|`) or `group`, `schedule_time`, `timezone`, `queue`, `draft`, `media_urls` and per-network columns (see the CSV import guide). Send `dryRun: true` first to check every row without posting.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"csv":{"type":"string","minLength":1,"maxLength":1000000,"description":"The CSV text, header row first."},"dryRun":{"description":"Check every row without posting.","type":"boolean"}},"required":["csv"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dryRun":{"type":"boolean"},"unknownColumns":{"type":"array","items":{"type":"string"},"description":"Columns that were ignored."},"rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-based, header excluded."},"ok":{"type":"boolean"},"postId":{"type":"string"},"error":{"type":"string"}},"required":["row","ok"]}}},"required":["total","valid","invalid","dryRun","unknownColumns","rows"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}":{"patch":{"operationId":"updatePost","tags":["posts"],"summary":"Change a post that is not live","description":"Drafts, scheduled, failed and cancelled posts. Fields you leave out keep their value; `targets` replaces the whole list. `draft: false` publishes a draft now, or at `scheduledFor`, or in the queue.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"content":{"type":"string","maxLength":10000,"description":"Text posted to every target that has no content of its own."},"media":{"description":"Images, videos or documents. Upload them first with POST /v1/media/upload-url.","maxItems":35,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"A connected account (GET /v1/accounts)."},"content":{"description":"Replaces the post text on this network.","type":"string","maxLength":10000},"media":{"maxItems":35,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"youtube":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"visibility":{"type":"string","enum":["public","unlisted","private"]},"madeForKids":{"type":"boolean"},"categoryId":{"type":"string","pattern":"^\\d{1,3}$"},"playlistId":{"type":"string","maxLength":100},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"firstComment":{"type":"string","maxLength":10000},"thumbnailUrl":{"type":"string","format":"uri"},"containsSyntheticMedia":{"type":"boolean"},"notifySubscribers":{"type":"boolean"}},"additionalProperties":false},"tiktok":{"type":"object","properties":{"privacy":{"type":"string","enum":["public","friends","followers","private"]},"allowComments":{"type":"boolean"},"allowDuet":{"default":false,"type":"boolean"},"allowStitch":{"default":false,"type":"boolean"},"commercialContent":{"type":"string","enum":["own_brand","paid_partnership"]},"autoAddMusic":{"type":"boolean"},"consent":{"type":"boolean","const":true}},"required":["privacy","allowComments","consent"],"additionalProperties":false},"instagram":{"type":"object","properties":{"format":{"type":"string","enum":["feed","reel","story"]},"shareToFeed":{"type":"boolean"},"collaborators":{"maxItems":3,"type":"array","items":{"type":"string","pattern":"^@?[\\w.]{1,30}$"}},"firstComment":{"type":"string","maxLength":2200},"coverUrl":{"type":"string","format":"uri"}},"additionalProperties":false},"facebook":{"type":"object","properties":{"format":{"type":"string","enum":["feed","reel","story"]},"reelTitle":{"type":"string","maxLength":255},"firstComment":{"type":"string","minLength":1,"maxLength":10000}},"additionalProperties":false},"linkedin":{"type":"object","properties":{"firstComment":{"type":"string","minLength":1,"maxLength":10000},"disableLinkPreview":{"type":"boolean"},"documentTitle":{"type":"string","maxLength":400}},"additionalProperties":false},"x":{"type":"object","properties":{"thread":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"replySettings":{"type":"string","enum":["following","mentionedUsers","subscribers","verified"]}},"additionalProperties":false},"threads":{"type":"object","properties":{"thread":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"topicTag":{"type":"string","minLength":1,"maxLength":50},"firstComment":{"type":"string","minLength":1,"maxLength":10000}},"additionalProperties":false},"bluesky":{"type":"object","properties":{"thread":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}}},"additionalProperties":false},"pinterest":{"type":"object","properties":{"title":{"type":"string","maxLength":100},"link":{"type":"string","format":"uri"},"boardId":{"type":"string","maxLength":100}},"additionalProperties":false},"googleBusiness":{"type":"object","properties":{"callToAction":{"type":"object","properties":{"type":{"type":"string","enum":["learn_more","book","order","shop","sign_up","call"]},"url":{"type":"string","format":"uri"}},"required":["type"],"additionalProperties":false}},"additionalProperties":false},"telegram":{"type":"object","properties":{"parseMode":{"type":"string","enum":["html","markdown"]},"disableLinkPreview":{"type":"boolean"},"silent":{"type":"boolean"},"protectContent":{"type":"boolean"}},"additionalProperties":false},"snapchat":{"type":"object","properties":{"format":{"type":"string","enum":["story","saved_story","spotlight"]}},"additionalProperties":false},"reddit":{"type":"object","properties":{"subreddit":{"type":"string","pattern":"^[\\w]{2,21}$"},"title":{"type":"string","maxLength":300},"link":{"type":"string","format":"uri"},"flairId":{"type":"string","maxLength":100},"nsfw":{"type":"boolean"},"spoiler":{"type":"boolean"}},"additionalProperties":false}},"required":["accountId"]}},"scheduledFor":{"description":"When to publish (ISO 8601 with offset). Omit to publish now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"timezone":{"description":"IANA timezone that scheduledFor refers to.","type":"string","maxLength":64},"queue":{"description":"Take the next free slot of the profile's queue.","type":"boolean"},"draft":{"description":"Save without publishing or scheduling.","type":"boolean"},"requiresApproval":{"description":"Hold it as `pending_approval` until an owner or admin approves it. Members of a workspace that requires approval always get it.","type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"getPost","tags":["posts"],"summary":"Get a post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deletePost","tags":["posts"],"summary":"Delete a post","description":"Removes it from Marsial, taking its live copies down first where the network allows it. Instagram and TikTok do not: delete those copies in the app, then send `keepLive=true`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"keepLive","in":"query","required":false,"description":"Forget the post even if copies stay live on networks that do not allow removing them (Instagram, TikTok): delete those in the app first.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/edit":{"post":{"operationId":"editPublishedPost","tags":["posts"],"summary":"Edit the text of a live post","description":"On X (Premium accounts, within 1 hour), Facebook, LinkedIn, YouTube, Google Business, Telegram, Discord and Reddit. Media cannot change.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":10000,"description":"The new text of the live post."},"accountId":{"description":"Edit only this account’s copy; every live copy otherwise.","type":"string","minLength":1}},"required":["content"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/metrics":{"get":{"operationId":"getPostMetrics","tags":["posts"],"summary":"Get the metrics of a post","description":"Impressions, reach, views, likes, comments, shares, saves and clicks, in total and per account. Each network reports its own subset.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"total":{"type":"object","properties":{"impressions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reach":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"likes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"comments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saves":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"engagementRate":{"type":"number","description":"Percentage: interactions over impressions (or reach)."}},"required":["impressions","reach","views","likes","comments","shares","saves","clicks","engagementRate"]},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"metrics":{"type":"object","properties":{"impressions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reach":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"likes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"comments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saves":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"engagementRate":{"type":"number","description":"Percentage: interactions over impressions (or reach)."}},"required":["impressions","reach","views","likes","comments","shares","saves","clicks","engagementRate"]}},"required":["accountId","platform","metrics"]}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["total","targets"]},{"type":"null"}],"description":"Null until the networks report metrics, usually minutes after publishing."}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/cancel":{"post":{"operationId":"cancelPost","tags":["posts"],"summary":"Cancel a scheduled post, draft or post waiting for approval","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/review":{"post":{"operationId":"reviewPost","tags":["posts"],"summary":"Approve or reject a post","description":"Only for posts in `pending_approval`, by owners, admins or an API key. Approving schedules it for its date, puts it in the queue if it asked for one, or publishes it now if its date already passed. Rejecting returns it to draft with the note and sends `post.rejected`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"],"description":"`approve` schedules it (or publishes it now if its date passed); `reject` returns it to draft."},"note":{"description":"Why, for whoever wrote it. Shown with the draft after a rejection.","type":"string","maxLength":1000}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/recycling":{"put":{"operationId":"setRecycling","tags":["posts"],"summary":"Recycle a post","description":"Posts it again every `every` weeks or months as a new post (`recycledFrom` points back), until `maxCopies` or `until`. YouTube and TikTok targets are left out of the copies, and each account can have up to 10 posts recycling. Sending it again changes the rule and keeps the count.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"every":{"type":"integer","minimum":1,"maximum":52,"description":"How many units between copies."},"unit":{"type":"string","enum":["week","month"],"description":"`week` or `month`."},"startAt":{"description":"When the first copy goes out. Defaults to one interval after the post’s date; for an old post, the next date of that series, at the same time of day.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"maxCopies":{"description":"Stop after this many copies.","type":"integer","minimum":1,"maximum":100},"until":{"description":"Stop after this date.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"variations":{"description":"Texts used in turn instead of the post’s text. A target’s own text still wins. Recommended for X and Pinterest, which flag repeats.","minItems":2,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":10000}},"timezone":{"description":"IANA time zone (e.g. `Europe/Madrid`) the interval is counted in, so copies keep their local time when the clocks change. UTC by default.","type":"string","maxLength":64}},"required":["every","unit"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"stopRecycling","tags":["posts"],"summary":"Stop recycling a post","description":"Copies already created stay as they are.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/retry":{"post":{"operationId":"retryPost","tags":["posts"],"summary":"Retry the failed targets","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/posts/{id}/unpublish":{"post":{"operationId":"unpublishPost","tags":["posts"],"summary":"Take a published post down","description":"From every network, or only from `accountId`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/conversations/{id}/messages":{"get":{"operationId":"listMessages","tags":["inbox"],"summary":"List the messages of a conversation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":false,"description":"Only for conversation ids issued before 2026-10-27: newer ids carry their account.","schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":4000}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["incoming","outgoing"]},"text":{"type":"string"},"senderName":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"attachments":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","audio","file","sticker","share","other"]},"url":{"type":"string","format":"uri"},"name":{"type":"string"}},"required":["type"]}},"deliveryStatus":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","direction","text","createdAt","attachments","deleted"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"],"description":"Oldest first within a page; the next page goes further back."}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sendMessage","tags":["inbox"],"summary":"Send a message","description":"Text, an attachment or both. Meta only lets a page answer within 24 hours of the person’s last message.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"description":"Only for conversation ids issued before 2026-10-27: newer ids carry their account.","type":"string","minLength":1},"text":{"type":"string","minLength":1,"maxLength":4000},"attachmentUrl":{"description":"A public https URL (for example from POST /v1/media/upload-url).","type":"string","format":"uri"},"attachmentType":{"type":"string","enum":["image","video","audio","file"]}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"description":"The message, as the conversation lists it; null when the network gives no id.","type":["string","null"]}},"required":["id"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/conversations/{id}/read":{"post":{"operationId":"markConversationRead","tags":["inbox"],"summary":"Mark a conversation as read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"description":"Only for conversation ids issued before 2026-10-27: newer ids carry their account.","type":"string","minLength":1}}}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/conversations/{id}":{"patch":{"operationId":"setConversationStatus","tags":["inbox"],"summary":"Archive or reopen a conversation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"description":"Only for conversation ids issued before 2026-10-27: newer ids carry their account.","type":"string","minLength":1},"status":{"type":"string","enum":["active","archived"]}},"required":["status"]}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/posts":{"get":{"operationId":"listCommentedPosts","tags":["inbox"],"summary":"List posts with comments","description":"Recent posts of the profile’s accounts with their comment counts, including posts published outside Marsial.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":4000}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque post id for the comment endpoints."},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"picture":{"type":"string","format":"uri"},"url":{"type":"string","format":"uri"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"commentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"likeCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","accountId","platform","content","commentCount","likeCount"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/posts/{id}/comments":{"get":{"operationId":"listComments","tags":["inbox"],"summary":"List the comments of a post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":true,"description":"The account the item belongs to.","schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":4000}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque comment id."},"text":{"type":"string"},"author":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"},"isOwner":{"type":"boolean","description":"Written by the connected account."}},"required":["isOwner"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"likeCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replyCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","format":"uri"},"can":{"type":"object","properties":{"reply":{"type":"boolean"},"delete":{"type":"boolean"},"hide":{"type":"boolean"},"like":{"type":"boolean"}},"required":["reply","delete","hide","like"],"description":"What this network allows on it."},"hidden":{"type":"boolean"},"liked":{"type":"boolean"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque comment id."},"text":{"type":"string"},"author":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"},"isOwner":{"type":"boolean","description":"Written by the connected account."}},"required":["isOwner"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"likeCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replyCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","format":"uri"},"can":{"type":"object","properties":{"reply":{"type":"boolean"},"delete":{"type":"boolean"},"hide":{"type":"boolean"},"like":{"type":"boolean"}},"required":["reply","delete","hide","like"],"description":"What this network allows on it."},"hidden":{"type":"boolean"},"liked":{"type":"boolean"}},"required":["id","text","author","likeCount","replyCount","can","hidden","liked"]}}},"required":["id","text","author","likeCount","replyCount","can","hidden","liked","replies"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"replyToComment","tags":["inbox"],"summary":"Comment or reply to a comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The account the item belongs to."},"text":{"type":"string","minLength":1,"maxLength":8000},"commentId":{"description":"Reply under this comment; omit to comment on the post.","type":"string","minLength":1}},"required":["accountId","text"]}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/posts/{id}/comments/{commentId}":{"patch":{"operationId":"setCommentState","tags":["inbox"],"summary":"Hide or like a comment","description":"Each comment says in `can` what its network allows.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The account the item belongs to."},"hidden":{"type":"boolean"},"liked":{"type":"boolean"}},"required":["accountId"]}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteComment","tags":["inbox"],"summary":"Delete a comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":true,"description":"The account the item belongs to.","schema":{"type":"string","minLength":1}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/mentions":{"get":{"operationId":"listMentions","tags":["inbox"],"summary":"List mentions","description":"Posts and comments by others that tag the profile’s accounts, from the last 7 days: Instagram (accounts connected through Facebook) and LinkedIn pages.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":4000}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque mention id."},"accountId":{"type":"string","description":"The connected account that was mentioned."},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"kind":{"type":"string","enum":["comment","caption","post"],"description":"Instagram: tagged in a comment (`comment`) or in a post caption (`caption`). LinkedIn: tagged in a post (`post`)."},"content":{"type":"string","description":"The text that mentions the account. Instagram may send it a moment later: empty until then."},"author":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"}}},"url":{"description":"The post that mentions the account (LinkedIn).","type":"string","format":"uri"},"publishedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"canReply":{"type":"boolean","description":"Whether POST /v1/inbox/mentions/{id}/reply works on it: Instagram only."}},"required":["id","accountId","platform","kind","content","author","canReply"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]}},"required":["items","nextCursor"],"description":"Mentions from the last 7 days, newest first."}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/mentions/{id}/reply":{"post":{"operationId":"replyToMention","tags":["inbox"],"summary":"Reply to a mention","description":"Instagram only (`canReply`): replies under the comment that tagged the account, or comments on the post whose caption did.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The account the item belongs to."},"text":{"type":"string","minLength":1,"maxLength":2200}},"required":["accountId","text"]}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/reviews":{"get":{"operationId":"listReviews","tags":["inbox"],"summary":"List reviews","description":"Google Business and Facebook reviews, with their total and average rating.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","required":false,"description":"nextCursor of the previous page.","schema":{"type":"string","maxLength":4000}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"hasReply","in":"query","required":false,"description":"Only reviews with (true) or without (false) a reply.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Opaque review id."},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"reviewer":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"}}},"rating":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"1 to 5; null on Facebook, which recommends instead."},"recommends":{"type":"boolean"},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reply":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["text"]},{"type":"null"}]},"url":{"type":"string","format":"uri"},"location":{"description":"Google Business location.","type":"string"}},"required":["id","accountId","platform","reviewer","rating","text","reply"]}},"nextCursor":{"description":"Send it as cursor for the next page; null on the last one.","type":["string","null"]},"summary":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"averageRating":{"type":["number","null"]}},"required":["total","averageRating"]}},"required":["items","nextCursor","summary"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbox/reviews/{id}/reply":{"post":{"operationId":"replyToReview","tags":["inbox"],"summary":"Reply to a review","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The account the item belongs to."},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["accountId","text"]}}}},"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteReviewReply","tags":["inbox"],"summary":"Delete a review reply","description":"Google Business only.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":true,"description":"The account the item belongs to.","schema":{"type":"string","minLength":1}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/automations":{"get":{"operationId":"listAutomations","tags":["automations"],"summary":"List automations","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"name":{"type":"string"},"trigger":{"type":"string","enum":["comment","story_reply"]},"postId":{"type":["string","null"]},"inboxPostId":{"type":["string","null"]},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","word","exact"]},"excludeKeywords":{"type":"array","items":{"type":"string"}},"dmMessage":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["url","postback"]},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"payload":{"type":"string"}},"required":["type","title"]}},"commentReply":{"type":"string"},"dmDelaySeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"repeat":{"type":"string","enum":["once","every_comment"]},"likeComment":{"type":"boolean"},"hideComment":{"type":"boolean"},"active":{"type":"boolean"},"stats":{"type":"object","properties":{"triggered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsSent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsFailed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uniqueContacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"linkClicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["triggered","dmsSent","dmsFailed","uniqueContacts","linkClicks"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","accountId","platform","name","trigger","postId","inboxPostId","keywords","matchMode","excludeKeywords","buttons","repeat","likeComment","hideComment","active","stats"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAutomation","tags":["automations"],"summary":"Create an automation","description":"On Instagram and Facebook it sends `dmMessage` (with up to 3 buttons) to whoever comments a keyword; on TikTok, Threads, LinkedIn and YouTube it posts `commentReply`. Without a post it watches every post of the account.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"trigger":{"default":"comment","type":"string","enum":["comment","story_reply"],"description":"`story_reply`: replies to an Instagram story."},"postId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"A Marsial post to watch."},"inboxPostId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Or a post as GET /v1/inbox/posts lists it. Neither: every post."},"keywords":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"description":"Empty: any comment fires it."},"matchMode":{"default":"contains","type":"string","enum":["contains","word","exact"]},"excludeKeywords":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"dmMessage":{"type":"string","minLength":1,"maxLength":1000,"description":"Private message to the commenter. Instagram and Facebook only, required there."},"buttons":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["url","postback"]},"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","format":"uri"},"payload":{"type":"string","maxLength":1000}},"required":["type","title"],"additionalProperties":false},"description":"Up to 3 buttons under the DM."},"commentReply":{"type":"string","minLength":1,"maxLength":2000,"description":"Public reply to the comment. Required on TikTok, Threads, LinkedIn and YouTube."},"dmDelaySeconds":{"type":"integer","minimum":0,"maximum":86400},"repeat":{"default":"once","type":"string","enum":["once","every_comment"],"description":"`once`: one DM per person."},"likeComment":{"default":false,"type":"boolean"},"hideComment":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"},"accountId":{"type":"string","minLength":1,"description":"Instagram, Facebook, TikTok, Threads, LinkedIn or YouTube account."}},"required":["name","accountId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"name":{"type":"string"},"trigger":{"type":"string","enum":["comment","story_reply"]},"postId":{"type":["string","null"]},"inboxPostId":{"type":["string","null"]},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","word","exact"]},"excludeKeywords":{"type":"array","items":{"type":"string"}},"dmMessage":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["url","postback"]},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"payload":{"type":"string"}},"required":["type","title"]}},"commentReply":{"type":"string"},"dmDelaySeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"repeat":{"type":"string","enum":["once","every_comment"]},"likeComment":{"type":"boolean"},"hideComment":{"type":"boolean"},"active":{"type":"boolean"},"stats":{"type":"object","properties":{"triggered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsSent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsFailed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uniqueContacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"linkClicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["triggered","dmsSent","dmsFailed","uniqueContacts","linkClicks"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","accountId","platform","name","trigger","postId","inboxPostId","keywords","matchMode","excludeKeywords","buttons","repeat","likeComment","hideComment","active","stats"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/automations/{id}":{"get":{"operationId":"getAutomation","tags":["automations"],"summary":"Get an automation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"name":{"type":"string"},"trigger":{"type":"string","enum":["comment","story_reply"]},"postId":{"type":["string","null"]},"inboxPostId":{"type":["string","null"]},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","word","exact"]},"excludeKeywords":{"type":"array","items":{"type":"string"}},"dmMessage":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["url","postback"]},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"payload":{"type":"string"}},"required":["type","title"]}},"commentReply":{"type":"string"},"dmDelaySeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"repeat":{"type":"string","enum":["once","every_comment"]},"likeComment":{"type":"boolean"},"hideComment":{"type":"boolean"},"active":{"type":"boolean"},"stats":{"type":"object","properties":{"triggered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsSent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsFailed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uniqueContacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"linkClicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["triggered","dmsSent","dmsFailed","uniqueContacts","linkClicks"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","accountId","platform","name","trigger","postId","inboxPostId","keywords","matchMode","excludeKeywords","buttons","repeat","likeComment","hideComment","active","stats"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAutomation","tags":["automations"],"summary":"Update or pause an automation","description":"Fields you leave out keep their value. `active: false` pauses it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"trigger":{"type":"string","enum":["comment","story_reply"],"description":"`story_reply`: replies to an Instagram story."},"postId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"A Marsial post to watch."},"inboxPostId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Or a post as GET /v1/inbox/posts lists it. Neither: every post."},"keywords":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"description":"Empty: any comment fires it."},"matchMode":{"type":"string","enum":["contains","word","exact"]},"excludeKeywords":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"dmMessage":{"type":"string","minLength":1,"maxLength":1000,"description":"Private message to the commenter. Instagram and Facebook only, required there."},"buttons":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["url","postback"]},"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","format":"uri"},"payload":{"type":"string","maxLength":1000}},"required":["type","title"],"additionalProperties":false},"description":"Up to 3 buttons under the DM."},"commentReply":{"type":"string","minLength":1,"maxLength":2000,"description":"Public reply to the comment. Required on TikTok, Threads, LinkedIn and YouTube."},"dmDelaySeconds":{"type":"integer","minimum":0,"maximum":86400},"repeat":{"type":"string","enum":["once","every_comment"],"description":"`once`: one DM per person."},"likeComment":{"type":"boolean"},"hideComment":{"type":"boolean"},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"name":{"type":"string"},"trigger":{"type":"string","enum":["comment","story_reply"]},"postId":{"type":["string","null"]},"inboxPostId":{"type":["string","null"]},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","word","exact"]},"excludeKeywords":{"type":"array","items":{"type":"string"}},"dmMessage":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["url","postback"]},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"payload":{"type":"string"}},"required":["type","title"]}},"commentReply":{"type":"string"},"dmDelaySeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"repeat":{"type":"string","enum":["once","every_comment"]},"likeComment":{"type":"boolean"},"hideComment":{"type":"boolean"},"active":{"type":"boolean"},"stats":{"type":"object","properties":{"triggered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsSent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dmsFailed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uniqueContacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"linkClicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["triggered","dmsSent","dmsFailed","uniqueContacts","linkClicks"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","accountId","platform","name","trigger","postId","inboxPostId","keywords","matchMode","excludeKeywords","buttons","repeat","likeComment","hideComment","active","stats"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteAutomation","tags":["automations"],"summary":"Delete an automation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/automations/{id}/logs":{"get":{"operationId":"listAutomationLogs","tags":["automations"],"summary":"What an automation did","description":"Every comment that fired it, newest first, with the DM outcome.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"commenter":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"}}},"commentText":{"type":"string"},"status":{"type":"string","enum":["pending","sent","failed","skipped","gated"]},"error":{"type":"string"},"replyStatus":{"type":"string"},"clicked":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","commenter","status","clicked","createdAt"]}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["items","total"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/followers":{"get":{"operationId":"getFollowers","tags":["analytics"],"summary":"Followers and growth","description":"Current followers, growth over the period and the daily history of each account. Refreshed once a day.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"description":"Only this account; the whole profile otherwise.","schema":{"type":"string","minLength":1}},{"name":"from","in":"query","required":false,"description":"First day (YYYY-MM-DD). Defaults to 30 days ago.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"description":"Last day (YYYY-MM-DD). Defaults to today.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"username":{"type":"string"},"followers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"growth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Change over the period."},"growthPercent":{"type":"number"},"history":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"YYYY-MM-DD"},"followers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","followers"]}}},"required":["accountId","platform","followers","growth","growthPercent","history"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/daily":{"get":{"operationId":"getDailyMetrics","tags":["analytics"],"summary":"Daily totals","description":"Posts and engagement per day (counted on the day it arrived), and totals per network.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"description":"Only this account; the whole profile otherwise.","schema":{"type":"string","minLength":1}},{"name":"from","in":"query","required":false,"description":"First day (YYYY-MM-DD). Defaults to 30 days ago.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"description":"Last day (YYYY-MM-DD). Defaults to today.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"YYYY-MM-DD"},"posts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"metrics":{"type":"object","properties":{"impressions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reach":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"likes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"comments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saves":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"engagementRate":{"type":"number","description":"Percentage: interactions over impressions (or reach)."}},"required":["impressions","reach","views","likes","comments","shares","saves","clicks","engagementRate"]}},"required":["date","posts","metrics"]}},"byPlatform":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"posts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"metrics":{"type":"object","properties":{"impressions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reach":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"likes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"comments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saves":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"engagementRate":{"type":"number","description":"Percentage: interactions over impressions (or reach)."}},"required":["impressions","reach","views","likes","comments","shares","saves","clicks","engagementRate"]}},"required":["platform","posts","metrics"]}}},"required":["days","byPlatform"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/best-times":{"get":{"operationId":"getBestTimes","tags":["analytics"],"summary":"Best times to post","description":"Average engagement per weekday and hour, from the account’s published posts.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"description":"Only this account; the whole profile otherwise.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 = Sunday … 6 = Saturday"},"hour":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Hour in UTC"},"avgEngagement":{"type":"number"},"posts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["dayOfWeek","hour","avgEngagement","posts"]},"description":"Best slots first."}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/top-posts":{"get":{"operationId":"getTopPosts","tags":["analytics"],"summary":"Top posts","description":"Posts of the period by engagement (or date), including those published outside Marsial.","parameters":[{"name":"profileId","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"accountId","in":"query","required":false,"description":"Only this account; the whole profile otherwise.","schema":{"type":"string","minLength":1}},{"name":"from","in":"query","required":false,"description":"First day (YYYY-MM-DD). Defaults to 30 days ago.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"description":"Last day (YYYY-MM-DD). Defaults to today.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"sortBy","in":"query","required":false,"schema":{"type":"string","enum":["engagement","date"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"postId":{"description":"The Marsial post, when it was published through Marsial.","type":["string","null"]},"accountId":{"type":["string","null"]},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"publishedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"url":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"metrics":{"type":"object","properties":{"impressions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reach":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"likes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"comments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"saves":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clicks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"engagementRate":{"type":"number","description":"Percentage: interactions over impressions (or reach)."}},"required":["impressions","reach","views","likes","comments","shares","saves","clicks","engagementRate"]},"external":{"type":"boolean","description":"Published outside Marsial."}},"required":["postId","accountId","platform","content","metrics","external"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/media/upload-url":{"post":{"operationId":"createUploadUrl","tags":["media"],"summary":"Get an upload URL","description":"JPEG, PNG, WebP and GIF up to 20 MB; MP4, MOV and WebM up to 1 GB. PUT the file to `uploadUrl`, then post `publicUrl`.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","minLength":3},"size":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["filename","contentType","size"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"uploadUrl":{"type":"string","format":"uri","description":"Pre-signed URL: PUT the file there with the same Content-Type."},"publicUrl":{"type":"string","format":"uri","description":"Use it in a post's media once uploaded."},"kind":{"type":"string","enum":["image","gif","video"]},"expiresIn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds the upload URL stays valid."}},"required":["uploadUrl","publicUrl","kind","expiresIn"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoint":{"get":{"operationId":"getWebhookEndpoint","tags":["webhooks"],"summary":"Get the webhook endpoint","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["account.connected","account.disconnected","post.scheduled","post.published","post.partial","post.failed","post.cancelled","post.removed","post.rejected","post.recycled","post.draft_saved","post.deleted","message.received","comment.received","review.received"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","events","createdAt","updatedAt"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"setWebhookEndpoint","tags":["webhooks"],"summary":"Set the webhook endpoint","description":"Omit `events` to receive all of them. The signing secret is returned only the first time.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"starts_with","pattern":"^https:\\/\\/.*"},"events":{"type":"array","items":{"type":"string","enum":["account.connected","account.disconnected","post.scheduled","post.published","post.partial","post.failed","post.cancelled","post.removed","post.rejected","post.recycled","post.draft_saved","post.deleted","message.received","comment.received","review.received"]}}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"endpoint":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["account.connected","account.disconnected","post.scheduled","post.published","post.partial","post.failed","post.cancelled","post.removed","post.rejected","post.recycled","post.draft_saved","post.deleted","message.received","comment.received","review.received"]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["url","events","createdAt","updatedAt"]},"secret":{"description":"Signing secret, returned only when the endpoint is created.","type":"string"}},"required":["endpoint"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteWebhookEndpoint","tags":["webhooks"],"summary":"Delete the webhook endpoint","parameters":[],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoint/test":{"post":{"operationId":"sendTestWebhook","tags":["webhooks"],"summary":"Send a test event","description":"Sends the endpoint a sample of the event with `test: true` and made-up ids, signed and retried like a real one. The endpoint must be subscribed to it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"type":{"type":"string","enum":["account.connected","account.disconnected","post.scheduled","post.published","post.partial","post.failed","post.cancelled","post.removed","post.rejected","post.recycled","post.draft_saved","post.deleted","message.received","comment.received","review.received"],"description":"The event to send a sample of."}},"required":["type"]}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","description":"evt_… of the sample."},"type":{"type":"string"}},"required":["id","type"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing":{"get":{"operationId":"getBilling","tags":["billing"],"summary":"Get the balance","description":"Balance, the free trial, connected accounts and what they cost. Once the trial ends without a top-up, or the balance is used up after paying, connecting accounts and publishing or sending answer 402; scheduled posts of an ended trial wait as `paused` until the first top-up.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean","description":"False while billing is not available: nothing is charged or limited."},"balance":{"type":"number","description":"Prepaid balance in euro cents (up to three decimals): `1250.5` is 12.505 €. Negative when charges outran it."},"currency":{"type":"string"},"connectedAccounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial":{"description":"The free trial: connect any network (X and phone numbers need balance) and publish without paying. When it ends unpaid, scheduled posts pause until the first top-up.","type":"object","properties":{"status":{"type":"string","enum":["pending","active","expired","converted"],"description":"`pending`: nothing published yet; `active`: the free days run; `expired`: ended without paying; `converted`: paid."},"registeredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"startedAt":{"description":"First published post: the free days count from here.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"7 days after the first published post, and never more than 14 days after signing up."},"daysLeft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Whole days left (0 on the last day); null once it ended or was paid."},"trialDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Free days once it starts: 7, fewer when the 14-day limit cuts it."},"maxAccounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Accounts the trial covers (20). Connecting a 21st needs balance, and the first top-up ends the trial."},"banner":{"description":"What the dashboard shows now about the trial.","type":"string","enum":["first_post","two_days_left","running","day6","ended"]},"stats":{"type":"object","properties":{"published":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scheduled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Scheduled posts on hold since the trial ended."},"accounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["published","scheduled","paused","accounts"]}},"required":["status","registeredAt","endsAt","daysLeft","trialDays","maxAccounts","stats"]},"monthlyEstimate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Monthly price of the accounts connected now, in cents. It is charged day by day."},"dailyEstimate":{"type":"number","description":"What those accounts cost today, in cents (up to three decimals)."},"daysLeft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Whole days the balance covers at that cost; null when nothing is charged daily."},"lines":{"type":"array","items":{"type":"object","properties":{"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"accounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Cents per account and month."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to","accounts","unitAmount","amount"]}},"canConnectMore":{"type":"boolean","description":"Whether one more account can be connected right now."},"blocked":{"type":"boolean","description":"Publishing is on hold: the free trial ended without a top-up, or the balance is used up. Nothing is deleted."},"card":{"description":"The saved payment method, for automatic recharges.","type":"object","properties":{"brand":{"type":"string","description":"Card brand (`visa`, `mastercard`…) or another saved method (`link`, `sepa_debit`)."},"last4":{"type":"string"},"expMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["brand"]},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Recharge when the balance falls below this, in cents."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What each recharge adds, in cents."},"monthlyLimit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Most that automatic recharges add in a calendar month, in cents."}},"required":["enabled","threshold","amount","monthlyLimit"]},"autoRechargeError":{"description":"Why the last automatic recharge failed; it switched itself off.","type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"message":{"type":"string"}},"required":["at","message"]},"autoRechargedThisMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Added by automatic recharges this calendar month, in cents."},"topUp":{"type":"object","properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["min","max"],"description":"Allowed top-up amounts, in cents."},"hasPortal":{"type":"boolean","description":"Whether the billing portal (invoices, payment method) is available."}},"required":["enabled","balance","currency","connectedAccounts","monthlyEstimate","dailyEstimate","daysLeft","lines","canConnectMore","blocked","autoRechargedThisMonth","topUp","hasPortal"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/movements":{"get":{"operationId":"listBillingMovements","tags":["billing"],"summary":"List balance movements","description":"Top-ups and charges, newest first.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["top_up","auto_recharge","accounts","usage","adjustment"]},"amount":{"type":"number","description":"Euro cents, up to three decimals: positive adds, negative debits. `-9.678` is 0.09678 €."},"currency":{"type":"string","const":"eur","description":"The currency of `amount` (in cents)."},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"day":{"description":"UTC day (YYYY-MM-DD) a charge covers.","type":"string"},"accounts":{"description":"Accounts a day was charged for.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"family":{"description":"Usage family of a usage charge: X API, messages, phone numbers, calls, SMS or SMS registration.","type":"string","enum":["xApi","messages","numbers","calls","sms","dlc"]}},"required":["id","kind","amount","currency","at"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/top-up":{"post":{"operationId":"topUpBalance","tags":["billing"],"summary":"Top up the balance","description":"Opens a payment page. The balance grows once the payment succeeds; the card is saved for automatic recharges.","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Balance to add, in cents (taxes, if any, on top). Limits come with GET /v1/billing."},"successUrl":{"type":"string","format":"uri","description":"Dashboard page to come back to after paying."},"cancelUrl":{"type":"string","format":"uri","description":"Dashboard page to come back to if the user leaves Checkout."}},"required":["amount","successUrl","cancelUrl"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Send the user here."}},"required":["url"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/auto-recharge":{"put":{"operationId":"setAutoRecharge","tags":["billing"],"summary":"Set automatic recharges","description":"Tops up the saved card when the balance falls below the threshold, up to a monthly limit. Needs one top-up first.","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recharge when the balance falls below this, in cents."},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"What each recharge adds, in cents."},"monthlyLimit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Most that automatic recharges may add in a calendar month, in cents."}},"required":["enabled","threshold","amount","monthlyLimit"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean","description":"False while billing is not available: nothing is charged or limited."},"balance":{"type":"number","description":"Prepaid balance in euro cents (up to three decimals): `1250.5` is 12.505 €. Negative when charges outran it."},"currency":{"type":"string"},"connectedAccounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trial":{"description":"The free trial: connect any network (X and phone numbers need balance) and publish without paying. When it ends unpaid, scheduled posts pause until the first top-up.","type":"object","properties":{"status":{"type":"string","enum":["pending","active","expired","converted"],"description":"`pending`: nothing published yet; `active`: the free days run; `expired`: ended without paying; `converted`: paid."},"registeredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"startedAt":{"description":"First published post: the free days count from here.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"7 days after the first published post, and never more than 14 days after signing up."},"daysLeft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Whole days left (0 on the last day); null once it ended or was paid."},"trialDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Free days once it starts: 7, fewer when the 14-day limit cuts it."},"maxAccounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Accounts the trial covers (20). Connecting a 21st needs balance, and the first top-up ends the trial."},"banner":{"description":"What the dashboard shows now about the trial.","type":"string","enum":["first_post","two_days_left","running","day6","ended"]},"stats":{"type":"object","properties":{"published":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scheduled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Scheduled posts on hold since the trial ended."},"accounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["published","scheduled","paused","accounts"]}},"required":["status","registeredAt","endsAt","daysLeft","trialDays","maxAccounts","stats"]},"monthlyEstimate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Monthly price of the accounts connected now, in cents. It is charged day by day."},"dailyEstimate":{"type":"number","description":"What those accounts cost today, in cents (up to three decimals)."},"daysLeft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Whole days the balance covers at that cost; null when nothing is charged daily."},"lines":{"type":"array","items":{"type":"object","properties":{"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"to":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"accounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Cents per account and month."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to","accounts","unitAmount","amount"]}},"canConnectMore":{"type":"boolean","description":"Whether one more account can be connected right now."},"blocked":{"type":"boolean","description":"Publishing is on hold: the free trial ended without a top-up, or the balance is used up. Nothing is deleted."},"card":{"description":"The saved payment method, for automatic recharges.","type":"object","properties":{"brand":{"type":"string","description":"Card brand (`visa`, `mastercard`…) or another saved method (`link`, `sepa_debit`)."},"last4":{"type":"string"},"expMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["brand"]},"autoRecharge":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Recharge when the balance falls below this, in cents."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What each recharge adds, in cents."},"monthlyLimit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Most that automatic recharges add in a calendar month, in cents."}},"required":["enabled","threshold","amount","monthlyLimit"]},"autoRechargeError":{"description":"Why the last automatic recharge failed; it switched itself off.","type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"message":{"type":"string"}},"required":["at","message"]},"autoRechargedThisMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Added by automatic recharges this calendar month, in cents."},"topUp":{"type":"object","properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["min","max"],"description":"Allowed top-up amounts, in cents."},"hasPortal":{"type":"boolean","description":"Whether the billing portal (invoices, payment method) is available."}},"required":["enabled","balance","currency","connectedAccounts","monthlyEstimate","dailyEstimate","daysLeft","lines","canConnectMore","blocked","autoRechargedThisMonth","topUp","hasPortal"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/portal":{"post":{"operationId":"openBillingPortal","tags":["billing"],"summary":"Open the billing portal","description":"Invoices and the saved payment method.","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"returnUrl":{"type":"string","format":"uri","description":"Dashboard page to come back to."}},"required":["returnUrl"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Send the user here."}},"required":["url"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys":{"get":{"operationId":"listApiKeys","tags":["api-keys"],"summary":"List API keys","x-dashboard-only":true,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"revokedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","prefix","createdAt"]}}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createApiKey","tags":["api-keys"],"summary":"Create an API key","x-dashboard-only":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"revokedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","prefix","createdAt"]},"secret":{"type":"string","description":"The full key, shown only this once."}},"required":["key","secret"]}}}}}},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys/{id}":{"delete":{"operationId":"revokeApiKey","tags":["api-keys"],"summary":"Revoke an API key","x-dashboard-only":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request (`invalid_request`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Only from the dashboard: API keys cannot do this (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The network rejected the request (`provider_rejected`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Temporarily unavailable, retry later (`provider_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"event":{"post":{"summary":"Marsial event","description":"POSTed to your endpoint with the headers `Marsial-Event`, `Marsial-Event-Id` and `Marsial-Signature: t=<unix seconds>,v1=<hex>`, where v1 is the HMAC-SHA256 of `<t>.<raw body>` with your signing secret. Answer 2xx within 10 seconds; failures are retried.","requestBody":{"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["account.connected","account.disconnected","post.scheduled","post.published","post.partial","post.failed","post.cancelled","post.removed","post.rejected","post.recycled","post.draft_saved","post.deleted","message.received","comment.received","review.received"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"data":{"type":"object","properties":{"post":{"description":"post.* events.","type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"content":{"type":"string"},"media":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","document"]},"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":1000}},"required":["type","url"]}},"status":{"type":"string","enum":["pending","published","failed","removed"]},"url":{"description":"The live post, once published.","type":"string","format":"uri"},"error":{"type":"string"}},"required":["accountId","platform","status"],"additionalProperties":{},"description":"Also carries the network options sent for this target."}},"status":{"type":"string","enum":["draft","pending_approval","scheduled","paused","publishing","published","partial","failed","cancelled","removed","deleted"]},"scheduledFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approval":{"description":"Present once the post went through review.","type":"object","properties":{"requestedBy":{"description":"User who asked for it; absent when an API key did.","type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"queue":{"description":"Approving puts it in the profile’s queue.","type":"boolean"},"decision":{"type":"string","enum":["approved","rejected"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"description":"Why it was rejected.","type":"string"}},"required":["requestedAt"]},"recycling":{"description":"Present once recycling was turned on.","type":"object","properties":{"active":{"type":"boolean"},"every":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string","enum":["week","month"]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"maxCopies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"variations":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"copies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies created so far."},"nextAt":{"description":"When the next copy goes out; absent once it stopped.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastCopyId":{"description":"The latest copy, a post of its own.","type":"string"}},"required":["active","every","unit","copies"]},"recycledFrom":{"description":"On a recycled copy: the original post.","type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","content","media","targets","status","createdAt","updatedAt"]},"account":{"description":"account.* events.","type":"object","properties":{"id":{"type":"string"},"profileId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"username":{"type":"string"},"displayName":{"type":"string"},"avatarUrl":{"type":"string","format":"uri"},"status":{"type":"string","enum":["active","needs_reconnection","disconnected"]},"connectedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","profileId","platform","status","connectedAt","updatedAt"]},"accountId":{"description":"Inbox events: the account it happened on.","type":"string"},"profileId":{"type":"string"},"platform":{"type":"string","enum":["instagram","tiktok","youtube","linkedin","x","facebook","threads","pinterest","bluesky","reddit","google-business","telegram","discord","snapchat","wordpress","shopify","wix","webflow","slack","hubspot","whatsapp","meta-ads","google-ads","linkedin-ads","tiktok-ads","pinterest-ads","x-ads","reddit-ads","sms","phone"]},"conversationId":{"description":"message.received: use it with /v1/inbox/conversations/{id}.","type":"string"},"message":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"attachments":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["type"]}},"sender":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"}}}},"required":["id","text","attachments","sender"]},"postId":{"description":"comment.received: use it with /v1/inbox/posts/{id}/comments.","type":"string"},"marsialPostId":{"description":"comment.received: the Marsial post, when it was published through Marsial.","type":["string","null"]},"comment":{"type":"object","properties":{"id":{"type":"string","description":"Use it as commentId to reply."},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"parentId":{"type":"string"},"author":{"type":"object","properties":{"name":{"type":"string"},"username":{"type":"string"},"picture":{"type":"string","format":"uri"},"isOwner":{"type":"boolean"}},"required":["isOwner"]}},"required":["id","text","author"]},"review":{"type":"object","properties":{"id":{"type":"string","description":"Use it with /v1/inbox/reviews/{id}/reply."},"rating":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reviewer":{"type":"object","properties":{"name":{"type":"string"},"picture":{"type":"string","format":"uri"}}}},"required":["id","rating","text","reviewer"]}},"description":"What changed; which fields are present depends on type."}},"required":["id","type","createdAt","data"]}}}},"responses":{"200":{"description":"Received"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Your API key, `marsial_live_…`, created in the dashboard."}},"schemas":{"Error":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}