{"openapi":"3.1.0","info":{"title":"Postlore Agent API","version":"1.0.0","description":"The same tools as Postlore's MCP server (https://api.postlore.com/mcp), over plain HTTP. Each call acts as the user who created the key or approved the connection, within their plan. Guide and examples: https://postlore.com/developers"},"servers":[{"url":"https://api.postlore.com"}],"security":[{"apiKey":[]},{"oauth2":[]}],"paths":{"/v1/tools":{"get":{"operationId":"listTools","summary":"List the tools this key or connection can use","responses":{"200":{"description":"Tools, with their input JSON Schemas","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/list_workspaces":{"post":{"operationId":"list_workspaces","summary":"List workspaces","description":"List the Postlore workspaces (brands) this key can use: connected platforms, plan, posts left this month, whether scheduling is available, timezone, and whether posts need approval.\n\nRequires: workspace:read.","tags":["read"],"x-required-scopes":["workspace:read"],"security":[{"apiKey":[]},{"oauth2":["workspace:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/get_brand_voice":{"post":{"operationId":"get_brand_voice","summary":"Get brand voice","description":"Get the workspace's brand voice as sections (about, tone, target audience, key messages, do's, don'ts) plus the full text. Postlore's own drafting tools already apply it; read it if you are writing copy yourself.\n\nRequires: workspace:read.","tags":["read"],"x-required-scopes":["workspace:read"],"security":[{"apiKey":[]},{"oauth2":["workspace:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/check_calendar":{"post":{"operationId":"check_calendar","summary":"Check calendar","description":"Start here. Finds this workspace's proven best posting slots in the coming days that have nothing scheduled, and how long since the last post. Returns concrete gaps to fill.\n\nRequires: workspace:read, insights:read.","tags":["read"],"x-required-scopes":["workspace:read","insights:read"],"security":[{"apiKey":[]},{"oauth2":["workspace:read","insights:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"days":{"type":"integer","minimum":1,"maximum":14,"default":7,"description":"How many days ahead to check."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/get_performance_context":{"post":{"operationId":"get_performance_context","summary":"Get performance context","description":"What has worked for this account: best posting hours (0-23) and days per platform in the workspace's timezone, top hashtags, best caption length and media type, and how confident the data is.\n\nRequires: insights:read.","tags":["read"],"x-required-scopes":["insights:read"],"security":[{"apiKey":[]},{"oauth2":["insights:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/list_posts":{"post":{"operationId":"list_posts","summary":"List posts","description":"List posts in a workspace, newest first, with analytics for published ones. Filter by status, platform or date range.\n\nRequires: workspace:read.","tags":["read"],"x-required-scopes":["workspace:read"],"security":[{"apiKey":[]},{"oauth2":["workspace:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"status":{"type":"string","enum":["draft","scheduled","published","failed","pending_approval"]},"platform":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"from":{"type":"string","format":"date-time","description":"Only posts scheduled or published at or after this time."},"to":{"type":"string","format":"date-time","description":"Only posts scheduled or published before this time."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/list_top_posts":{"post":{"operationId":"list_top_posts","summary":"List top posts","description":"This account's best-performing posts from more than 30 days ago, by 7-day engagement. Good material to recycle or remix.\n\nRequires: insights:read.","tags":["read"],"x-required-scopes":["insights:read"],"security":[{"apiKey":[]},{"oauth2":["insights:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/generate_ideas":{"post":{"operationId":"generate_ideas","summary":"Generate post ideas","description":"Post ideas in the workspace's brand voice, grounded in what has performed for it, plus local news, events and trends. Uses the account's AI allowance.\n\nRequires: drafts:write.","tags":["write"],"x-required-scopes":["drafts:write"],"security":[{"apiKey":[]},{"oauth2":["drafts:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"topic":{"type":"string","maxLength":200,"description":"Optional theme. Leave out for ideas based on performance and current events."},"platforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"minItems":1,"description":"Target platforms."},"count":{"type":"integer","minimum":1,"maximum":10,"default":5},"goal":{"type":"string","enum":["awareness","reach","conversation","sales"],"description":"What the post is for. Changes how drafts are written and scored."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/adapt_for_platforms":{"post":{"operationId":"adapt_for_platforms","summary":"Adapt for platforms","description":"Rewrite one piece of content as a native post for each platform, in the workspace's brand voice. Uses the account's AI allowance.\n\nRequires: drafts:write.","tags":["write"],"x-required-scopes":["drafts:write"],"security":[{"apiKey":[]},{"oauth2":["drafts:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"content":{"type":"string","minLength":1,"maxLength":5000},"platforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"minItems":1,"description":"Target platforms."},"goal":{"type":"string","enum":["awareness","reach","conversation","sales"],"description":"What the post is for. Changes how drafts are written and scored."}},"required":["content","platforms"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/generate_hashtags":{"post":{"operationId":"generate_hashtags","summary":"Generate hashtags","description":"Hashtags for a post on one platform, mixing proven ones for this account with market-specific and trending ones. Uses the account's AI allowance.\n\nRequires: drafts:write.","tags":["write"],"x-required-scopes":["drafts:write"],"security":[{"apiKey":[]},{"oauth2":["drafts:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"content":{"type":"string","minLength":1,"maxLength":5000},"platform":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"market":{"type":"string","maxLength":100,"description":"Market or city to target, e.g. \"Accra\". Defaults to global."}},"required":["content","platform"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/score_draft":{"post":{"operationId":"score_draft","summary":"Score draft","description":"Score a draft 0-100 against this account's winning patterns (caption length, media, posting slot, hashtags, goal) and get the specific fixes. Slot times in fixes are in the workspace's timezone. Instant and free; no AI allowance used.\n\nRequires: insights:read.","tags":["read"],"x-required-scopes":["insights:read"],"security":[{"apiKey":[]},{"oauth2":["insights:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"content":{"type":"string","minLength":1,"maxLength":5000},"platforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"minItems":1,"description":"Target platforms."},"scheduled_at":{"type":"string","format":"date-time","description":"Planned time, if any. Checked against the best slots."},"media_types":{"type":"array","items":{"type":"string","enum":["image","video"]},"description":"Media attached to the post."},"goal":{"type":"string","enum":["awareness","reach","conversation","sales"],"description":"What the post is for. Changes how drafts are written and scored."}},"required":["content","platforms"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/coach_draft":{"post":{"operationId":"coach_draft","summary":"Coach draft","description":"Written coaching on a draft from an editor who knows this account's results. Slower than score_draft and uses the AI allowance; use it when the score alone isn't enough.\n\nRequires: drafts:write.","tags":["write"],"x-required-scopes":["drafts:write"],"security":[{"apiKey":[]},{"oauth2":["drafts:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"content":{"type":"string","minLength":1,"maxLength":5000},"platforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"minItems":1,"description":"Target platforms."},"goal":{"type":"string","enum":["awareness","reach","conversation","sales"],"description":"What the post is for. Changes how drafts are written and scored."}},"required":["content","platforms"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/create_draft":{"post":{"operationId":"create_draft","summary":"Create draft","description":"Save a post as a draft in Postlore. Nothing is published. Returns a compose_url where the user can review it.\n\nRequires: drafts:write.","tags":["write"],"x-required-scopes":["drafts:write"],"security":[{"apiKey":[]},{"oauth2":["drafts:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"content":{"type":"string","minLength":1,"maxLength":5000,"description":"Default text, used on any platform without its own version."},"platforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"minItems":1,"description":"Target platforms."},"content_by_platform":{"type":"object","additionalProperties":{"type":"string","maxLength":5000},"propertyNames":{"enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"description":"Per-platform text, e.g. from adapt_for_platforms."},"title":{"type":"string","maxLength":100},"hashtags":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":30},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Public HTTPS URLs of images or videos."},"goal":{"type":"string","enum":["awareness","reach","conversation","sales"],"description":"What the post is for. Changes how drafts are written and scored."},"idempotency_key":{"type":"string","minLength":8,"maxLength":100,"description":"Any unique string. Retrying with the same key returns the first result instead of acting twice."}},"required":["content","platforms"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/update_draft":{"post":{"operationId":"update_draft","summary":"Update draft","description":"Edit a draft's text, platforms, hashtags, media or goal. Does not schedule or publish. Editing a post that is already scheduled or in review needs the posts:schedule scope (and posts:publish if it publishes within 15 minutes).\n\nRequires: drafts:write.","tags":["write"],"x-required-scopes":["drafts:write"],"security":[{"apiKey":[]},{"oauth2":["drafts:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string","format":"uuid"},"content":{"type":"string","minLength":1,"maxLength":5000},"platforms":{"type":"array","items":{"type":"string","enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]},"minItems":1,"description":"Target platforms."},"content_by_platform":{"type":"object","additionalProperties":{"type":"string","maxLength":5000},"propertyNames":{"enum":["facebook","instagram","tiktok","twitter","linkedin","youtube","googlebusiness","telegram","pinterest","threads","reddit","bluesky"]}},"title":{"type":"string","maxLength":100},"hashtags":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":30},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"goal":{"anyOf":[{"type":"string","enum":["awareness","reach","conversation","sales"]},{"type":"null"}]}},"required":["post_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/schedule_post":{"post":{"operationId":"schedule_post","summary":"Schedule post","description":"Schedule a draft to publish at a set time (at least 15 minutes ahead unless the key can publish immediately). Requires a paid plan.\n\nRequires: posts:schedule.","tags":["write"],"x-required-scopes":["posts:schedule"],"security":[{"apiKey":[]},{"oauth2":["posts:schedule"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string","format":"uuid"},"scheduled_at":{"type":"string","format":"date-time","description":"When to publish, as an ISO 8601 timestamp with timezone."},"idempotency_key":{"type":"string","minLength":8,"maxLength":100,"description":"Any unique string. Retrying with the same key returns the first result instead of acting twice."}},"required":["post_id","scheduled_at"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/publish_post":{"post":{"operationId":"publish_post","summary":"Publish post","description":"Publish a post to its platforms now. This posts publicly on the connected accounts. If the workspace requires approval for your role, it is sent for review instead.\n\nRequires: posts:publish.","tags":["publish"],"x-required-scopes":["posts:publish"],"security":[{"apiKey":[]},{"oauth2":["posts:publish"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string","format":"uuid"},"idempotency_key":{"type":"string","minLength":8,"maxLength":100,"description":"Any unique string. Retrying with the same key returns the first result instead of acting twice."}},"required":["post_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/get_autopilot":{"post":{"operationId":"get_autopilot","summary":"Get Autopilot settings","description":"Autopilot drafts posts automatically so an account never goes quiet. Shows whether it is on, its schedule (days 0=Sunday..6, time in the workspace's timezone), and whether it publishes without review.\n\nRequires: workspace:read.","tags":["read"],"x-required-scopes":["workspace:read"],"security":[{"apiKey":[]},{"oauth2":["workspace:read"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tools/set_autopilot":{"post":{"operationId":"set_autopilot","summary":"Set Autopilot settings","description":"Turn Autopilot on or off and set its schedule. cadence_days (0=Sunday..6) and cadence_time (HH:MM, workspace timezone) set fixed delivery; leave cadence_days null to draft only after idle_days without posts. auto_publish needs the posts:publish scope. Owner only; Starter plan and above.\n\nRequires: autopilot:write.","tags":["write"],"x-required-scopes":["autopilot:write"],"security":[{"apiKey":[]},{"oauth2":["autopilot:write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid","description":"Workspace to act on. Optional if the key is limited to one workspace or the account has only one."},"enabled":{"type":"boolean"},"idle_days":{"type":"integer","minimum":1,"maximum":30},"cadence_days":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7},{"type":"null"}]},"cadence_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"auto_publish":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"400":{"description":"Invalid arguments, or workspace_id needed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope, plan feature, or not allowed (see error.code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or this key cannot use the tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same idempotency_key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Publishing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable code, e.g. insufficient_scope, schedule_too_soon, plan_required."},"message":{"type":"string"}}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key (pl_live_…) from Settings → Agents."},"oauth2":{"type":"oauth2","description":"Authorization code with PKCE (S256). Supports Client ID Metadata Documents and Dynamic Client Registration.","flows":{"authorizationCode":{"authorizationUrl":"https://api.postlore.com/oauth/authorize","tokenUrl":"https://api.postlore.com/oauth/token","refreshUrl":"https://api.postlore.com/oauth/token","scopes":{"workspace:read":"workspace:read","insights:read":"insights:read","drafts:write":"drafts:write","posts:schedule":"posts:schedule","posts:publish":"posts:publish","autopilot:write":"autopilot:write"}}}}}}}