{"openapi":"3.1.0","info":{"title":"Postwyre API","version":"1","summary":"Create, schedule and follow social posts for each brand you are in.","description":"Send an API key as `Authorization: Bearer sk_live_...`. Make one in the app under Connect your AI. A key belongs to the person who made it and reaches every brand that person is in.\n\nRoutes that act inside a brand need the `X-Workspace-Id` header once the key's owner is in more than one brand; without it they answer 400. `GET /api/workspaces` lists the ids.\n\nEach API key can make up to 120 requests a minute, counted across every route; past that the answer is 429 with code rate_limited and a Retry-After header in seconds. Wait that long and send the same request again. A signed-in person in the app is not counted.\n\nEvery refusal is JSON: `{ \"error\": { \"code\": \"...\", \"message\": \"...\" } }`. A key can send as many posts an hour as the brand's connected accounts take within each platform's own limits, and all the keys and connected apps of one brand together no more than that (429 with Retry-After; each post counts in the hour it goes out, a bulk post with no scheduledAt is placed in the brand's posting slots and is not counted, and drafts count nothing). A post that would put one account past its platform's own daily limit is refused with 429 too. The other limits are the plan's allowance of media bytes sent, a trial's posts and sends, and a retired Pro plan's sends (402), 200 drafts per brand (409; before a plan starts, counted across every brand its owner has with no plan), 50 files waiting to be attached per brand (409), how many brands a plan covers (403 on brand create), and how many brands one login can create (429).\n\nA key cannot connect accounts, manage keys, teammates or webhooks, approve posts, or open billing. Those need a person signed in to the app. The approval and webhook routes are described here for completeness and refuse a key with 403.\n\nThe same key also works with the MCP connector at https://postwyre.com/api/mcp. Claude.ai and ChatGPT reach the connector by signing in instead of with a key; that sign-in token works only on the connector, and these routes refuse it with 401. See https://postwyre.com/docs/connect-your-ai."},"externalDocs":{"description":"Agent keys and the posting API","url":"https://postwyre.com/docs/agent-keys"},"servers":[{"url":"https://postwyre.com"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Brands","description":"The brands the key's owner belongs to."},{"name":"Products","description":"The Postwyre products the key's owner has, across every brand they belong to, and the credits routes only Postwyre's own apps can call."},{"name":"Account","description":"A person's own data: export it or delete the login. A signed-in person only; a key is refused."},{"name":"Accounts","description":"Social accounts connected to a brand. A person connects them in the app."},{"name":"Posts","description":"Drafts, scheduled posts and their results per account."},{"name":"Media","description":"Pictures and video to attach to a post."},{"name":"Connect links","description":"A link an owner or admin sends a client, who connects their own social accounts to the brand with no Postwyre login. Owner or admin only: a key acts at the lower of its own role and its owner's role in the brand. See https://postwyre.com/docs/accounts#let-a-client-connect-their-own-accounts."},{"name":"Signatures","description":"Saved sign-offs a post can end with, named by signatureId. Anyone in the brand lists, adds and deletes them."},{"name":"Brand voice","description":"How a brand's posts should sound. Anyone in the brand reads it; an owner or admin changes it."},{"name":"Stats","description":"Views, likes, comments, shares and saves Postwyre read from each platform about 1 hour, 24 hours and 7 days after a post went out. Kept for 180 days."},{"name":"Credits","description":"The plan's credits, which pay for X posts past the plan's X limit. Read only: a key can't buy credits or turn spending on."},{"name":"Approvals","description":"Deciding a post created with requireApproval. A signed-in person only; a key is refused."},{"name":"Engage","description":"Comments and mentions on a brand's accounts: read them, reply, mark them done, assign them, and set up comment-keyword DMs on Instagram and Facebook. Answers 404 with code not_configured while Engage is not available in Postwyre."},{"name":"Webhooks","description":"Signed notices sent to an address when a post publishes, fails or waits for approval. Owners and admins, signed in; a key is refused."}],"paths":{"/api/workspaces":{"get":{"tags":["Brands"],"operationId":"listWorkspaces","summary":"List brands","description":"Every brand the key's owner belongs to. Works with zero, one or many brands and never needs the x-workspace-id header. role is the owner's own role there. current is always false for a key.","responses":{"200":{"description":"The brands.","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}},"required":["workspaces"]}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Brands"],"operationId":"createWorkspace","summary":"Create a brand","description":"The key's owner becomes its owner. The new brand joins the first plan the owner has with room, and shares that plan's limits. A plan covers the brands it pays for: 3 with Starter, plus each extra brand the owner pays for in the app. A key never pays for a brand: past the brands paid for this answers 403. If the owner has no plan yet, the new brand has none either, so it cannot send or schedule posts until an owner chooses one in the app; up to 3 brands can be set up before that. By default a login can own at most 100 brands and create at most 5 in 24 hours.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"]}}}},"responses":{"201":{"description":"Created. Send organizationId as the X-Workspace-Id header.","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"}},"required":["organizationId"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`quota_exceeded`: every plan the owner has already covers all the brands it pays for. The message names the limit and how the plan's owner adds a brand in the app.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`quota_exceeded`: too many brands created by this login. `rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/suite/me":{"get":{"tags":["Products"],"operationId":"listMyProducts","summary":"List my Postwyre products","description":"The Postwyre products the key's owner may open now, in a fixed order, each with the address that opens it. A product is listed while a brand they belong to has a plan that is paid, on a trial or comped and includes it; paying for one product never lists another. A login with no plan gets an empty list. Covers every brand, so it never needs the x-workspace-id header. Read only: the same answer every time until a plan changes, sent with Cache-Control private, no-store. Also takes a signed-in browser, and the sign-in token of a Postwyre app the person signed in to with their Postwyre login, which gets 403 once no plan they are on includes that app. A connected AI app's sign-in token is refused with 401.","responses":{"200":{"description":"The products, Postwyre first.","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["social","crm","datawyre","meet","studio","cold","call"],"description":"Stable product id."},"name":{"type":"string","description":"The product's name, as shown to a person."},"url":{"type":"string","format":"uri","description":"The address that opens the product: an origin, no path."}},"required":["id","name","url"]}}},"required":["products"]}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: a Postwyre app's sign-in token was sent and no plan the person is on includes that app.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/suite/credits/spend":{"post":{"tags":["Products"],"operationId":"spendSuiteCredits","summary":"Spend a brand's credits (Postwyre apps)","description":"For Postwyre's own apps only: takes credits from the brand's plan wallet for work the app did, the same credits Postwyre itself spends and the person buys in Postwyre Billing. Send the app's sign-in token as the bearer token; the app is the token's own, never one named in the body. brandId must be a brand the person belongs to (404 otherwise) whose plan includes the app (403 otherwise). credits is a whole number from 1 to 100. kind is the app's own label for the work, shown in Billing with underscores as spaces. idempotencyKey names this one piece of work for this app and brand: the same key with the same credits and kind answers the first answer again with replay true and spends nothing; with different credits or kind it answers 409. Not enough credits answers 402 and spends nothing, and the same key can be sent again after credits are bought. On a trial only bought credits are spent. Every call is recorded.","security":[{"productToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brandId":{"type":"string","minLength":1,"maxLength":100,"description":"The brand to charge, an id from GET /api/suite/brands."},"credits":{"type":"integer","minimum":1,"maximum":100,"description":"Credits to take, 1 to 100."},"kind":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"The app's label for the work, such as email_draft."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$","description":"Names this one piece of work. Send the same key when you retry."}},"required":["brandId","credits","kind","idempotencyKey"]}}}},"responses":{"200":{"description":"Spent, or the first answer to this key.","content":{"application/json":{"schema":{"type":"object","properties":{"spendId":{"type":"string","description":"Send it to POST /api/suite/credits/refund to give the credits back."},"brandId":{"type":"string"},"product":{"type":"string","enum":["social","crm","datawyre","meet","studio","voice","cold","call"]},"kind":{"type":"string"},"credits":{"type":"integer"},"replay":{"type":"boolean","description":"True when this is the first answer sent again for a repeated key."},"balance":{"type":"object","description":"The plan's credits, shared by every brand on the plan.","properties":{"included":{"type":"integer","description":"This month's plan credits left."},"purchased":{"type":"integer","description":"Bought credits left."},"total":{"type":"integer"},"period":{"type":"string","description":"The month in UTC, YYYY-MM."}},"required":["included","purchased","total","period"]}},"required":["spendId","brandId","product","kind","credits","replay","balance"]}}}},"400":{"description":"`validation_error`: The body is not valid, brandId is missing, or the x-workspace-id header names a different brand than brandId.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No Postwyre app sign-in token, or it expired or was revoked. An API key and a connected AI app's token are refused here.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits. Nothing was spent.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"quota_exceeded"},"reason":{"type":"string","const":"no_credits"},"message":{"type":"string"}},"required":["code","reason","message"]},"balance":{"type":"object","description":"The plan's credits, shared by every brand on the plan.","properties":{"included":{"type":"integer","description":"This month's plan credits left."},"purchased":{"type":"integer","description":"Bought credits left."},"total":{"type":"integer"},"period":{"type":"string","description":"The month in UTC, YYYY-MM."}},"required":["included","purchased","total","period"]},"buyUrl":{"type":"string","format":"uri","description":"Where the person buys credits: https://postwyre.com/billing#credits."}},"required":["error","balance","buyUrl"]}}}},"403":{"description":"`forbidden`: The brand's plan does not include this app, or has ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: The person does not belong to that brand.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: This idempotencyKey was used before with different credits or kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: more than 60 spend and refund calls this minute from this app for this brand, or more than 120 calls this minute from this app for this person. The Retry-After header says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/suite/credits/refund":{"post":{"tags":["Products"],"operationId":"refundSuiteCredits","summary":"Give back a spend (Postwyre apps)","description":"For Postwyre's own apps only: gives back an earlier spend this app made for this brand, or part of it with credits. A spend is given back once: asking again with the same amount answers the first answer with replay true; a different amount, or more than the spend took, answers 409. Bought credits go back first. This month's plan credits go back only within the month they were spent in, so creditsReturned can be less than credits. The same token, brand and limits as the spend.","security":[{"productToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brandId":{"type":"string","minLength":1,"maxLength":100,"description":"The brand the spend was for."},"spendId":{"type":"string","minLength":1,"maxLength":100,"description":"The spendId the spend answered."},"credits":{"type":"integer","minimum":1,"maximum":100,"description":"Credits to give back; leave it out to give back the whole spend."}},"required":["brandId","spendId"]}}}},"responses":{"200":{"description":"Given back, or the first answer to this refund.","content":{"application/json":{"schema":{"type":"object","properties":{"spendId":{"type":"string"},"brandId":{"type":"string"},"product":{"type":"string","enum":["social","crm","datawyre","meet","studio","voice","cold","call"]},"credits":{"type":"integer","description":"Credits asked back."},"creditsReturned":{"type":"integer","description":"Credits that went back into the wallet."},"replay":{"type":"boolean"},"balance":{"type":"object","description":"The plan's credits, shared by every brand on the plan.","properties":{"included":{"type":"integer","description":"This month's plan credits left."},"purchased":{"type":"integer","description":"Bought credits left."},"total":{"type":"integer"},"period":{"type":"string","description":"The month in UTC, YYYY-MM."}},"required":["included","purchased","total","period"]}},"required":["spendId","brandId","product","credits","creditsReturned","replay","balance"]}}}},"400":{"description":"`validation_error`: The body is not valid, brandId is missing, or the x-workspace-id header names a different brand than brandId.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No Postwyre app sign-in token, or it expired or was revoked. An API key and a connected AI app's token are refused here.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The brand's plan does not include this app, or has ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: No spend with that id for this app and brand, or the person does not belong to the brand.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The spend was already given back with a different amount, or the amount is more than the spend took.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: more than 60 spend and refund calls this minute from this app for this brand, or more than 120 calls this minute from this app for this person. The Retry-After header says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/suite/signups":{"post":{"tags":["Products"],"operationId":"recordNewsletterSignup","summary":"Report a newsletter signup (CRMwyre)","description":"For CRMwyre only: reports one newsletter signup that came from a comment DM rule's signup link, so the rule's report counts it. The link carries pw_brand, pw_rule and pw_post; send the brand in the x-workspace-id header and the rule and post in the body. subscriberId is CRMwyre's own id for the subscriber, never an email address; Postwyre keeps only a hash of it. The same subscriber for the same rule answers replay true and counts once. A brand the person is not in answers 403; a rule of another brand, or one deleted, answers 404.","security":[{"productToken":[]}],"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ruleId":{"type":"string","minLength":1,"maxLength":64,"description":"The pw_rule value from the signup link."},"subscriberId":{"type":"string","minLength":1,"maxLength":128,"description":"CRMwyre's id for the subscriber. Not an email address."},"postId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"description":"The pw_post value from the signup link, when it has one."}},"required":["ruleId","subscriberId"]}}}},"responses":{"200":{"description":"Counted, or counted before.","content":{"application/json":{"schema":{"type":"object","properties":{"ruleId":{"type":"string"},"replay":{"type":"boolean","description":"True when this subscriber was already counted for this rule."}},"required":["ruleId","replay"]}}}},"400":{"description":"`validation_error`: The body is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No Postwyre app sign-in token, or it expired or was revoked. An API key and a connected AI app's token are refused here.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The person does not belong to that brand, or the brand's plan does not include CRMwyre.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: No such rule in that brand.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/account/export":{"get":{"tags":["Account"],"operationId":"exportAccountData","summary":"Export my data","description":"One zip of everything the signed-in person can see, across every brand they are on, at their own role there: export.json, and brands.csv, accounts.csv, posts.csv, sends.csv, stats.csv and media.csv. No password, sign-in token, key or webhook secret is in it. Pictures and videos are links that work for 7 days. 5 exports an hour; past that it answers 429 with Retry-After. A key is refused with 403, since a key can be capped or blocked in a brand.","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`quota_exceeded`: too many exports this hour. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/account":{"delete":{"tags":["Account"],"operationId":"deleteAccount","summary":"Delete my account","description":"Deletes the signed-in person's login and every brand only they own, with its accounts, posts, schedules, stats and files. It cancels those brands' plans first; if that fails, nothing is deleted (502). It asks each platform to revoke Postwyre's access where the platform's API allows it, and accounts lists what each platform answered. Refused with 409 while the person is the only owner of a brand that has teammates. confirm must be \"delete my account\"; password is required when the login has one. A key or a connected app is refused with 403, as is a wrong password. Ten tries an hour; past that it answers 429.","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","maxLength":64,"description":"The words \"delete my account\"."},"password":{"type":"string","maxLength":256,"description":"The login's password."}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"200":{"description":"Deleted. The session is gone too.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true},"brandsDeleted":{"type":"integer"},"accounts":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"handle":{"type":"string"},"outcome":{"type":"string","enum":["revoked","no_api","failed","shared"],"description":"revoked: the platform took the access back. no_api: the platform has no way to; remove Postwyre there. failed: it did not answer or refused. shared: another brand still uses this account, so it was left connected there."}},"required":["platform","handle","outcome"]}}},"required":["deleted","brandsDeleted","accounts"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`quota_exceeded`: too many tries this hour. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream_error`: the plan could not be cancelled with the payment provider, so nothing was deleted. Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/accounts":{"get":{"tags":["Accounts"],"operationId":"listAccounts","summary":"List connected accounts","description":"The brand's connected accounts, oldest first. No credential is ever returned.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The accounts.","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["accounts"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/accounts/{accountId}/creator-info":{"get":{"tags":["Accounts"],"operationId":"getCreatorInfo","summary":"TikTok creator info","description":"For a TikTok account only: who the post goes out as, which visibility options TikTok offers it, and whether it can post now. TikTok asks for this every time a post is prepared. An account on another platform is refused with 404 or 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"An account id from GET /api/accounts."}],"responses":{"200":{"description":"What TikTok reports for this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TikTokCreatorInfo"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/brands/{brandId}/time-zone":{"put":{"tags":["Brands"],"operationId":"setBrandTimeZone","summary":"Set a brand's time zone","description":"Owners and admins of the brand in the path only (a key acts at the lower of its own role and its maker's); the X-Workspace-Id header is not needed and is ignored. timeZone is an IANA zone name such as America/New_York, saved in its canonical spelling; a name that is not a zone answers 400. null clears it, and posting times are then read in UTC. Posting times, GET /api/posts/next-slot and POST /api/posts/bulk read the new zone from the next call on. A post already scheduled keeps its exact send time: scheduledPostsKept counts the brand's posts still to send (scheduled or waiting for approval), and note says so in a sentence for a person. Sending the zone already saved changes nothing and answers changed: false. A brand the caller is not in answers 403.","parameters":[{"name":"brandId","in":"path","required":true,"schema":{"type":"string"},"description":"A brand id from GET /api/workspaces."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"timeZone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"description":"An IANA zone name, for example America/New_York. null clears it."}},"required":["timeZone"],"additionalProperties":false}}}},"responses":{"200":{"description":"The brand's time zone now.","content":{"application/json":{"schema":{"type":"object","properties":{"brandId":{"type":"string"},"timeZone":{"type":["string","null"],"description":"The zone now saved, or null."},"previous":{"type":["string","null"],"description":"The zone before this call."},"changed":{"type":"boolean","description":"false when the call asked for the zone already saved, and nothing was written."},"scheduledPostsKept":{"type":"integer","description":"The brand's posts still to send, scheduled or waiting for approval. Each keeps its send time."},"note":{"type":"string","description":"One sentence for a person: what happened."}},"required":["brandId","timeZone","previous","changed","scheduledPostsKept","note"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/workspaces/current/quality-bar":{"get":{"tags":["Brands"],"operationId":"getQualityBar","summary":"Read the brand's quality bar setting","description":"Whether the brand sends an agent's posts that pass the quality bar without waiting for approval (autoSend, off unless an owner or admin turned it on), and dailyLimit, the most posts sent that way per account per day in the brand's time zone. Anyone in the brand, a key too, may read it. Only an owner or admin signed in to Postwyre can change it, in Settings, Brand; PATCH with a key answers 403. With it on, a post created with requireApproval and action schedule or now through a key goes out on its own only when every check passes and its selfReview verdict is pass; approval.qualityBar on the post says what was found. The bar never sends a Google Business Profile, Pinterest, TikTok, YouTube or LinkedIn post on its own.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The brand's setting.","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"autoSend":{"type":"boolean"},"dailyLimit":{"type":"integer","minimum":1,"maximum":10}},"required":["organizationId","autoSend","dailyLimit"]}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/accounts/{accountId}/posting-slots":{"put":{"tags":["Accounts"],"operationId":"setAccountPostingSlots","summary":"Set an account's posting times","description":"Owners and admins only (a key acts at the lower of its own role and its maker's). Gives one account its own posting times, which POST /api/posts/bulk and GET /api/posts/next-slot use instead of the brand's for a post to that account, read in the brand's time zone. slots null goes back to the brand's times, which every account starts with. Sending what is already saved changes nothing and answers changed: false. An account not in the brand answers 404.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"An account id from GET /api/accounts."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slots":{"anyOf":[{"type":"object","properties":{"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"times":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"}}},"required":["days","times"]},{"type":"null"}],"description":"{ days, times }: weekdays 0 (Monday) to 6, and times of day as HH:MM, 24 hour. null for the brand's times."}},"required":["slots"]}}}},"responses":{"200":{"description":"The account's posting times now.","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"usesBrandTimes":{"type":"boolean"},"slots":{"type":["object","null"],"properties":{"days":{"type":"array","items":{"type":"integer"}},"times":{"type":"array","items":{"type":"string"}}}},"changed":{"type":"boolean","description":"false when the call asked for what was already saved."}},"required":["accountId","usesBrandTimes","slots","changed"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/accounts/{accountId}/boards":{"get":{"tags":["Accounts"],"operationId":"listAccountBoards","summary":"Pinterest boards","description":"For a Pinterest account only: the boards a Pin can be saved to, asked of Pinterest each time. Send a board's id as options.boardId on that account when you create a post. An account on another platform is refused with 404 or 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"An account id from GET /api/accounts."}],"responses":{"200":{"description":"The account's boards.","content":{"application/json":{"schema":{"type":"object","properties":{"boards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"privacy":{"type":["string","null"],"description":"PUBLIC, PROTECTED or SECRET, in Pinterest's words."}},"required":["id","name","privacy"]}}},"required":["boards"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/accounts/{accountId}/wordpress":{"get":{"tags":["Accounts"],"operationId":"getWordPressSite","summary":"WordPress categories, tags and authors","description":"For a WordPress account only: the site's categories, its most used tags and, for a user who may set an author, its authors, asked of the site each time. Send them as options.categories, options.tags (ids or names) and options.authorId on that account when you create a post. With kind (tag or category) and search, only the matching terms are returned, as { terms }. An account on another platform is refused with 404 or 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"An account id from GET /api/accounts."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["tag","category"]},"description":"Search only this kind of term. Needs search."},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":100},"description":"Part of a term's name."}],"responses":{"200":{"description":"The site's lists. With kind and search the answer is { terms: [{ id, name, count }] } instead.","content":{"application/json":{"schema":{"type":"object","properties":{"canPublish":{"type":"boolean"},"canEditOthers":{"type":"boolean"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["id","name","count"]}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"count":{"type":"integer"}},"required":["id","name","count"]}},"authors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["canPublish","canEditOthers","categories","tags","authors"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts":{"get":{"tags":["Posts"],"operationId":"listPosts","summary":"List posts","description":"Newest first, each with its result per account.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending_approval","not_approved","scheduled","publishing","published","partial","failed"]},"description":"Only posts in this state. Any other value is ignored and lists every post."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Values above 100 are treated as 100."}],"responses":{"200":{"description":"One page of posts.","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"total":{"type":"integer","description":"Posts matching the filter, across all pages."},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["posts","total","page","pageSize"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Posts"],"operationId":"createPost","summary":"Create a post","description":"A draft unless action says otherwise; a draft is sent nowhere and costs nothing. A brand keeps up to 200 drafts and posts waiting for approval, counted together; before a plan starts, that limit covers every brand its owner has with no plan. With requireApproval and action schedule or now, the post is checked as if it were being sent, then waits as pending_approval with a link in approval.url; it is sent and counted only once a signed-in person approves it. schedule and now need text and at least one active account, are checked against each platform's text limit, and count against the plan's allowance. With now the response comes back after publishing was tried, so read deliveries for the result. Send an idempotencyKey (or the Idempotency-Key header) to make a retried call safe: the same key returns the post it already made with 200 instead of 201, and the same key with a different post answers 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":100},"description":"Used when the body has no idempotencyKey."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"default":"","type":"string","maxLength":5000,"description":"The post text. Each platform's own length limit is checked when the post is scheduled or sent."},"platformOverrides":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["x","linkedin","instagram","facebook","threads","tiktok","youtube","bluesky","googlebusiness","pinterest","discord","telegram","whop","wordpress"]},"additionalProperties":{"type":"object","properties":{"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}}},"description":"Text and options per platform, for example { \"bluesky\": { \"body\": \"...\" } }. options carry the fields of each platform: postType picks the kind of post (instagram post, carousel, reel or story; facebook post, reel or story; youtube video or short; tiktok video; leave it out for the platform's usual post); youtube { title, tags, categoryId, madeForKids, privacyStatus (public, unlisted or private; left out on a new post, public), chapters ([{ time: \"0:00\", title: \"Intro\" }, ...]: at least 3, the first at 0:00, each at least 10 seconds long, written at the end of the description) } with body as the description (no title: the first line is the title); instagram { altText, shareToFeed, userTags (people tagged on a single feed picture: up to 20 of { username, x, y }, x and y from 0 to 1 from the top left corner) }, and on a Reel one cover (thumbOffsetMs, a frame in milliseconds before the video ends; coverMediaId, a picture from mediaIds that becomes the cover and not part of the Reel; or coverUrl, a public https picture link) and trialReel (manual or performance: shown to non-followers first, then shared to followers by hand in the Instagram app or automatically when it performs well; no shareToFeed); Instagram works only for Postwyre's Meta app testers until Meta's App Review; bluesky { replies (a thread: up to 9 texts, each sent right after the post under the one before; here only, not in an account's options), and threads and x take the same replies once Postwyre switches them on, refusing them with the reason until then }; firstComment and firstCommentDelayMinutes (0, 5, 15 or 60) where get_platform_guide lists them; facebook { link }; googlebusiness postType post (an update), event or offer, { ctaType (BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP or CALL; not on an offer), ctaUrl (not for CALL), eventTitle, eventStart and eventEnd (2026-11-20 or 2026-11-20T18:30, required on an event or offer), couponCode, redeemUrl, terms (offer only) }, and a post to it sent with a key waits for approval unless sent with personApproved (as does a post to linkedin, pinterest or youtube; one to tiktok always waits); pinterest { boardId (on the account), title, link, altText, coverFrameSeconds (video) }; discord { embedTitle, embedDescription, embedUrl, embedColor (#RRGGBB), embedImageMediaId, suppressEmbeds, silent, spoiler, threadId, threadName (forum channels) }; telegram { formatting (reads **bold**, __italic__, ~~strike~~, ||spoiler||, `code` and [words](https://link)), silent, linkPreview, protectContent, captionAbove, spoilerMedia }; whop { title, pinned, mention (notifies the members of the forum), visibility (members_only or globally_visible), pollOptions (2 to 10 choices) }, each Whop account being one forum; wordpress { title, excerpt, slug, status (publish, draft, pending, private or future), publishAt (with future), categories, tags (ids or names), authorId }, each WordPress account being one site. On any platform but Pinterest, Google Business Profile, Whop and WordPress, mentions: up to 20 accounts to @mention, each a handle or { handle, id, name, kind }, with @handle written in that platform's text (GET /api/posting/mentions looks one up; here only, not in an account's options). get_platform_guide in the MCP server lists every option with its limits. A Story shows no text, so none is sent."},"accounts":{"default":[],"maxItems":25,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}},"required":["accountId"]},"description":"The accounts to post to, ids from GET /api/accounts. Each account can be listed once. body gives one account its own text. options is limited to 6000 characters of JSON."},"action":{"default":"draft","type":"string","enum":["draft","schedule","now"],"description":"draft saves the post and sends nothing. schedule sends it at scheduledAt. now publishes before the response."},"scheduledAt":{"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":"ISO 8601 with an offset, between now and 366 days ahead. Needed with schedule. With draft and requireApproval, the time the post is proposed for."},"idempotencyKey":{"type":"string","minLength":8,"maxLength":100,"description":"8 to 100 characters, not starting with bulk: or duplicate:. The same key in the same brand returns the post already made, and never posts twice; with a different post it answers 409."},"mediaIds":{"default":[],"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"description":"Ids from POST /api/posting/media, confirmed, in the order they should appear."},"mediaAltText":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4086},{"type":"null"}]},"description":"Alt text for each picture, by id from mediaIds, for example { \"<mediaId>\": \"A red bike against a brick wall\" }. Sent to X (1,000 characters), LinkedIn (4,086), Facebook, Threads (1,000), Discord (1,024), WordPress (the featured picture), Bluesky (2,000, each picture's own), Instagram (1,000: each carousel picture's own, and a single picture's when Instagram's own altText option is empty) and Pinterest (500) when its own altText option is empty. TikTok, YouTube, Telegram, Whop and Google Business Profile take none, so it is kept and not sent there. Each limit is checked when the post is scheduled or sent. On a change, a picture left out keeps its alt text and null clears it. A video's alt text is sent to Bluesky (2,000 characters) and kept, not sent, everywhere else."},"requireApproval":{"type":"boolean","description":"true holds the post until a signed-in person in the brand approves it from the link in approval.url. With schedule or now the post is checked as if it were being sent, then saved as pending_approval; nothing is sent or counted until it is approved. With draft it is a review hold: accounts may be left out and scheduledAt is the time it is proposed for. Approving it puts it in the queue at that time when it has accounts and the time is still ahead; otherwise it stays a draft that only a person can change or send, never a key. It is never sent before its time."},"selfReview":{"type":"object","properties":{"verdict":{"type":"string","enum":["pass","fail"]},"reasons":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["verdict","reasons"],"additionalProperties":false,"description":"With requireApproval: your own check of the post, { verdict: pass or fail, reasons: 1 to 5 lines of up to 300 characters }. Kept with the post. When the brand sends posts that pass the quality bar (GET /api/workspaces/current/quality-bar), a post held with schedule or now goes out on its own only when every check of the bar passes and the verdict is pass; otherwise it waits, and approval.qualityBar.reasons says why. Only the verdict is acted on."},"personApproved":{"type":"boolean","description":"With an API key: true only after you showed the person this exact post (text, files, accounts, time) and they said yes; never on your own judgment. Then a post to Google Business Profile, LinkedIn, Pinterest or YouTube goes out as asked, and the approval is recorded on the post (who, through which key, when). Without it, such a post waits for approval as pending_approval, and the response's note says what to do. TikTok always waits for a person in Postwyre. Ignored when signed in to the app."},"repeat":{"type":"object","properties":{"everyDays":{"type":"integer","minimum":1,"maximum":90},"times":{"type":"integer","minimum":1,"maximum":12},"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["everyDays"],"additionalProperties":false,"description":"Send the post again every everyDays days (1 to 90), times more times (1 to 12) or until a date, whichever comes first. Each copy is a new post that counts against the plan and the platform's daily limit; one over a limit is skipped. Refused on TikTok, YouTube, Pinterest, Google Business Profile, LinkedIn, X and WordPress, and with requireApproval. On PATCH, null alone turns it off on any post, a sent one too."},"signatureId":{"type":"string","minLength":1,"maxLength":64,"description":"A signature id from GET /api/signatures. Its text goes at the end of the post's text and of every per-platform and per-account text of its own, after a blank line, and each platform's length is checked with it on. Left out, none is added. Another brand's id answers 404."}}}}}},"responses":{"200":{"description":"A post with this idempotency key already existed; this is that post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"201":{"description":"Created. A post sent with a key that waits because its platform needs the person's yes also carries note, which says what to do.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`quota_exceeded`: The brand has no plan, or this would go over its plan's allowance of media bytes sent (or a trial's posts and sends, or a retired Pro plan's sends), or a brand's volume is unusually high and needs support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/bulk":{"post":{"tags":["Posts"],"operationId":"createPostsBulk","summary":"Create many posts","description":"Up to 50 posts in one request, each made as POST /api/posts makes one, and each with its own result in results (in the order sent): one post that is refused does not stop the others. action is schedule (the default) or draft; now is not offered. With schedule, a post with no scheduledAt goes at the brand's next free posting time (9:00 and 17:00 every day, in the brand's time zone, or UTC when it has none), at least 10 minutes from now and never at a time another post already waits at. One such request runs at a time per brand, so two at once never give two posts the same time; one that waits more than 20 seconds for another is answered 429 with Retry-After, and sending it again with the same idempotencyKey is safe. Instagram (50) and Threads (250) posts in any 24 hours per account are refused past their limit; TikTok's, which varies by creator, comes back as a warning. With idempotencyKey (or the Idempotency-Key header), a repeat of the request returns the posts it already made and makes only the ones that failed.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":80},"description":"Used when the body has no idempotencyKey."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"body":{"default":"","type":"string","maxLength":5000},"platformOverrides":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["x","linkedin","instagram","facebook","threads","tiktok","youtube","bluesky","googlebusiness","pinterest","discord","telegram","whop","wordpress"]},"additionalProperties":{"type":"object","properties":{"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}}}},"accounts":{"default":[],"maxItems":25,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}},"required":["accountId"]}},"mediaIds":{"default":[],"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"mediaAltText":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4086},{"type":"null"}]}},"scheduledAt":{"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)))$"},"signatureId":{"type":"string","minLength":1,"maxLength":64},"selfReview":{"type":"object","properties":{"verdict":{"type":"string","enum":["pass","fail"]},"reasons":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["verdict","reasons"],"additionalProperties":false}},"additionalProperties":false},"description":"1 to 50 posts, each with body, platformOverrides, accounts, mediaIds, mediaAltText and signatureId as in POST /api/posts, and an optional scheduledAt. Any other field is refused with 400. A signatureId this brand does not have fails that post alone with not_found."},"action":{"default":"schedule","type":"string","enum":["draft","schedule"],"description":"schedule (default) or draft."},"idempotencyKey":{"type":"string","minLength":8,"maxLength":80,"description":"8 to 80 characters. Each post is made with this key and its place in the list, so a retry never makes one twice."},"requireApproval":{"type":"boolean","description":"true holds every post until a person approves it, as on POST /api/posts. Each post may carry its own selfReview, as on POST /api/posts."}},"required":["posts"]}}}},"responses":{"200":{"description":"One result per post.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkResult"}},"timeZone":{"type":"string","description":"The zone the posting times were read in."},"slots":{"type":"object","properties":{"days":{"type":"array","items":{"type":"integer"},"description":"0 is Monday."},"times":{"type":"array","items":{"type":"string"}}},"required":["days","times"]}},"required":["results","timeZone","slots"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Posts"],"operationId":"updatePostsBulk","summary":"Change many posts","description":"Up to 50 changes, each { postId } plus the fields PATCH /api/posts/{postId} takes, with the same rules, except action now. Use it to schedule many drafts at once, to take a batch back to drafts (action draft), or to move several scheduled posts. A due time is sent by the scheduler within a few minutes, not inside the request. Each change has its own result.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"body":{"type":"string","maxLength":5000},"platformOverrides":{"type":"object","propertyNames":{"type":"string","enum":["x","linkedin","instagram","facebook","threads","tiktok","youtube","bluesky","googlebusiness","pinterest","discord","telegram","whop","wordpress"]},"additionalProperties":{"type":"object","properties":{"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}}}},"accounts":{"maxItems":25,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}},"required":["accountId"]}},"action":{"type":"string","enum":["draft","schedule"]},"scheduledAt":{"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)))$"},"mediaIds":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"repeat":{"anyOf":[{"type":"object","properties":{"everyDays":{"type":"integer","minimum":1,"maximum":90},"times":{"type":"integer","minimum":1,"maximum":12},"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["everyDays"],"additionalProperties":false},{"type":"null"}]},"mediaAltText":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4086},{"type":"null"}]}},"signatureId":{"type":"string","minLength":1,"maxLength":64},"postId":{"type":"string","minLength":1,"maxLength":64}},"required":["postId"]},"description":"1 to 50 changes, each with postId and the fields of PATCH /api/posts/{postId}. A post can be listed once."}},"required":["posts"]}}}},"responses":{"200":{"description":"One result per change.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BulkResult"}}},"required":["results"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}":{"get":{"tags":["Posts"],"operationId":"getPost","summary":"Get a post and its results","description":"One entry in deliveries per account: queued, publishing, published or failed, the live address once published, and the platform's error when it failed. A post made with requireApproval also has approval, with its link while it can still be decided.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Posts"],"operationId":"updatePost","summary":"Change a draft or a scheduled post","description":"Only a draft, or a scheduled post that has not started publishing. A post waiting for approval is refused with 409, since only the approval page changes it, and so is a post that was approved, which goes out as it was approved. Fields left out stay as they are; accounts and mediaIds replace the whole list. A TikTok account listed again without options keeps the options stored for it on this post; options sent replace them whole, and options {} clears them. action schedule or now sends a draft out. action draft takes a scheduled post back to a draft. A scheduled post can get a new scheduledAt without an action. A scheduled time that is already due publishes before the response.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","maxLength":5000,"description":"The post text. Each platform's own length limit is checked when the post is scheduled or sent."},"platformOverrides":{"type":"object","propertyNames":{"type":"string","enum":["x","linkedin","instagram","facebook","threads","tiktok","youtube","bluesky","googlebusiness","pinterest","discord","telegram","whop","wordpress"]},"additionalProperties":{"type":"object","properties":{"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}}},"description":"Text and options per platform, for example { \"bluesky\": { \"body\": \"...\" } }. options carry the fields of each platform: postType picks the kind of post (instagram post, carousel, reel or story; facebook post, reel or story; youtube video or short; tiktok video; leave it out for the platform's usual post); youtube { title, tags, categoryId, madeForKids, privacyStatus (public, unlisted or private; left out on a new post, public), chapters ([{ time: \"0:00\", title: \"Intro\" }, ...]: at least 3, the first at 0:00, each at least 10 seconds long, written at the end of the description) } with body as the description (no title: the first line is the title); instagram { altText, shareToFeed, userTags (people tagged on a single feed picture: up to 20 of { username, x, y }, x and y from 0 to 1 from the top left corner) }, and on a Reel one cover (thumbOffsetMs, a frame in milliseconds before the video ends; coverMediaId, a picture from mediaIds that becomes the cover and not part of the Reel; or coverUrl, a public https picture link) and trialReel (manual or performance: shown to non-followers first, then shared to followers by hand in the Instagram app or automatically when it performs well; no shareToFeed); Instagram works only for Postwyre's Meta app testers until Meta's App Review; bluesky { replies (a thread: up to 9 texts, each sent right after the post under the one before; here only, not in an account's options), and threads and x take the same replies once Postwyre switches them on, refusing them with the reason until then }; firstComment and firstCommentDelayMinutes (0, 5, 15 or 60) where get_platform_guide lists them; facebook { link }; googlebusiness postType post (an update), event or offer, { ctaType (BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP or CALL; not on an offer), ctaUrl (not for CALL), eventTitle, eventStart and eventEnd (2026-11-20 or 2026-11-20T18:30, required on an event or offer), couponCode, redeemUrl, terms (offer only) }, and a post to it sent with a key waits for approval unless sent with personApproved (as does a post to linkedin, pinterest or youtube; one to tiktok always waits); pinterest { boardId (on the account), title, link, altText, coverFrameSeconds (video) }; discord { embedTitle, embedDescription, embedUrl, embedColor (#RRGGBB), embedImageMediaId, suppressEmbeds, silent, spoiler, threadId, threadName (forum channels) }; telegram { formatting (reads **bold**, __italic__, ~~strike~~, ||spoiler||, `code` and [words](https://link)), silent, linkPreview, protectContent, captionAbove, spoilerMedia }; whop { title, pinned, mention (notifies the members of the forum), visibility (members_only or globally_visible), pollOptions (2 to 10 choices) }, each Whop account being one forum; wordpress { title, excerpt, slug, status (publish, draft, pending, private or future), publishAt (with future), categories, tags (ids or names), authorId }, each WordPress account being one site. On any platform but Pinterest, Google Business Profile, Whop and WordPress, mentions: up to 20 accounts to @mention, each a handle or { handle, id, name, kind }, with @handle written in that platform's text (GET /api/posting/mentions looks one up; here only, not in an account's options). get_platform_guide in the MCP server lists every option with its limits. A Story shows no text, so none is sent."},"accounts":{"maxItems":25,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}},"required":["accountId"]},"description":"The accounts to post to, ids from GET /api/accounts. Each account can be listed once. body gives one account its own text. options is limited to 6000 characters of JSON."},"action":{"type":"string","enum":["draft","schedule","now"],"description":"schedule or now sends a draft out. draft takes a scheduled post back to a draft."},"scheduledAt":{"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":"ISO 8601 with an offset, between now and 366 days ahead. Needed with schedule. With draft and requireApproval, the time the post is proposed for."},"mediaIds":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"description":"Ids from POST /api/posting/media, confirmed, in the order they should appear."},"repeat":{"anyOf":[{"type":"object","properties":{"everyDays":{"type":"integer","minimum":1,"maximum":90},"times":{"type":"integer","minimum":1,"maximum":12},"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["everyDays"],"additionalProperties":false},{"type":"null"}],"description":"Send the post again every everyDays days (1 to 90), times more times (1 to 12) or until a date, whichever comes first. Each copy is a new post that counts against the plan and the platform's daily limit; one over a limit is skipped. Refused on TikTok, YouTube, Pinterest, Google Business Profile, LinkedIn, X and WordPress, and with requireApproval. On PATCH, null alone turns it off on any post, a sent one too."},"mediaAltText":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":4086},{"type":"null"}]},"description":"Alt text for each picture, by id from mediaIds, for example { \"<mediaId>\": \"A red bike against a brick wall\" }. Sent to X (1,000 characters), LinkedIn (4,086), Facebook, Threads (1,000), Discord (1,024), WordPress (the featured picture), Bluesky (2,000, each picture's own), Instagram (1,000: each carousel picture's own, and a single picture's when Instagram's own altText option is empty) and Pinterest (500) when its own altText option is empty. TikTok, YouTube, Telegram, Whop and Google Business Profile take none, so it is kept and not sent there. Each limit is checked when the post is scheduled or sent. On a change, a picture left out keeps its alt text and null clears it. A video's alt text is sent to Bluesky (2,000 characters) and kept, not sent, everywhere else."},"signatureId":{"type":"string","minLength":1,"maxLength":64,"description":"A signature id from GET /api/signatures. Its text goes at the end of the body, platformOverrides and accounts texts sent in this same change, after a blank line, as on POST /api/posts. A text not sent keeps what it has. Refused with 400 when the change sends none of those three. Another brand's id answers 404."},"personApproved":{"type":"boolean","description":"As on POST /api/posts, for the post as this change leaves it. Any change to the text, files, accounts or time drops an earlier approval: with a key, a change to a post going to one of those platforms is refused with 409 unless sent with personApproved again, and the post stays as it was."}}}}}},"responses":{"200":{"description":"The post after the change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`quota_exceeded`: The brand has no plan, or this would go over its plan's allowance of media bytes sent (or a trial's posts and sends, or a retired Pro plan's sends), or a brand's volume is unusually high and needs support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Posts"],"operationId":"deletePost","summary":"Delete a post","description":"A draft, a post waiting for approval (which withdraws the request), a scheduled post that has not started publishing, or a sent post whose every account has finished and whose copies that went out are all on Google Business Profile (failed accounts do not count). Any other post that has started stays in the history. With removeFromPlatforms=true, each sent Google Business Profile copy is removed from Google first; if Google does not remove one, the post is kept in Postwyre and the 502 message says what each platform answered. A sent post's monthly count is not given back.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."},{"name":"removeFromPlatforms","in":"query","required":false,"description":"true also removes each sent Google Business Profile copy from Google before the post is deleted. Needs an owner or admin of the brand: anyone else, and a key made without Can change the brand voice turned on, gets 403 and nothing is asked of Google. Leave out or false to delete it from Postwyre only.","schema":{"type":"string","enum":["true","false"]}},{"name":"only","in":"query","required":false,"description":"unsent deletes only a post with no copy out (a draft, one waiting for approval, an untouched scheduled post, or one that failed everywhere); sent deletes only a sent post and needs removeFromPlatforms. A post of the other kind answers 409, and nothing is asked of Google. The agent tools use it, so the message names their delete_post and delete_published_post. Leave out to delete either kind.","schema":{"type":"string","enum":["unsent","sent"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"platforms":{"type":"array","description":"One answer for each sent copy Postwyre was asked to remove. Empty when removeFromPlatforms was not set or nothing had been sent.","items":{"type":"object","properties":{"platform":{"type":"string"},"accountHandle":{"type":"string"},"removed":{"type":"boolean"},"message":{"type":"string"}},"required":["platform","accountHandle","removed","message"]}}},"required":["ok","platforms"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream_error`: The platform refused or did not answer. The message says what it said.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/retry":{"post":{"tags":["Posts"],"operationId":"retryPost","summary":"Retry failed accounts","description":"Sends every failed delivery of the post back for another try, or only the one named by deliveryId, then tries them before the response. A retry counts against the plan's sends again. The body can be left out.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"deliveryId":{"type":"string","minLength":1,"maxLength":64,"description":"Retry only this delivery, an id from the post's deliveries."}}}}}},"responses":{"200":{"description":"The post after the retry was tried.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`quota_exceeded`: The brand has no plan, or this would go over its plan's allowance of media bytes sent (or a trial's posts and sends, or a retired Pro plan's sends), or a brand's volume is unusually high and needs support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/remove":{"post":{"tags":["Posts"],"operationId":"removeSentPost","summary":"Take a sent post down from the platforms","description":"Removes every copy of a finished post from the platform it went to, where Postwyre can: X, LinkedIn, Facebook Pages, Pinterest, Discord, Telegram and Google Business Profile. The post stays in the history, each copy marked with removedAt. Calling it again asks no platform about a copy already down and answers already_removed. Needs an owner or admin of the brand: anyone else, and a key made without Can change the brand voice turned on, gets 403 and nothing is asked of any platform. A post with no copy out, or one still sending, answers 409. So does a post whose first comment is posting right now, with code comment_sending and nothing asked of any platform: call again in a few minutes. A post another request is removing right now answers 409 too: call again in a minute. A sent post's monthly count is not given back.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"responses":{"200":{"description":"What each platform answered.","content":{"application/json":{"schema":{"type":"object","properties":{"postId":{"type":"string"},"message":{"type":"string","description":"One sentence on what came down."},"platforms":{"type":"array","description":"One answer for each copy that went out, in the post's order.","items":{"type":"object","properties":{"deliveryId":{"type":"string"},"platform":{"type":"string"},"accountHandle":{"type":"string"},"status":{"type":"string","enum":["removed","already_removed","not_removable","failed"]},"removed":{"type":"boolean","description":"True when the copy is down, now or before."},"message":{"type":"string","description":"What the platform answered, or where to delete it when Postwyre cannot."}},"required":["deliveryId","platform","accountHandle","status","removed","message"]}}},"required":["postId","message","platforms"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/first-comment":{"put":{"tags":["Posts"],"operationId":"setFirstComment","summary":"Set a post's first comment","description":"Sets one platform's first comment on a draft or scheduled post, the comment the account adds under its own post once it is out, right after it or 5, 15 or 60 minutes later. text null removes it. The rest of the post stays as it is, and the same values twice give the same post. A post that has started sending answers 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["linkedin","bluesky","instagram","facebook","youtube"],"description":"A platform that takes a first comment in Postwyre."},"text":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"description":"The comment, or null to remove it."},"delayMinutes":{"default":0,"description":"0 (right after the post, the default), 5, 15 or 60.","anyOf":[{"type":"number","const":0},{"type":"number","const":5},{"type":"number","const":15},{"type":"number","const":60}]}},"required":["platform","text"]}}}},"responses":{"200":{"description":"The post with its first comment set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/first-comment/retry":{"post":{"tags":["Posts"],"operationId":"retryFirstComment","summary":"Retry a failed first comment","description":"Sends one result's failed first comment again, before the response, and never the post. A comment that is waiting, sending or already added is left as it is, so a second call sends nothing. A comment that failed because the platform did not answer may already be there, so it has a confirmToken: check the post, and only if the comment is missing send the token as confirmUnknownOutcome. Without it, or with a token from an earlier failure, the answer is 409 confirmation_required and nothing is sent. A post the platform never named (post_id_unknown), a comment that no longer passes the first comment checks, and a platform whose first comments or posting are switched off answer 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deliveryId":{"type":"string","minLength":1,"maxLength":64,"description":"The result's id, from the post's deliveries."},"confirmUnknownOutcome":{"type":"string","minLength":1,"maxLength":20,"description":"The comment's confirmToken, sent only after checking the post shows no comment."}},"required":["deliveryId"]}}}},"responses":{"200":{"description":"The post after the comment was tried.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/duplicate":{"post":{"tags":["Posts"],"operationId":"duplicatePost","summary":"Duplicate a post as a draft","description":"Makes a new draft from any post, in any state: the same text, each platform's own text and settings, the same accounts and copies of its files. Nothing is sent. An account that needs reconnecting, or whose platform is switched off, is left out and counted in accountsLeftOut. The copied files count toward the plan's storage; a file over 5 GB is refused. The body is optional. Send an idempotencyKey (or the Idempotency-Key header) to make a retried call safe: the same key for the same post returns the copy it already made with 200 instead of 201, and makes no second copy. A key cannot start with duplicate:.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":100},"description":"Used when the body has no idempotencyKey."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotencyKey":{"type":"string","minLength":8,"maxLength":100,"description":"8 to 100 characters. The same key for the same post returns the first copy."}}}}}},"responses":{"200":{"description":"A repeat with the same idempotency key: the copy made the first time, with the accountsLeftOut it gave then.","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/Post"},"accountsLeftOut":{"type":"integer","minimum":0},"sourceDeleted":{"type":"boolean","enum":[true],"description":"Only when the original post was deleted after the copy was made."}},"required":["post","accountsLeftOut"]}}}},"201":{"description":"The new draft, and how many accounts were left out.","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/Post"},"accountsLeftOut":{"type":"integer","minimum":0}},"required":["post","accountsLeftOut"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/history":{"get":{"tags":["Posts"],"operationId":"getPostHistory","summary":"Get a post's history","description":"Who changed the post's schedule or state, when and from where: its last 10 changes, newest first. Send results per account (publishing, published, failed, retries) are in GET /api/posts/{postId}, not here. Each has kind, from and to (status and scheduledAt), by (who) and via (app, rest, mcp or system). Still answers after the post was deleted, so the row that says who removed it can be read. 404 when the brand has no history for that id. No text or files are kept.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id, also one that was deleted."}],"responses":{"200":{"description":"The post's last changes, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"postId":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"kind":{"type":"string","enum":["drafted","edited_draft","scheduled","rescheduled","moved_to_drafts","sent_for_approval","approved","approved_through_agent","rejected","expired","account_disconnected","removed"]},"from":{"type":["object","null"],"description":"Status and send time before the change, or null."},"to":{"type":["object","null"],"description":"Status and send time after the change, or null when the post was removed."},"by":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key","agent","system"],"description":"user: a person in the app; api_key: a key, named in label; agent: a connected app (Claude, ChatGPT), named in label; system: Postwyre's scheduler."},"userId":{"type":["string","null"]},"name":{"type":["string","null"],"description":"The person's name, or null."},"label":{"type":["string","null"],"description":"The key's or the app's name as it was then."},"staff":{"type":["object","null"],"description":"On a user row, { name } of the Postwyre staff member signed in as that person who made the change (name null once they have left); null otherwise."}},"required":["type","userId","name","label","staff"]},"via":{"type":"string","enum":["app","rest","mcp","system"]}},"required":["at","kind","from","to","by","via"]}}},"required":["postId","history"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/{postId}/stats":{"get":{"tags":["Stats"],"operationId":"getPostStats","summary":"Get a post's stats","description":"One entry per account the post was published to, with its latest snapshot. A count the platform does not give is null, never 0. status waiting means not read yet; unavailable means the platform gave no counts and errorCode says why.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"postId","in":"path","required":true,"schema":{"type":"string"},"description":"A post id."}],"responses":{"200":{"description":"The post's stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostStats"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/stats":{"get":{"tags":["Stats"],"operationId":"listStats","summary":"List stats for a date range","description":"Every account result the brand published in [from, to), newest first, with its latest snapshot. from defaults to 30 days before to, and to to now. A range longer than 92 days answers 400.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"ISO 8601 with an offset."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"ISO 8601 with an offset."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Values above 100 are treated as 100."}],"responses":{"200":{"description":"One page of stats.","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"total":{"type":"integer","description":"Results in the range, across all pages."},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryStats"}},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["from","to","total","deliveries","page","pageSize"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/stats/summary":{"get":{"tags":["Stats"],"operationId":"getStatsSummary","summary":"Get the stats summary","description":"The last 7, 30, 90 days (days, default 7). Each result is scored: its engagement over the brand's median for the same platform at the same snapshot, from the last 90 days, so 1 is typical. The score is null without counts or with fewer than 3 results to take a median from. topPosts has the 5 highest, deliveries up to 100, and byHashtag the top 10. published and failed count the window's sends; a failed result counts by its last try.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","enum":[7,30,90],"default":7},"description":"Any other value answers 400."}],"responses":{"200":{"description":"The summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsSummary"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/stats/weekly":{"get":{"tags":["Stats"],"operationId":"getWeeklyReport","summary":"Get the weekly report","description":"The brand's last full week, Monday 00:00 to Monday 00:00 in its time zone (UTC when none is set), against the week before: the same numbers as the weekly summary email and the get_weekly_report tool. topPosts has the 3 posts with the most engagement. notMeasured lists sent posts with no counts by platform and reason, with a plain line. nextStep is one sentence drawn from the numbers.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The report.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeeklyReport"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/billing/credits":{"get":{"tags":["Credits"],"operationId":"getCredits","summary":"Get the plan's credits","description":"The credits of the plan this brand is on, shared by every brand on it. included is what is left of this month's credits (Solo gets 20 a month, Starter 150; a trial gets none), which reset on the first of the month in UTC and do not roll over. purchased is bought credits, which keep until used. An X post past the plan's X limit uses 3 credits, or 40 with a link, only when spendOnXOverage is on. On a plan where credits never pay past the X limit, spendOnXOverageApplies is false and spendOnXOverage reads false, whatever the owner set before. history is the latest 10 changes, newest first.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The plan's credits.","content":{"application/json":{"schema":{"type":"object","properties":{"included":{"type":"integer","description":"Monthly credits left this month."},"includedMonthly":{"type":"integer","description":"Monthly credits the plan gets."},"purchased":{"type":"integer","description":"Bought credits left."},"total":{"type":"integer"},"period":{"type":"string","description":"The month (YYYY-MM, UTC) the monthly credits belong to."},"spendOnXOverage":{"type":"boolean","description":"Whether credits pay for X posts past the X limit now: the plan's owner turned them on and the plan allows it. Always false when spendOnXOverageApplies is false."},"spendOnXOverageApplies":{"type":"boolean","description":"Whether credits can pay for X posts past the X limit on this plan at all. False on a plan where X posts always stop at the limit."},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"kind":{"type":"string","enum":["top_up","x_post","ai_text","transcript","suite","refund"],"description":"ai_text is one built-in AI action (Write it for me, Rewrite in voice, Draft a reply). transcript is one minute of a video listened to for its YouTube chapters in Compose. suite is work another Postwyre app charged through POST /api/suite/credits/spend; detail names the app and the work."},"credits":{"type":"integer","description":"Credits added (above 0) or used (below 0)."},"detail":{"type":"string"}},"required":["at","kind","credits","detail"]}}},"required":["included","includedMonthly","purchased","total","period","spendOnXOverage","spendOnXOverageApplies","history"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posts/next-slot":{"get":{"tags":["Posts"],"operationId":"findNextSlot","summary":"Find the next free posting time","description":"The brand's next free posting times, the same ones POST /api/posts/bulk gives a post with no scheduledAt: the brand's posting times in its time zone (UTC when it has none), at least 10 minutes from now, skipping every minute a post already waits at, up to 366 days ahead. Reading holds nothing: a post made at a time takes it, and the next call answers the time after. Each slot's at is ISO 8601 with the brand's offset, ready for scheduledAt.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":3}},{"name":"accountId","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":20},"style":"form","explode":true,"description":"Repeat for each account, ids from GET /api/accounts. slots are then for one post to all of them: their own posting times when they share them, else the brand's. Adds accounts, each account's own next times, and daily-limit warnings. An id not in the brand answers 404."}],"responses":{"200":{"description":"The next free times, soonest first.","content":{"application/json":{"schema":{"type":"object","properties":{"timeZone":{"type":"string"},"slots":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"utc":{"type":"string","format":"date-time"},"label":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["at","utc","label","warnings"]}},"accounts":{"type":"array","description":"With accountId only, in the order asked: each account's own next free times (its own posting times, or the brand's), with its own daily-limit warnings.","items":{"type":"object","properties":{"accountId":{"type":"string"},"handle":{"type":"string"},"platform":{"type":"string"},"usesBrandTimes":{"type":"boolean"},"postingTimes":{"type":["object","null"],"properties":{"days":{"type":"array","items":{"type":"integer"}},"times":{"type":"array","items":{"type":"string"}}}},"slots":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"utc":{"type":"string","format":"date-time"},"label":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["at","utc","label","warnings"]}}},"required":["accountId","handle","platform","usesBrandTimes","postingTimes","slots"]}},"note":{"type":["string","null"],"description":"Set when no posting time is left today in the brand's time zone, or fewer times were found than asked for. Any other time still works as scheduledAt."},"warnings":{"type":"array","items":{"type":"string"},"description":"Set when the brand has no time zone, so its posting times are read in UTC, and when the accounts asked about have different posting times, so slots are the brand's. Empty otherwise."}},"required":["timeZone","slots","note","warnings"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/connect-links":{"get":{"tags":["Connect links"],"operationId":"listConnectLinks","summary":"List connect links","description":"The brand's connect links, newest first. Never the address: only create answers with it.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The links.","content":{"application/json":{"schema":{"type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"],"description":"Who it is for, shown only to the brand's team."},"status":{"type":"string","enum":["active","expired","revoked","off"],"description":"off: the person who made it is no longer an owner or admin of the brand."},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"connected":{"type":"integer","description":"Accounts this link has connected."}},"required":["id","label","status","expiresAt","createdAt","revokedAt","createdBy","connected"]}}},"required":["links"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Connect links"],"operationId":"createConnectLink","summary":"Make a connect link","description":"Makes a link for the brand's client. It works for expiresInDays (1 to 30, 7 when left out) or until it is revoked. url is in this answer only: Postwyre keeps its hash. Each call makes a new link, up to 20 on at once per brand; before a plan starts, 20 across every brand its owner has with no plan (409 past that). While no platform is open to connect from a link, nothing is made and it answers 409 (the no-plan sentence when the brand has no plan). Accounts it connects are connected accounts on the plan.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expiresInDays":{"type":"integer","minimum":1,"maximum":30,"description":"Days the link works."},"label":{"type":"string","maxLength":80,"description":"Who it is for."}}}}}},"responses":{"201":{"description":"Made.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"],"description":"Who it is for, shown only to the brand's team."},"status":{"type":"string","enum":["active","expired","revoked","off"],"description":"off: the person who made it is no longer an owner or admin of the brand."},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"connected":{"type":"integer","description":"Accounts this link has connected."},"url":{"type":"string","description":"The link. Shown only here."}},"required":["id","label","status","expiresAt","createdAt","revokedAt","createdBy","connected","url"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/connect-links/{linkId}":{"delete":{"tags":["Connect links"],"operationId":"revokeConnectLink","summary":"Turn off a connect link","description":"Turns the link off for good. A sign-in still open from it does not finish; accounts it connected stay connected. One already off answers revoked false. Another brand's link answers 404.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"linkId","in":"path","required":true,"schema":{"type":"string"},"description":"A link id from GET /api/connect-links."}],"responses":{"200":{"description":"Whether the link was turned off now.","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/signatures":{"get":{"tags":["Signatures"],"operationId":"listSignatures","summary":"List signatures","description":"The brand's saved signatures, by name.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The signatures.","content":{"application/json":{"schema":{"type":"object","properties":{"signatures":{"type":"array","items":{"$ref":"#/components/schemas/Signature"}}},"required":["signatures"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Signatures"],"operationId":"createSignature","summary":"Save a signature","description":"Saves a signature: a name up to 60 characters and text up to 500, up to 20 per brand; before a plan starts, 20 across every brand its owner has with no plan. The same name and text again answers 200 with the saved one and replayed true; the same name with other text answers 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"text":{"type":"string","minLength":1,"maxLength":500}},"required":["name","text"]}}}},"responses":{"200":{"description":"This name and text were already saved; this is that signature, with replayed true.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"replayed":{"type":"boolean"}},"required":["id","name","text","createdAt","replayed"]}}}},"201":{"description":"Saved.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"replayed":{"type":"boolean"}},"required":["id","name","text","createdAt","replayed"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/signatures/{signatureId}":{"delete":{"tags":["Signatures"],"operationId":"deleteSignature","summary":"Delete a signature","description":"Deletes one of the brand's signatures. Posts already made keep their text. One already gone, or another brand's, answers deleted false.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"signatureId","in":"path","required":true,"schema":{"type":"string"},"description":"A signature id from GET /api/signatures."}],"responses":{"200":{"description":"Whether a signature was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/brand-voice":{"get":{"tags":["Brand voice"],"operationId":"getBrandVoice","summary":"Get the brand voice","description":"The voice in use, or null when nobody has set one, and the saved versions, newest first (the last 30).","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The voice and its versions.","content":{"application/json":{"schema":{"type":"object","properties":{"brandVoice":{"oneOf":[{"$ref":"#/components/schemas/SavedBrandVoice"},{"type":"null"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/BrandVoiceVersion"}}},"required":["brandVoice","versions"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Brand voice"],"operationId":"setBrandVoice","summary":"Change the brand voice","description":"Saves a new version. The fields sent replace those fields and the rest stay; saving the voice already in use saves nothing and answers changed false. Or send restoreVersion alone to bring an earlier version back as the newest. Needs an owner or admin: a key acts at the lower of its own role and its owner's role in the brand, so a member's key answers 403.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audience":{"type":"string","maxLength":500},"tone":{"type":"string","maxLength":500},"wordsToUse":{"maxItems":25,"type":"array","items":{"type":"string","maxLength":60}},"wordsToAvoid":{"maxItems":25,"type":"array","items":{"type":"string","maxLength":60}},"emoji":{"type":"string","enum":["none","sparing","free"]},"hashtags":{"type":"string","enum":["none","few","platform"]},"brandHashtags":{"maxItems":5,"type":"array","items":{"type":"string","maxLength":60}},"cta":{"type":"string","maxLength":300},"examples":{"maxItems":3,"type":"array","items":{"type":"string","maxLength":2200}},"bannedClaims":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"restoreVersion":{"type":"integer","minimum":1,"maximum":1000000,"description":"A version from GET /api/brand-voice. Send it on its own."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The voice now in use; null when none was set and the change left it empty.","content":{"application/json":{"schema":{"type":"object","properties":{"brandVoice":{"oneOf":[{"$ref":"#/components/schemas/SavedBrandVoice"},{"type":"null"}]},"changed":{"type":"boolean"}},"required":["brandVoice","changed"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posting/mentions":{"get":{"tags":["Posts"],"operationId":"findMention","summary":"Find an account to mention","description":"The accounts a post on one platform could @mention for what follows the @: Bluesky accounts whose handle or name starts with q, from Bluesky's public directory; a LinkedIn Page whose handle (linkedin.com/company/<handle>) is q, asked with one of the brand's LinkedIn accounts; on other platforms only the handle's shape is checked. support says how the platform takes a mention: linked (Postwyre links it by id), text (sent as @handle the way the platform's app writes it) or none. To mention, write @handle in that platform's text and put the handle, or { handle, id, name, kind }, in platformOverrides.<platform>.options.mentions. Bluesky and LinkedIn ids are looked up again when the post is scheduled; Discord takes { handle, id, kind: user or role } and has no lookup. Reads only; the same query gives the same answer.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["x","linkedin","instagram","facebook","threads","tiktok","youtube","bluesky","googlebusiness","pinterest","discord","telegram","whop","wordpress"]}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100},"description":"What follows the @, with or without it."},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"},"description":"LinkedIn only: one of the brand's LinkedIn accounts to look up with. Left out, the first connected one. Another brand's account answers 404."}],"responses":{"200":{"description":"The accounts that match.","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string"},"support":{"type":"string","enum":["linked","text","none"]},"lookup":{"type":"string","enum":["search","exact","none"]},"note":{"type":"string"},"candidates":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":"string"}},"required":["handle"]}},"problem":{"type":["string","null"],"description":"Why nothing matched, or why the text cannot be a mention here."}},"required":["platform","support","lookup","note","candidates","problem"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posting/media":{"post":{"tags":["Media"],"operationId":"createMediaUpload","summary":"Ask for an upload address","description":"Step one of attaching a picture or video. Then PUT the file to uploadUrl with the same Content-Type and exactly sizeBytes as Content-Length, within 10 minutes, and confirm it. Pictures: JPEG, PNG, GIF or WebP up to 10 MB. Video: MP4 or MOV up to 512 MB, or 8 GB when bigger videos are switched on. Each platform takes only some files (Bluesky: pictures, or one MP4 up to 300 MB and 10 minutes); schedule and now refuse a post whose files an account's platform does not take, with 400. While no platform that takes files is switched on, or file storage is off, this answers 503. A brand can hold 50 files not yet on a post; a file nobody attaches is removed after 7 days. Before a plan starts, a brand can keep up to 10 pictures and videos taking up to 100 MB, counted across every brand its owner has with no plan. Past any of these, or at the plan's storage limit, this answers 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"contentType":{"type":"string","minLength":1,"maxLength":100,"description":"One of image/jpeg, image/png, image/gif, image/webp, video/mp4, video/quicktime."},"sizeBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The exact size of the file in bytes."},"parts":{"type":"boolean","description":"Send true to upload a big video in parts that can each be retried. Only used when bigger videos are switched on and the file is 64 MB or more; otherwise the answer has an uploadUrl as usual."}},"required":["fileName","contentType","sizeBytes"]}}}},"responses":{"201":{"description":"Upload the file to uploadUrl, then confirm it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUpload"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posting/media/from-url":{"post":{"tags":["Media"],"operationId":"importMediaFromUrl","summary":"Store a file from an address","description":"Postwyre fetches a picture or video from a public https address and stores it as an upload is stored, ready for mediaIds. Pictures up to 10 MB, video up to 100 MB, and the address has to say how large a video is. The same limits as POST /api/posting/media apply, with 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address of a picture or video."},"fileName":{"type":"string","minLength":1,"maxLength":150,"description":"A name for the file. Defaults to the last part of the address."}},"required":["url"]}}}},"responses":{"201":{"description":"The file, ready to attach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posting/media/{mediaId}/parts":{"post":{"tags":["Media"],"operationId":"mediaUploadParts","summary":"Get links for an upload's parts","description":"For an upload started in parts: a link for each part number asked for (up to 100 at a time), and the numbers of the parts already stored, so after a dropped connection you send only what is missing. PUT each part's bytes to its link within an hour, with no Content-Type. Then confirm as usual; confirm answers 409 until every part is stored at its size. An upload not in parts, or one that has expired, answers 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"mediaId","in":"path","required":true,"schema":{"type":"string"},"description":"The id from POST /api/posting/media."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"partNumbers":{"maxItems":100,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Part numbers, from 1. Send an empty list to read only which parts are stored."}},"required":["partNumbers"]}}}},"responses":{"200":{"description":"Links for the parts asked for, and the parts already stored.","content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","properties":{"partNumber":{"type":"integer"},"url":{"type":"string"}},"required":["partNumber","url"]}},"uploaded":{"type":"array","items":{"type":"integer"}}},"required":["parts","uploaded"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/posting/media/{mediaId}/confirm":{"post":{"tags":["Media"],"operationId":"confirmMediaUpload","summary":"Confirm an upload","description":"Step two: checks the file is in storage at the announced size. Only a confirmed file can go in mediaIds. A file of the wrong size is deleted and answers 400.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"mediaId","in":"path","required":true,"schema":{"type":"string"},"description":"The id from POST /api/posting/media."}],"responses":{"200":{"description":"The file, ready to attach.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/approvals/{token}":{"post":{"tags":["Approvals"],"operationId":"decideApproval","summary":"Approve or reject a held post","description":"token is the last part of the approval link. Any member of the post's own brand can decide, whichever brand they have open; anyone else gets 404, as for a link that does not exist. version must be the post's updatedAt as last read, so a stale page cannot approve text that changed. approve sends the post as it was asked (at its scheduledAt, or now) and counts it against the plan then; a draft hold is queued at its scheduledAt when it has accounts and that time is ahead, and otherwise becomes a draft, with nothing sent or counted. reject marks it not_approved, which is final, and keeps the reason if one is given. A link that has expired or was already decided answers 409; a deleted post answers 404.","security":[{"sessionCookie":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"The last part of the approval link, /approve/{token}."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"],"description":"approve or reject."},"version":{"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":"The post's updatedAt as last read."},"sendNow":{"default":false,"type":"boolean","description":"Approve a scheduled post whose time has passed, or one set for later while scheduling is paused, by sending it now. Never sends a future post early. Refused on a draft hold."},"reason":{"type":"string","maxLength":500,"description":"With reject: why, in a few words, up to 500 characters. The agent that asked reads it in approval.reason."}},"required":["decision","version"]}}}},"responses":{"200":{"description":"The post after the decision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`quota_exceeded`: The brand has no plan, or this would go over its plan's allowance of media bytes sent (or a trial's posts and sends, or a retired Pro plan's sends), or a brand's volume is unusually high and needs support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Approvals"],"operationId":"editHeldPost","summary":"Change a held post's text","description":"Sets each account's text on a post waiting for approval, checked against its platform's limit, and moves updatedAt on. A draft hold with no accounts takes body instead. Who may call it, and the 404 and 409 answers, are as for approving.","security":[{"sessionCookie":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"The last part of the approval link, /approve/{token}."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"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":"The post's updatedAt as last read."},"texts":{"default":[],"maxItems":25,"type":"array","items":{"type":"object","properties":{"deliveryId":{"type":"string","minLength":1,"maxLength":64},"body":{"type":"string","maxLength":5000}},"required":["deliveryId","body"]},"description":"Each account's text, by delivery id from the post's deliveries."},"body":{"type":"string","maxLength":5000,"description":"The post's text, for a draft hold with no accounts yet."}},"required":["version"]}}}},"responses":{"200":{"description":"The post after the change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/items":{"get":{"tags":["Engage"],"operationId":"listEngageItems","summary":"List comments and mentions","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","done"]}},{"name":"platform","in":"query","required":false,"schema":{"type":"string"},"description":"One platform, for example instagram."},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"},"description":"An id from GET /api/accounts."},{"name":"postId","in":"query","required":false,"schema":{"type":"string"},"description":"A Postwyre post id: only comments left on it."},{"name":"assignee","in":"query","required":false,"schema":{"type":"string"},"description":"A teammate's id, me for the caller, or none for unassigned."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["comment","reply","mention","review"]},"description":"One kind, for example review for Google Business Profile reviews."},{"name":"ratings","in":"query","required":false,"schema":{"type":"string"},"description":"Review stars, comma separated, for example 1,2,3."},{"name":"drafts","in":"query","required":false,"schema":{"type":"string","enum":["true"]},"description":"true: only reviews with an agent's reply waiting for approval."},{"name":"before","in":"query","required":false,"schema":{"type":"string"},"description":"The next value of the last page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":30}}],"responses":{"200":{"description":"One page, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EngageItem"}},"next":{"type":["string","null"],"description":"Pass as before for the next page; null on the last."},"problems":{"type":"array","items":{"$ref":"#/components/schemas/EngageProblem"}}},"required":["items","next","problems"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/items/{itemId}":{"patch":{"tags":["Engage"],"operationId":"updateEngageItem","summary":"Mark a comment done or open, or assign it","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. Send status, assignedUserId (a teammate's id, or null to unassign) or both. discardDraft true drops an agent's reply waiting for approval.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"},"description":"An id from GET /api/engage/items."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","done"]},"assignedUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"discardDraft":{"type":"boolean","const":true}}}}}},"responses":{"200":{"description":"The item after the change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngageItem"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/items/{itemId}/reply":{"post":{"tags":["Engage"],"operationId":"replyToEngageItem","summary":"Reply to a comment in public","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. The reply is posted on the platform as the account the comment came to, then the item is marked done. Each platform has its own length limit; a longer reply answers 400. X replies go out only through a brand's own X app. A brand with no plan is refused with 402 quota_exceeded and the page where a person starts one; reading the inbox needs no plan. A reply sent with an API key is held for a person to approve (outcome held_for_approval, the text in draft): always for a comment or mention, and for a Google Business Profile review unless the location's autopilot is on and Google, asked right before sending, shows 4 or 5 stars and no reply yet. Sending the held draft again after it posted answers 409.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"},"description":"An id from GET /api/engage/items."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":2200,"description":"The reply, at most 2200 characters and fewer on platforms that allow fewer."}},"required":["text"]}}}},"responses":{"200":{"description":"The item: done with its reply when outcome is sent, or with the reply in draft when it is held_for_approval.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EngageItem"},{"type":"object","properties":{"outcome":{"type":"string","enum":["sent","held_for_approval"]}},"required":["outcome"]}]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`upstream_error`: the platform is limiting replies for now. Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream_error`: The platform refused or did not answer. The message says what it said.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Engage, or the part of it this route needs (comment DMs, or replies on that platform), is not available in Postwyre for now. Nothing to set up on your side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/review-autopilot":{"get":{"tags":["Engage"],"operationId":"listReviewAutopilot","summary":"Read each Google location's autopilot","description":"Answers 404 not_configured until Google Business Profile reviews are on. One entry per connected location: on is whether an agent's replies to 4 and 5 star reviews post without approval, with who turned it on and when. Only an owner or admin can change it, in Postwyre, never with a key.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Every connected location.","content":{"application/json":{"schema":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/ReviewAutopilot"}}},"required":["locations"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/review-requests":{"get":{"tags":["Engage"],"operationId":"listReviewRequests","summary":"List Google review requests","description":"Answers 404 with code not_configured while review requests are not available in Postwyre. Newest first, 50 a page; next is the before value for the page after. A customer's email and first name are null once the request has ended.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["awaiting_approval","queued","sent","done","failed"]}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"next from the page before."}],"responses":{"200":{"description":"One page of requests.","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"$ref":"#/components/schemas/ReviewRequest"}},"next":{"type":["string","null"],"format":"date-time"}},"required":["requests","next"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Engage"],"operationId":"createReviewRequest","summary":"Ask a customer for a Google review","description":"Answers 404 with code not_configured while review requests are not available in Postwyre. Emails one customer the location's Google review link, with one reminder later unless a review by that first name comes in. Ask every customer: Google forbids choosing who to ask by how it went, and offering anything for a review. The wording is fixed. Made with a key, the brand's first request waits for a person to approve it in Postwyre (status awaiting_approval). An address asked in the last 90 days is not asked again: the answer is that earlier request with replayed true and status 200. The brands on one plan can make 100 requests in 24 hours between them; past that the answer is 429.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64,"description":"A Google Business Profile location from GET /api/engage/review-requests/settings that has a review link."},"email":{"type":"string","maxLength":254,"description":"The customer's email address."},"firstName":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"Optional. Used in the greeting and to notice the customer's review. Letters only, with an apostrophe or hyphen inside; any other name is left out and the email says Hi."}},"required":["accountId","email"]}}}},"responses":{"200":{"description":"This address was asked already; the earlier request.","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/ReviewRequest"},"replayed":{"type":"boolean"}},"required":["request","replayed"]}}}},"201":{"description":"Made.","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/ReviewRequest"},"replayed":{"type":"boolean"}},"required":["request","replayed"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`quota_exceeded`: the plan's brands made their 24 hour allowance of review requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/review-requests/settings":{"get":{"tags":["Engage"],"operationId":"getReviewRequestSettings","summary":"Read review request settings","description":"Answers 404 with code not_configured while review requests are not available in Postwyre. Each connected Google Business Profile location with its review link (null until an owner or admin adds it in Postwyre), the reminder delay in days (0 is no reminder), and when a person approved the brand's first agent request. Only a person signed in to Postwyre can change these, or approve.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The brand's settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequestSettings"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/rules":{"get":{"tags":["Engage"],"operationId":"listEngageRules","summary":"List comment DM rules","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. Rules send a direct message to a person who comments a keyword on Instagram or Facebook. templates are starting points; nothing is saved until a rule is made.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"The brand's rules.","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/EngageRule"}},"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyword":{"type":"string"},"publicReply":{"type":"string"},"dmText":{"type":"string"},"optOutKeyword":{"type":"string"},"newsletterSignup":{"type":"boolean"}},"required":["id","name","keyword","publicReply","dmText","optOutKeyword","newsletterSignup"]}}},"required":["rules","templates"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Engage"],"operationId":"createEngageRule","summary":"Make a comment DM rule","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. Owners and admins only. A person gets one DM per rule, within 7 days of the comment, and none after they send the stop word. Answers 503 not_configured when Engage is available but comment DMs are not.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"description":"One Instagram or Facebook account from GET /api/accounts; leave out for all of them."},"platformPostId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"description":"One post's id on the platform; leave out for every post."},"keyword":{"type":"string","minLength":2,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} '_-]*$","description":"The word or phrase a comment must contain, any case, as a whole word."},"publicReply":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"dmText":{"type":"string","minLength":1,"maxLength":900,"description":"The message to send. With dmLink the two together must stay under about 1,000 characters."},"dmLink":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}],"description":"An https link added to the message."},"optOutKeyword":{"anyOf":[{"type":"string","minLength":2,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} '_-]*$"},{"type":"null"}]},"newsletterSignup":{"type":"boolean","description":"true adds the newsletter signup link, tagged with the brand, rule, post and keyword, under dmLink. Answers 400 while newsletter signup is not available."},"enabled":{"type":"boolean"}},"required":["name","keyword","dmText"]}}}},"responses":{"201":{"description":"Made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngageRule"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Engage, or the part of it this route needs (comment DMs, or replies on that platform), is not available in Postwyre for now. Nothing to set up on your side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/rules/{ruleId}":{"patch":{"tags":["Engage"],"operationId":"updateEngageRule","summary":"Change a comment DM rule","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. Owners and admins only. Send only the fields to change; enabled false pauses the rule. Turning a rule on answers 503 not_configured while comment DMs are off.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string"},"description":"An id from GET /api/engage/rules."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"platformPostId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"keyword":{"type":"string","minLength":2,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} '_-]*$"},"publicReply":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"dmText":{"type":"string","minLength":1,"maxLength":900},"dmLink":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"optOutKeyword":{"anyOf":[{"type":"string","minLength":2,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} '_-]*$"},{"type":"null"}]},"newsletterSignup":{"type":"boolean"},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The rule after the change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngageRule"}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Engage, or the part of it this route needs (comment DMs, or replies on that platform), is not available in Postwyre for now. Nothing to set up on your side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Engage"],"operationId":"deleteEngageRule","summary":"Remove a comment DM rule","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. Owners and admins only. Its DM log goes with it.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string"},"description":"An id from GET /api/engage/rules."}],"responses":{"204":{"description":"Removed. No body."},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/engage/dms":{"get":{"tags":["Engage"],"operationId":"listEngageDms","summary":"Read the comment DM log","description":"Answers 404 with code not_configured, not not_found, while Engage is not available in Postwyre. Every DM a rule sent, failed to send or chose not to send, newest first, and each rule's counts over the last days.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"ruleId","in":"query","required":false,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":90,"default":30},"description":"How far back the counts go."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"The log and counts.","content":{"application/json":{"schema":{"type":"object","properties":{"log":{"type":"array","items":{"$ref":"#/components/schemas/EngageDm"}},"stats":{"type":"object","properties":{"comments":{"type":"integer","description":"Comments read in the period."},"rules":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"commented":{"type":"integer","description":"People who commented the rule's keyword; each is messaged once per rule."},"sent":{"type":"integer"},"failed":{"type":"integer"},"skipped":{"type":"integer"},"signups":{"type":"integer","description":"Newsletter signups CRMwyre reported for the rule's signup link."}},"required":["ruleId","commented","sent","failed","skipped","signups"]}}},"required":["comments","rules"]}},"required":["log","stats"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key's owner is not in that brand or in any brand, or the key is blocked there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: This key made more than 120 requests this minute. The Retry-After header says how many seconds to wait. Other limits answer 429 with quota_exceeded; the route says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/webhooks":{"get":{"tags":["Webhooks"],"operationId":"listWebhooks","summary":"List webhook endpoints","description":"The open brand's endpoints and how their last delivery went. The signing secret is never returned here.","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["endpoints"]}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"operationId":"createWebhook","summary":"Add a webhook endpoint","description":"The address must be public https on port 443 with no sign-in details in it; local and private network addresses are refused with 400. A plan can have up to 3 endpoints across its brands and sends up to 400 requests a UTC day; past the endpoint cap, or with no plan, this answers 409. The signing secret is in this response only.","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"Where to send events: a public https address on port 443."},"events":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["post.published","post.failed","post.approval_requested"]},"description":"Any of post.published, post.failed, post.approval_requested."}},"required":["url","events"]}}}},"responses":{"201":{"description":"Added.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"secret":{"type":"string","description":"Signs every request in the Postwyre-Signature header. Shown once."}},"required":["endpoint","secret"]}}}},"400":{"description":"`validation_error`: The request was not valid. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The thing is in a state that does not allow this. The message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`not_configured`: Posting is paused, or scheduling or file uploads are off. While posting is paused the message starts with 'Posting is paused for now.' and says what still works.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/webhooks/{endpointId}":{"delete":{"tags":["Webhooks"],"operationId":"deleteWebhook","summary":"Remove a webhook endpoint","description":"Stops deliveries to it and drops its history.","security":[{"sessionCookie":[]}],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"},"description":"An id from GET /api/webhooks."}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"401":{"description":"`unauthorized`: not signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: an API key or a connector sign-in token was sent, which this route refuses, or the person's role is too low.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found in this brand. Ids from another brand are not found too.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key that starts with sk_live_. The app shows it once when you make it."},"productToken":{"type":"http","scheme":"bearer","description":"The sign-in token a Postwyre app (such as CRMwyre) got when the person signed in with their Postwyre login. Only the credits routes take it; an API key is refused there."},"sessionCookie":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"The cookie a browser gets when a person signs in to the app (with a __Secure- prefix over https). Routes that need it refuse an API key."}},"parameters":{"WorkspaceId":{"name":"X-Workspace-Id","in":"header","required":false,"schema":{"type":"string"},"description":"The brand to act in, an organizationId from GET /api/workspaces. Needed once the key's owner is in more than one brand; without it the request answers 400."}},"schemas":{"Signature":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","text","createdAt"]},"SavedBrandVoice":{"type":"object","properties":{"version":{"type":"integer"},"savedAt":{"type":"string","format":"date-time"},"voice":{"type":"object","properties":{"audience":{"type":"string","maxLength":500},"tone":{"type":"string","maxLength":500},"wordsToUse":{"maxItems":25,"type":"array","items":{"type":"string","maxLength":60}},"wordsToAvoid":{"maxItems":25,"type":"array","items":{"type":"string","maxLength":60}},"emoji":{"type":"string","enum":["none","sparing","free"]},"hashtags":{"type":"string","enum":["none","few","platform"]},"brandHashtags":{"maxItems":5,"type":"array","items":{"type":"string","maxLength":60}},"cta":{"type":"string","maxLength":300},"examples":{"maxItems":3,"type":"array","items":{"type":"string","maxLength":2200}},"bannedClaims":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}}},"required":["audience","tone","wordsToUse","wordsToAvoid","emoji","hashtags","brandHashtags","cta","examples","bannedClaims"]}},"required":["version","savedAt","voice"]},"BrandVoiceVersion":{"type":"object","properties":{"version":{"type":"integer"},"savedAt":{"type":"string","format":"date-time"},"savedBy":{"type":["string","null"],"description":"Who saved it; null once that login is deleted."},"via":{"type":"string","enum":["session","api_key","oauth"]},"app":{"type":["string","null"],"description":"The connected app that saved it (Claude, ChatGPT), by the name it registered with; null unless via is oauth."},"restoredFrom":{"type":["integer","null"],"description":"The version this one brought back."}},"required":["version","savedAt","savedBy","via","app","restoredFrom"]},"BulkResult":{"type":"object","description":"One post's result in a bulk request.","required":["index","ok"],"properties":{"index":{"type":"integer","description":"The post's place in the request, from 0."},"ok":{"type":"boolean"},"post":{"$ref":"#/components/schemas/Post","description":"The post, when ok."},"replayed":{"type":"boolean","description":"true when the post was made by an earlier request with the same idempotencyKey."},"warnings":{"type":"array","items":{"type":"string"},"description":"Things to check that did not stop the post, such as a daily limit that varies by account."},"postId":{"type":"string","description":"The post a refused change was for."},"error":{"type":"object","description":"Why the post was refused, when not ok.","properties":{"code":{"type":"string","enum":["validation_error","not_found","conflict","upstream_error","internal_error","unauthorized","forbidden","not_configured","quota_exceeded","rate_limited","confirmation_required","comment_sending","setup_required"]},"message":{"type":"string"},"url":{"type":"string","format":"uri","description":"The page that fixes it, to hand to the person. On quota_exceeded for a used-up limit (media, a trial's allowance, retired Pro's sends), the brand's Billing link, only when the person signed in, or the key, is an owner or admin of the brand."}},"required":["code","message"]}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["validation_error","not_found","conflict","upstream_error","internal_error","unauthorized","forbidden","not_configured","quota_exceeded","rate_limited","confirmation_required","comment_sending","setup_required"]},"message":{"type":"string","description":"Why, in a sentence a person can read."},"url":{"type":"string","format":"uri","description":"The page that fixes it, to hand to the person. On quota_exceeded for a used-up limit (media, a trial's allowance, retired Pro's sends), the brand's Billing link, only when the person signed in, or the key, is an owner or admin of the brand."}},"required":["code","message"]}},"required":["error"]},"Workspace":{"type":"object","properties":{"organizationId":{"type":"string","description":"Send this as the x-workspace-id header."},"name":{"type":"string"},"role":{"type":"string","enum":["member","admin","owner"],"description":"The key owner's role in this brand."},"current":{"type":"boolean","description":"The brand a signed-in browser has open. Always false for a key."},"access":{"type":"string","enum":["paid","trial","comp","none"],"description":"The posting plan that covers this brand. none means no posting plan yet: posts can be drafted but not sent or scheduled."},"plan":{"type":["string","null"],"enum":["solo","starter","pro","crm_solo","datawyre_solo","meet_solo","studio_solo","voice_solo","cold_solo","call_solo","suite_bundle",null],"description":"solo and starter are the plans sold today. suite_bundle is the Suite bundle, which has Starter's limits. pro is no longer sold and appears only on plans made before it was retired. null on a complimentary plan from Postwyre that is none of these; access is comp then. With access none: the plan for another Postwyre app alone that this brand has, such as crm_solo, which does not post, or null when it has no plan or its plan has stopped. That app-only plan covers its own brand alone, never the brands on its planWorkspaceId."},"planWorkspaceId":{"type":["string","null"],"description":"The brand that holds the plan covering this one. Brands with the same planWorkspaceId share one plan's limits. Null when the key's owner is not in that brand."},"paymentPaused":{"type":"boolean","description":"true when the plan's payment failed and its grace days are over: no new post can be scheduled or sent until the plan's owner updates the card in Billing and the payment goes through, while access and plan still read the plan's. false otherwise, including once a plan has stopped for failed payments, which reads access none."}},"required":["organizationId","name","role","current","access","plan","planWorkspaceId","paymentPaused"]},"Account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"handle":{"type":"string"},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["active","needs_reconnect"],"description":"needs_reconnect: a person has to reconnect it in the app before it can be posted to."},"statusReason":{"type":["string","null"],"description":"Why the account needs a reconnect, in Postwyre's words with the next step. Never the platform's own error text or codes. Null when nothing is wrong."},"createdAt":{"type":"string","format":"date-time"},"appKeyProblem":{"type":"string","description":"Only on an X account connected through the brand's own X app, when Postwyre can't read that app's saved keys: the sentence the Accounts page shows, to pass on to the person."}},"required":["id","platform","handle","displayName","avatarUrl","status","statusReason","createdAt"]},"Media":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["image","video"]},"fileName":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer"},"width":{"type":["integer","null"],"description":"Pixels, read from the file when the upload was confirmed. Null when it could not be read."},"height":{"type":["integer","null"],"description":"Pixels, read from the file when the upload was confirmed. Null when it could not be read."},"durationMs":{"type":["integer","null"],"description":"A video's length in milliseconds, read from the file when the upload was confirmed. Null for a picture, or when it could not be read."},"pageCount":{"type":["integer","null"],"description":"A PDF's pages, counted from the file when the upload was confirmed. Null for a picture or a video."},"jpeg":{"type":["object","null"],"properties":{"sizeBytes":{"type":"integer"},"width":{"type":"integer"},"height":{"type":"integer"}},"required":["sizeBytes","width","height"],"description":"The JPEG copy Postwyre made of a PNG, WebP or still GIF when the upload was confirmed, which Instagram gets instead of the original. Null for a JPEG, a video, a moving GIF, or a picture that could not be read."},"altText":{"type":["string","null"],"description":"The picture's alt text, sent to every platform that takes it. Null when none was written."},"video":{"type":["object","null"],"description":"A video's header as Postwyre read it when the upload was confirmed, the facts each platform's video limits are checked on: fileBrand, moovFirst, fragmented, hasEditList, videoCodec, videoProfile, chromaFormat, interlaced, frameRate, videoBitrate, hdr, hasAudio, audioCodec, audioSampleRate, audioChannels. Each is null when it could not be read. Null for a picture, or a video confirmed before Postwyre read headers."}},"required":["id","kind","fileName","contentType","sizeBytes","width","height","durationMs","pageCount","jpeg","altText","video"]},"MediaUpload":{"type":"object","properties":{"id":{"type":"string","description":"Confirm with this id, then pass it in mediaIds."},"uploadUrl":{"type":"string","description":"PUT the file here. Expires after 10 minutes. Missing when the upload goes in parts."},"upload":{"type":"object","description":"Present instead of uploadUrl when the upload goes in parts: every part is partBytes long except the last. Get each part's link from POST /api/posting/media/{mediaId}/parts.","properties":{"partBytes":{"type":"integer"},"partCount":{"type":"integer"}},"required":["partBytes","partCount"]},"kind":{"type":"string","enum":["image","video"]}},"required":["id","kind"]},"Delivery":{"type":"object","description":"The post's result on one account.","properties":{"id":{"type":"string"},"socialAccountId":{"type":"string"},"platform":{"type":"string"},"accountHandle":{"type":"string"},"bodyOverride":{"type":["string","null"],"description":"This account's own text, when it has one."},"postType":{"type":"string","enum":["post","carousel","reel","story","video","short","photo","event","offer","inbox"],"description":"The kind of post this account gets: the postType chosen in its options or its platform's, or else the platform's usual post for these files (an Instagram video is a reel)."},"status":{"type":"string","enum":["queued","publishing","published","failed"]},"attempts":{"type":"integer"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"platformPostUrl":{"type":["string","null"],"description":"The live post, once published."},"errorCode":{"type":["string","null"],"description":"One of Postwyre's own codes (for example rate_limited, platform_unavailable, platform_refused, media_refused, permission_missing), never the platform's error name. Set when the post failed or waits to be tried again."},"errorMessage":{"type":["string","null"],"description":"Why it failed, or why it waits to be tried again, in Postwyre's words. Never the platform's raw text."},"publishedAt":{"type":["string","null"],"format":"date-time"},"removedAt":{"type":["string","null"],"format":"date-time","description":"When an owner or admin took this copy down from the platform (POST /api/posts/{postId}/remove). Null while it is live."},"comment":{"oneOf":[{"type":"object","description":"The first comment, with its own status: a failed comment never marks the post failed.","properties":{"text":{"type":"string"},"status":{"type":"string","enum":["waiting","sending","posted","failed"]},"dueAt":{"type":["string","null"],"format":"date-time","description":"When a waiting comment goes out."},"postedAt":{"type":["string","null"],"format":"date-time"},"url":{"type":["string","null"],"description":"The comment, or the post it is under, where the platform gives a link."},"errorMessage":{"type":["string","null"],"description":"Why it failed, or why the last try did while it waits for another."},"errorCode":{"type":["string","null"],"description":"post_id_unknown: the platform never named the post, so the comment cannot be retried."},"confirmToken":{"type":["string","null"],"description":"Set while a failed comment may already be on the post. Check it; only if the comment is missing, retry with this as confirmUnknownOutcome."}},"required":["text","status","dueAt","postedAt","url","errorMessage","errorCode","confirmToken"]},{"type":"null"}],"description":"Set once the post went out with a first comment; null otherwise."}},"required":["id","socialAccountId","platform","accountHandle","bodyOverride","postType","status","attempts","nextAttemptAt","platformPostUrl","errorCode","errorMessage","publishedAt","removedAt","comment"]},"Post":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","pending_approval","not_approved","scheduled","publishing","published","partial","failed"],"description":"partial: some accounts published and some failed."},"body":{"type":"string"},"platformOverrides":{"type":"object","propertyNames":{"type":"string","enum":["x","linkedin","instagram","facebook","threads","tiktok","youtube","bluesky","googlebusiness","pinterest","discord","telegram","whop","wordpress"]},"additionalProperties":{"type":"object","properties":{"body":{"type":"string","maxLength":5000},"options":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{}}}}},"scheduledAt":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"createdVia":{"type":"string","enum":["session","api_key"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"approval":{"oneOf":[{"$ref":"#/components/schemas/Approval"},{"type":"null"}],"description":"Null unless the post was created with requireApproval."},"repeat":{"oneOf":[{"$ref":"#/components/schemas/Repeat"},{"type":"null"}],"description":"Null unless the post repeats every few days."},"repeatOccurrences":{"type":"array","items":{"$ref":"#/components/schemas/RepeatOccurrence"},"description":"GET /api/posts/{postId} only, on a post that repeats: one entry per copy so far."}},"required":["id","status","body","platformOverrides","scheduledAt","media","createdVia","createdAt","updatedAt","deliveries","approval","repeat"]},"Repeat":{"type":"object","properties":{"everyDays":{"type":"integer"},"times":{"type":"integer","description":"Copies after the first post, at most 12."},"until":{"type":["string","null"],"format":"date-time"},"nextAt":{"type":["string","null"],"format":"date-time","description":"When the next copy goes out; null once it ended, or while the post is a draft."},"done":{"type":"integer","description":"Copies sent or skipped so far."},"endedAt":{"type":["string","null"],"format":"date-time"},"endedReason":{"type":["string","null"]}},"required":["everyDays","times","until","nextAt","done","endedAt","endedReason"]},"RepeatOccurrence":{"type":"object","properties":{"occurrence":{"type":"integer","description":"1 for the first copy."},"dueAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["sent","skipped"]},"copyPostId":{"type":["string","null"],"description":"The copy's own post."},"reason":{"type":["string","null"],"description":"Why it was skipped, or which accounts were left out."}},"required":["occurrence","dueAt","status","copyPostId","reason"]},"StatCounts":{"type":"object","properties":{"views":{"type":["integer","null"]},"likes":{"type":["integer","null"],"description":"On Facebook, every reaction."},"comments":{"type":["integer","null"]},"shares":{"type":["integer","null"],"description":"Shares, reposts or retweets."},"saves":{"type":["integer","null"]},"extras":{"type":"object","additionalProperties":{"type":"integer"},"description":"Counts only one platform has, such as Bluesky quotes."}},"required":["views","likes","comments","shares","saves","extras"]},"DeliveryStats":{"type":"object","description":"One account's result and its latest snapshot.","properties":{"deliveryId":{"type":"string"},"postId":{"type":"string"},"platform":{"type":"string"},"accountHandle":{"type":"string"},"platformPostUrl":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"postType":{"type":"string","enum":["text","image","images","video"]},"status":{"type":"string","enum":["ok","unavailable","waiting"],"description":"waiting: not read yet. unavailable: the platform gave no counts."},"snapshot":{"type":["string","null"],"enum":["1h","24h","7d","late",null],"description":"Which read this is: about 1 hour, 24 hours or 7 days after publishing, or late: one catch-up read 8 to 30 days after publishing when the 7-day read was missed."},"fetchedAt":{"type":["string","null"],"format":"date-time"},"errorCode":{"type":["string","null"],"description":"Why an unavailable snapshot has no counts."},"platformMessage":{"type":["string","null"],"description":"What the platform said when it refused the read (Facebook, Instagram and Threads), shortened, with anything that looks like a key or an email address taken out. Null when it said nothing."},"counts":{"oneOf":[{"$ref":"#/components/schemas/StatCounts"},{"type":"null"}]},"engagement":{"type":["integer","null"],"description":"likes + comments + shares + saves, leaving out any the platform does not give."},"reason":{"type":["string","null"],"description":"Why there are no counts, null when there are. The read's errorCode (for example postwyre_x_app: X stats are read only through a brand's own X app), or too_new (under an hour old), not_read_yet (due a read), no_reader (Postwyre reads no stats from this platform, for example Threads, LinkedIn and TikTok), stats_off (switched off on Postwyre) or missed (never read and now past 30 days)."},"sourceFields":{"type":"object","additionalProperties":{"type":"string"},"description":"The platform's own field behind each count, for example { \"views\": \"impression_count\" } on X. A view on X is an impression; do not add it to another platform's views without saying so."}},"required":["deliveryId","postId","platform","accountHandle","platformPostUrl","publishedAt","postType","status","snapshot","fetchedAt","errorCode","platformMessage","counts","engagement","reason","sourceFields"]},"ScoredDelivery":{"type":"object","properties":{"deliveryId":{"type":"string"},"postId":{"type":"string"},"platform":{"type":"string"},"accountHandle":{"type":"string"},"platformPostUrl":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"postType":{"type":"string","enum":["text","image","images","video"]},"status":{"type":"string","enum":["ok","unavailable","waiting"],"description":"waiting: not read yet. unavailable: the platform gave no counts."},"snapshot":{"type":["string","null"],"enum":["1h","24h","7d","late",null],"description":"Which read this is: about 1 hour, 24 hours or 7 days after publishing, or late: one catch-up read 8 to 30 days after publishing when the 7-day read was missed."},"fetchedAt":{"type":["string","null"],"format":"date-time"},"errorCode":{"type":["string","null"],"description":"Why an unavailable snapshot has no counts."},"platformMessage":{"type":["string","null"],"description":"What the platform said when it refused the read (Facebook, Instagram and Threads), shortened, with anything that looks like a key or an email address taken out. Null when it said nothing."},"counts":{"oneOf":[{"$ref":"#/components/schemas/StatCounts"},{"type":"null"}]},"engagement":{"type":["integer","null"],"description":"likes + comments + shares + saves, leaving out any the platform does not give."},"reason":{"type":["string","null"],"description":"Why there are no counts, null when there are. The read's errorCode (for example postwyre_x_app: X stats are read only through a brand's own X app), or too_new (under an hour old), not_read_yet (due a read), no_reader (Postwyre reads no stats from this platform, for example Threads, LinkedIn and TikTok), stats_off (switched off on Postwyre) or missed (never read and now past 30 days)."},"sourceFields":{"type":"object","additionalProperties":{"type":"string"},"description":"The platform's own field behind each count, for example { \"views\": \"impression_count\" } on X. A view on X is an impression; do not add it to another platform's views without saying so."},"excerpt":{"type":"string","description":"The text this account got, cut to 140 characters."},"hashtags":{"type":"array","items":{"type":"string"}},"score":{"type":["number","null"],"description":"engagement over median. 1 is a typical result for the brand."},"median":{"type":["number","null"],"description":"The brand's median engagement for this platform at this snapshot."},"medianOf":{"type":"integer","description":"How many results the median came from."}},"required":["deliveryId","postId","platform","accountHandle","platformPostUrl","publishedAt","postType","status","snapshot","fetchedAt","errorCode","platformMessage","counts","engagement","reason","sourceFields","excerpt","hashtags","score","median","medianOf"]},"StatsGroup":{"type":"object","properties":{"key":{"type":"string"},"posts":{"type":"integer"},"scored":{"type":"integer","description":"Results in the group with a score."},"averageScore":{"type":["number","null"]},"medianEngagement":{"type":["number","null"]}},"required":["key","posts","scored","averageScore","medianEngagement"]},"PostStats":{"type":"object","properties":{"postId":{"type":"string"},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryStats"}}},"required":["postId","deliveries"]},"StatTotals":{"type":"object","description":"Counts added up over the results that have them. Null when no result was given that count.","properties":{"views":{"type":["integer","null"]},"likes":{"type":["integer","null"]},"comments":{"type":["integer","null"]},"shares":{"type":["integer","null"]},"saves":{"type":["integer","null"]},"engagement":{"type":["integer","null"]}},"required":["views","likes","comments","shares","saves","engagement"]},"PlatformStats":{"type":"object","properties":{"key":{"type":"string"},"posts":{"type":"integer"},"scored":{"type":"integer","description":"Results in the group with a score."},"averageScore":{"type":["number","null"]},"medianEngagement":{"type":["number","null"]},"sent":{"type":"integer","description":"Results that went out in the window."},"failed":{"type":"integer","description":"Results that failed in the window."},"successRate":{"type":["number","null"],"description":"sent over sent plus failed, 0 to 1."},"totals":{"$ref":"#/components/schemas/StatTotals"},"viewsFrom":{"type":"integer","description":"How many of the platform's results read have a views count; totals.views adds up only these."}},"required":["key","posts","scored","averageScore","medianEngagement","sent","failed","successRate","totals","viewsFrom"]},"TimeSlot":{"type":"object","properties":{"key":{"type":"string"},"posts":{"type":"integer"},"scored":{"type":"integer","description":"Results in the group with a score."},"averageScore":{"type":["number","null"]},"medianEngagement":{"type":["number","null"]},"dayUtc":{"type":"integer","description":"0 is Sunday, in UTC."},"hourUtc":{"type":"integer","description":"0 to 23, in UTC."}},"required":["key","posts","scored","averageScore","medianEngagement","dayUtc","hourUtc"]},"StatsSummary":{"type":"object","properties":{"days":{"type":"integer","enum":[7,30,90]},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"baselineDays":{"type":"integer"},"published":{"type":"integer","description":"Results published in the window."},"read":{"type":"integer","description":"How many of the published results the rest of the summary is built from: the newest, up to a cap. Below published only for a brand sending thousands in the window."},"withStats":{"type":"integer","description":"Of those read, how many have counts. totals.views adds up each platform's views field as it is: X impressions and YouTube views together. Use byPlatform to keep them apart."},"noStats":{"type":"array","description":"The rest, by platform and the reason they have none (see reason on a delivery), most first.","items":{"type":"object","properties":{"platform":{"type":"string"},"reason":{"type":"string"},"posts":{"type":"integer"},"platformMessage":{"type":["string","null"],"description":"What the platform said, from the newest of these posts that has a message."}},"required":["platform","reason","posts","platformMessage"]}},"failed":{"type":"integer","description":"Results that failed in the window."},"successRate":{"type":["number","null"],"description":"published over published plus failed, 0 to 1. Null when nothing was tried."},"totals":{"$ref":"#/components/schemas/StatTotals"},"topPosts":{"type":"array","items":{"$ref":"#/components/schemas/ScoredDelivery"}},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/ScoredDelivery"}},"byPlatform":{"type":"array","items":{"$ref":"#/components/schemas/PlatformStats"}},"byPostType":{"type":"array","items":{"$ref":"#/components/schemas/StatsGroup"},"description":"key is text, image, images or video."},"byHashtag":{"type":"array","items":{"$ref":"#/components/schemas/StatsGroup"}},"byTimeUtc":{"type":"array","items":{"$ref":"#/components/schemas/TimeSlot"},"description":"The UTC hours of the week a result went out in."}},"required":["days","from","to","baselineDays","published","read","withStats","noStats","failed","successRate","totals","topPosts","deliveries","byPlatform","byPostType","byHashtag","byTimeUtc"]},"WeeklyReport":{"type":"object","properties":{"brandId":{"type":"string"},"brandName":{"type":"string"},"timeZone":{"type":"string","description":"The zone the week is read in."},"firstDay":{"type":"string","format":"date","description":"Last week's Monday."},"lastDay":{"type":"string","format":"date","description":"Last week's Sunday."},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"sent":{"type":"object","properties":{"now":{"type":"integer"},"before":{"type":"integer"},"percent":{"type":["integer","null"],"description":"Rounded change from before to now. Null when before is 0."}},"required":["now","before","percent"]},"failed":{"type":"object","properties":{"now":{"type":"integer"},"before":{"type":"integer"},"percent":{"type":["integer","null"],"description":"Rounded change from before to now. Null when before is 0."}},"required":["now","before","percent"]},"engagement":{"type":"object","properties":{"now":{"type":"integer"},"before":{"type":"integer"},"percent":{"type":["integer","null"],"description":"Rounded change from before to now. Null when before is 0."}},"required":["now","before","percent"]},"totals":{"$ref":"#/components/schemas/StatTotals"},"withStats":{"type":"integer","description":"Of last week's sent posts, how many have counts."},"topPosts":{"type":"array","items":{"type":"object","properties":{"postId":{"type":"string"},"platform":{"type":"string"},"accountHandle":{"type":"string"},"excerpt":{"type":"string"},"url":{"type":["string","null"]},"engagement":{"type":"integer"},"views":{"type":["integer","null"],"description":"The platform's own view count: impressions on X."}},"required":["postId","platform","accountHandle","excerpt","url","engagement","views"]}},"notMeasured":{"type":"array","description":"Sent posts with no counts, by platform and reason code (as noStats in the stats summary), most first.","items":{"type":"object","properties":{"platform":{"type":"string"},"reason":{"type":"string"},"posts":{"type":"integer"},"line":{"type":"string"}},"required":["platform","reason","posts","line"]}},"nextStep":{"type":"string"}},"required":["brandId","brandName","timeZone","firstDay","lastDay","from","to","sent","failed","engagement","totals","withStats","topPosts","notMeasured","nextStep"]},"Approval":{"type":"object","properties":{"status":{"type":"string","enum":["pending","approved","rejected","expired"],"description":"A pending link past its time reads as expired."},"action":{"type":"string","enum":["schedule","now","draft"],"description":"What approving does: schedule sends at the post's scheduledAt, now sends at once, draft (a review hold) queues it at scheduledAt when it has accounts and that time is ahead, otherwise keeps it a draft."},"expiresAt":{"type":"string","format":"date-time"},"decidedAt":{"type":["string","null"],"format":"date-time"},"reason":{"type":["string","null"],"description":"Why the person rejected it, when they wrote a reason."},"url":{"type":["string","null"],"description":"The link to send a person, while the approval can still be decided."},"qualityBar":{"oneOf":[{"type":"object","properties":{"selfReview":{"type":["object","null"],"description":"The selfReview sent with the post, as sent.","properties":{"verdict":{"type":"string","enum":["pass","fail"]},"reasons":{"type":"array","items":{"type":"string"}}}},"outcome":{"type":["string","null"],"enum":["approved","held"],"description":"approved: the quality bar sent it on its own; held: it ran and the post waits for a person; null: it has not run."},"checks":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"passed":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["check","passed","reason"]}},"reasons":{"type":"array","items":{"type":"string"},"description":"Why it waits, one sentence per failed check."},"checkedAt":{"type":["string","null"],"format":"date-time"}},"required":["selfReview","outcome","checks","reasons","checkedAt"]},{"type":"null"}],"description":"What the brand's quality bar found (GET /api/workspaces/current/quality-bar). Null when no selfReview came and the bar never ran."}},"required":["status","action","expiresAt","decidedAt","reason","url","qualityBar"]},"EngageItem":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"kind":{"type":"string","enum":["comment","reply","mention","review"]},"account":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"}},"required":["id","handle"]},"author":{"type":"object","properties":{"handle":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["handle","name"]},"text":{"type":"string"},"permalink":{"type":["string","null"]},"postId":{"type":["string","null"],"description":"The Postwyre post it was left on, when it was sent through Postwyre."},"platformPostId":{"type":["string","null"]},"postedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["open","done"]},"assignee":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"reply":{"oneOf":[{"type":"object","properties":{"text":{"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["text","at"]},{"type":"null"}]},"rating":{"type":["integer","null"],"description":"Stars, 1 to 5, on a review; null otherwise."},"draft":{"oneOf":[{"type":"object","properties":{"text":{"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["text","at"]},{"type":"null"}],"description":"An agent's reply to a review, waiting for a person to approve."}},"required":["id","platform","kind","account","author","text","permalink","postId","platformPostId","postedAt","status","assignee","reply","rating","draft"]},"ReviewRequest":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"location":{"type":"string"},"email":{"type":["string","null"],"description":"Null once the request has ended."},"firstName":{"type":["string","null"]},"status":{"type":"string","enum":["awaiting_approval","queued","sent","done","failed"]},"endReason":{"type":["string","null"],"enum":["reviewed","stopped","opted_out","declined","expired",null]},"requestedBy":{"type":"string","enum":["person","agent"]},"createdAt":{"type":"string","format":"date-time"},"approvedAt":{"type":["string","null"],"format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"},"followUpDueAt":{"type":["string","null"],"format":"date-time"},"followUpSentAt":{"type":["string","null"],"format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"failure":{"type":["string","null"],"description":"Why it was not sent."}},"required":["id","accountId","location","email","firstName","status","endReason","requestedBy","createdAt","approvedAt","sentAt","followUpDueAt","followUpSentAt","endedAt","failure"]},"ReviewRequestSettings":{"type":"object","properties":{"followUpDays":{"type":"integer"},"agentApprovedAt":{"type":["string","null"],"format":"date-time"},"agentApprovedBy":{"type":["string","null"]},"locations":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"handle":{"type":"string"},"reviewUrl":{"type":["string","null"]},"status":{"type":"string","enum":["active","needs_reconnect","disconnected"],"description":"The Google connection. needs_reconnect: requests still send, but no reviews are read, so none can end a request. disconnected: listed while its link is saved; no new request can name it, requests already made still send, and its link can only be removed."}},"required":["accountId","handle","reviewUrl","status"]}}},"required":["followUpDays","agentApprovedAt","agentApprovedBy","locations"]},"ReviewAutopilot":{"type":"object","properties":{"accountId":{"type":"string"},"handle":{"type":"string"},"on":{"type":"boolean"},"consentedBy":{"type":["string","null"],"description":"Who turned it on."},"consentedAt":{"type":["string","null"],"format":"date-time"}},"required":["accountId","handle","on","consentedBy","consentedAt"]},"EngageProblem":{"type":"object","description":"An account that could not be read at the last try, and why.","properties":{"accountId":{"type":"string"},"handle":{"type":"string"},"platform":{"type":"string"},"code":{"type":"string"}},"required":["accountId","handle","platform","code"]},"EngageRule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"accountId":{"type":["string","null"]},"platformPostId":{"type":["string","null"]},"keyword":{"type":"string"},"publicReply":{"type":["string","null"],"description":"A public reply posted under the comment; null for none."},"dmText":{"type":"string"},"dmLink":{"type":["string","null"]},"optOutKeyword":{"type":["string","null"]},"newsletterSignup":{"type":"boolean","description":"The message also carries the newsletter signup link."},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","accountId","platformPostId","keyword","publicReply","dmText","dmLink","optOutKeyword","newsletterSignup","enabled","createdAt"]},"EngageDm":{"type":"object","properties":{"id":{"type":"string"},"ruleId":{"type":"string"},"platform":{"type":"string"},"recipient":{"type":"object","properties":{"handle":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["handle","name"]},"comment":{"type":["string","null"]},"status":{"type":"string","enum":["pending","sent","failed","skipped"]},"reason":{"type":["string","null"],"description":"Why a DM failed or was skipped."},"at":{"type":"string","format":"date-time"}},"required":["id","ruleId","platform","recipient","comment","status","reason","at"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["post.published","post.failed","post.approval_requested"]}},"createdAt":{"type":"string","format":"date-time"},"lastAttemptAt":{"type":["string","null"],"format":"date-time"},"lastStatusCode":{"type":["integer","null"]},"lastError":{"type":["string","null"]},"lastSuccessAt":{"type":["string","null"],"format":"date-time"}},"required":["id","url","events","createdAt","lastAttemptAt","lastStatusCode","lastError","lastSuccessAt"]},"TikTokCreatorInfo":{"type":"object","properties":{"nickname":{"type":"string"},"username":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"privacyLevelOptions":{"type":"array","items":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]}},"commentDisabled":{"type":"boolean"},"duetDisabled":{"type":"boolean"},"stitchDisabled":{"type":"boolean"},"maxVideoSeconds":{"type":["integer","null"]},"cannotPost":{"type":["string","null"],"description":"Null when TikTok will take a post; otherwise why not."}},"required":["nickname","username","avatarUrl","privacyLevelOptions","commentDisabled","duetDisabled","stitchDisabled","maxVideoSeconds","cannotPost"]}}}}