{"openapi":"3.0.3","info":{"title":"BrandMochi API","version":"1.0.0","description":"Customer-scoped BrandMochi workspace automation with additive operator operations."},"servers":[{"url":"http://brandmochi.com"}],"tags":[{"name":"Workspaces","description":"The signed-in customer's teams, brands, roles, and permissions."},{"name":"Actions","description":"Customer work queues and action transitions."},{"name":"Leads","description":"Customer lead discovery, evidence, status, and contact activity."},{"name":"Operations","description":"Operator health, schedules, jobs, and audit events."},{"name":"Outreach","description":"Campaign, delivery, open, and personalization reporting."},{"name":"Articles","description":"Operator article publishing and media."}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"http://brandmochi.com/authorize","tokenUrl":"http://brandmochi.com/token","refreshUrl":"http://brandmochi.com/token","scopes":{"mcp:read":"Read authorized BrandMochi customer data.","mcp:write":"Update authorized customer data or run operator actions."}}}},"adminToken":{"type":"http","scheme":"bearer","description":"Operator automation token. OAuth is preferred for user-authorized clients."}},"schemas":{"Error":{"type":"object","required":["error","meta"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}},"meta":{"$ref":"#/components/schemas/ApiMeta"}}},"ApiMeta":{"type":"object","required":["requestId","generatedAt"],"properties":{"requestId":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"}}}}},"paths":{"/api/v1/me/workspaces":{"get":{"operationId":"listMyWorkspaces","summary":"List my workspaces","description":"List the teams and brands the signed-in customer can access, including role and permissions.","tags":["Workspaces"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions":{"get":{"operationId":"listBrandActions","summary":"List brand actions","description":"List the open work queue for a customer brand.","tags":["Actions"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["social","competitor","trademark","domain","lead","configuration"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createManualBrandAction","summary":"Create a brand action","description":"Add a social or domain action to an authorized customer brand.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["social","domain"]},"sourceUrl":{"type":"string","minLength":1,"maxLength":2000},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"completed":{"type":"boolean","default":false}},"required":["teamId","brandId","kind","sourceUrl"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions/{actionId}/reserve":{"post":{"operationId":"reserveBrandAction","summary":"Reserve a brand action","description":"Reserve an open customer action for the signed-in user.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"actionId","in":"path","required":true,"description":"actionId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions/{actionId}/transition":{"post":{"operationId":"transitionBrandAction","summary":"Update a brand action","description":"Complete, release, or archive an authorized customer action.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"actionId","in":"path","required":true,"description":"actionId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"actionId":{"type":"string","minLength":1,"maxLength":200},"transition":{"type":"string","enum":["complete","release","archive"]},"reservationVersion":{"type":"integer","minimum":0}},"required":["teamId","brandId","actionId","transition"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions/{actionId}":{"get":{"operationId":"getBrandAction","summary":"Read a brand action","description":"Read an action, source evidence, suggested copy, workflow, feedback history, notes, and events, including completed or archived actions.","tags":["Actions"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"actionId","in":"path","required":true,"description":"actionId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions/{actionId}/feedback":{"post":{"operationId":"recordBrandActionFeedback","summary":"Record action feedback","description":"Record a match label and optional note without completing or archiving the action. Notes attached to feedback are limited to 300 characters.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"actionId","in":"path","required":true,"description":"actionId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"actionId":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","enum":["useful","irrelevant","duplicate","already_handled"]},"note":{"type":"string","maxLength":300}},"required":["teamId","brandId","actionId","label"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions/{actionId}/notes":{"post":{"operationId":"addBrandActionNote","summary":"Add an action note","description":"Append an operational note without changing feedback labels, reservation, or action status. Allows 1 to 2000 characters and supports closed actions.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"actionId","in":"path","required":true,"description":"actionId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"actionId":{"type":"string","minLength":1,"maxLength":200},"note":{"type":"string","minLength":1,"maxLength":2000}},"required":["teamId","brandId","actionId","note"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/actions/{actionId}/official-social-outcome":{"post":{"operationId":"resolveBrandOfficialSocialReminder","summary":"Record an official-post suggestion outcome","description":"Record used_suggestion, did_not_use, or not_useful for an official social reminder using the website's outcome workflow. Requires brand management permission; does not publish to a social network.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"actionId","in":"path","required":true,"description":"actionId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"actionId":{"type":"string","minLength":1,"maxLength":200},"outcome":{"type":"string","enum":["used_suggestion","did_not_use","not_useful"]}},"required":["teamId","brandId","actionId","outcome"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/official-social/{platform}/posts":{"post":{"operationId":"recordBrandOfficialSocialPost","summary":"Record an official social post","description":"Record that a post was already published on a connected official account and advance its check cadence. Requires brand management permission; does not publish to a social network.","tags":["Actions"],"security":[{"oauth2":["mcp:write"]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"platform","in":"path","required":true,"description":"platform","schema":{"type":"string","enum":["x","facebook","linkedin"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads/tags":{"get":{"operationId":"listBrandLeadTags","summary":"List brand lead tags","description":"List customer-visible lead sources and segments for an authorized brand.","tags":["Leads"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads/tags/{tagId}/assignments":{"post":{"operationId":"assignBrandLeadsToTag","summary":"Assign brand leads to a tag","description":"Add authorized brand leads to a customer-visible source or campaign segment with an audit reason.","tags":["Leads"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"tagId","in":"path","required":true,"description":"tagId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"tagId":{"type":"string","minLength":1,"maxLength":200},"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["teamId","brandId","tagId","leadIds","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads/enrich/apollo":{"post":{"operationId":"enrichBrandLeadsWithApollo","summary":"Enrich brand leads with Apollo","description":"Queue work-email, role, company, and LinkedIn enrichment for authorized brand leads.","tags":["Leads"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["teamId","brandId","leadIds","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads":{"get":{"operationId":"listBrandLeads","summary":"List brand leads","description":"List prospective customers and lead summary data for an authorized brand.","tags":["Leads"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["all","new","contacted","dismissed"],"default":"all"}},{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["all","email","phone","linkedin","x","facebook","instagram","reddit"],"default":"all"}},{"name":"contactability","in":"query","required":false,"schema":{"type":"string","enum":["all","email","phone","social","none"],"default":"all"}},{"name":"activity","in":"query","required":false,"schema":{"type":"string","enum":["all","never_contacted","contacted_once","contacted_multiple"],"default":"all"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000,"default":0}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads/{leadId}":{"get":{"operationId":"getBrandLead","summary":"Get a brand lead","description":"Read one prospective customer with contact methods, evidence, and activity.","tags":["Leads"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"leadId","in":"path","required":true,"description":"leadId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads/{leadId}/status":{"post":{"operationId":"updateBrandLeadStatus","summary":"Update lead status","description":"Mark a customer lead new, contacted, or dismissed using the same workflow as the BrandMochi app.","tags":["Leads"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"leadId","in":"path","required":true,"description":"leadId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"leadId":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["new","contacted","dismissed"]},"channel":{"type":"string","enum":["email","phone","linkedin","x","facebook","instagram","reddit"]},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["teamId","brandId","leadId","status"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/leads/{leadId}/contacts":{"post":{"operationId":"recordBrandLeadContact","summary":"Record lead contact","description":"Log a customer contact event and mark the lead contacted.","tags":["Leads"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"leadId","in":"path","required":true,"description":"leadId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"leadId":{"type":"string","minLength":1,"maxLength":200},"channel":{"type":"string","enum":["email","phone","linkedin","x","facebook","instagram","reddit"]},"detail":{"type":"string","maxLength":1000,"default":""}},"required":["teamId","brandId","leadId","channel"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/outreach/mailbox":{"post":{"operationId":"configureExternalMail","summary":"Connect outreach mailbox","description":"Verify and save encrypted SMTP and IMAP credentials for a customer-owned outreach mailbox.","tags":["Outreach"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"smtpHost":{"type":"string","minLength":1,"maxLength":253},"smtpPort":{"type":"integer"},"imapHost":{"type":"string","minLength":1,"maxLength":253},"username":{"type":"string","format":"email"},"password":{"type":"string","maxLength":1024}},"required":["teamId","brandId","smtpHost","smtpPort","imapHost","username","password"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/outreach/campaigns":{"get":{"operationId":"listOutreachCampaigns","summary":"List outreach campaigns","description":"List outreach campaigns and aggregate delivery, failure, and open counts for an authorized brand.","tags":["Outreach"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","live","paused"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/outreach/campaigns/{campaignId}":{"get":{"operationId":"getOutreachCampaign","summary":"Get outreach campaign","description":"Read one campaign, its sequence, targeting tags, personalization state, and aggregate results.","tags":["Outreach"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"campaignId","in":"path","required":true,"description":"campaignId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/outreach/campaigns/{campaignId}/deliveries":{"get":{"operationId":"listOutreachDeliveries","summary":"List outreach deliveries","description":"List recipient-level delivery, open, lead, and personalization evidence for a campaign.","tags":["Outreach"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"campaignId","in":"path","required":true,"description":"campaignId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","sent","delivered","bounced","complained","unsubscribed","failed"]}},{"name":"opened","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":250,"default":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{teamId}/brands/{brandId}/outreach/campaigns/{campaignId}/state":{"post":{"operationId":"changeOutreachCampaignState","summary":"Activate or pause outreach","description":"Activate or pause a ready outreach campaign for an authorized customer brand.","tags":["Outreach"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"path","required":true,"description":"teamId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"path","required":true,"description":"brandId","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"campaignId","in":"path","required":true,"description":"campaignId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"campaignId":{"type":"string","minLength":1,"maxLength":200},"action":{"type":"string","enum":["activate","pause"]}},"required":["teamId","brandId","campaignId","action"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/leads/restore":{"post":{"operationId":"restoreAdminBrandLeads","summary":"Restore brand leads","description":"Restore archived leads through the shared lead workflow and retain the reason on each lead event.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["teamId","brandId","leadIds","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/leads/tag":{"post":{"operationId":"tagAdminBrandLeads","summary":"Assign a lead segment","description":"Assign brand leads to a customer-visible tag through the shared lead workflow.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"tagId":{"type":"string","minLength":1,"maxLength":200},"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["teamId","brandId","tagId","leadIds","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/leads/enrich/apollo":{"post":{"operationId":"enrichAdminBrandLeadsWithApollo","summary":"Enrich brand leads with Apollo","description":"Queue bounded Apollo enrichment through the shared BrandMochi lead workflow.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["teamId","brandId","leadIds","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/lead-research-queues":{"get":{"operationId":"listAdminLeadResearchQueues","summary":"List lead research queues","description":"List a brand's lead research targeting for operator maintenance.","tags":["Operations"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"teamId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"brandId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/lead-research-queues/{queueId}":{"post":{"operationId":"updateAdminLeadResearchQueue","summary":"Update lead research queue","description":"Update a brand's lead research targeting with an operator audit reason.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"queueId","in":"path","required":true,"description":"queueId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"queueId":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","minLength":2,"maxLength":80},"idealCustomer":{"type":"string","minLength":20,"maxLength":1500},"researchGuidance":{"type":"string","maxLength":3000},"geography":{"type":"string","maxLength":240,"default":""},"enabled":{"type":"boolean","default":true},"linkedInWarmLeadsEnabled":{"type":"boolean","default":false},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["teamId","brandId","queueId","name","idealCustomer","researchGuidance","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/leads/archive":{"post":{"operationId":"archiveAdminBrandLeads","summary":"Archive brand leads","description":"Archive out-of-scope leads through the shared lead workflow and retain the reason on each lead event.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["teamId","brandId","leadIds","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/outreach/campaigns/{campaignId}/subject":{"post":{"operationId":"updateAdminOutreachCampaignSubject","summary":"Update outreach campaign subject","description":"Update the initial campaign subject template and any unattempted queued deliveries.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"description":"campaignId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","minLength":1,"maxLength":200},"brandId":{"type":"string","minLength":1,"maxLength":200},"campaignId":{"type":"string","minLength":1,"maxLength":200},"subjectTemplate":{"type":"string","minLength":2,"maxLength":240},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["teamId","brandId","campaignId","subjectTemplate","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/health":{"get":{"operationId":"getAdminOpsHealth","summary":"Get operations health","description":"Read BrandMochi operational health signals and source freshness.","tags":["Operations"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/schedules":{"get":{"operationId":"listAdminOpsSchedules","summary":"List monitor schedules","description":"List BrandMochi monitor and source schedules with state filters.","tags":["Operations"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","disabled","all"],"default":"active"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"team","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"brand","in":"query","required":false,"schema":{"type":"string","maxLength":500}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/jobs":{"get":{"operationId":"listAdminOpsJobs","summary":"List durable jobs","description":"List BrandMochi durable jobs with operational filters.","tags":["Operations"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","succeeded","failed","stopping","stopped"]}},{"name":"type","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"team","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"brand","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"since","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/jobs/{jobId}":{"get":{"operationId":"getAdminOpsJob","summary":"Get durable job","description":"Read a durable job and its child jobs.","tags":["Operations"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"description":"jobId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/events":{"get":{"operationId":"listAdminOpsEvents","summary":"List operations events","description":"List audited BrandMochi operations events.","tags":["Operations"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"level","in":"query","required":false,"schema":{"type":"string","enum":["debug","info","warn","error"]}},{"name":"workflow","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"job","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"team","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"brand","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"source","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"target","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"since","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/monitor-runs":{"post":{"operationId":"createAdminMonitorRun","summary":"Start monitor run","description":"Queue a scoped BrandMochi monitor run with an audit reason.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"monitorType":{"type":"string","enum":["social","competitor","trademark","domain","visibility"]},"scope":{"type":"string","enum":["brand","team","all"]},"teamId":{"type":"string","minLength":1},"brandId":{"type":"string","minLength":1},"reason":{"type":"string","minLength":8,"maxLength":500}},"required":["monitorType","scope","reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/uspto-runs":{"post":{"operationId":"createAdminUsptoRun","summary":"Start USPTO collection","description":"Queue a USPTO collection or recompaction run with an audit reason.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxReleases":{"type":"integer","minimum":1,"maximum":64},"recompactSearch":{"type":"boolean"},"recompactDesigns":{"type":"boolean"},"reason":{"type":"string","minLength":8,"maxLength":500}},"required":["reason"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/ops/jobs/{jobId}/actions":{"post":{"operationId":"createAdminJobAction","summary":"Operate durable job","description":"Stop, retry, replay, or release a durable job with an audit reason.","tags":["Operations"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"description":"jobId","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"jobId":{"type":"string","minLength":1,"maxLength":200}},"required":["jobId"]},{"type":"object","properties":{"action":{"type":"string","enum":["stop","retry","replay","release"]},"reason":{"type":"string","minLength":8,"maxLength":500}},"required":["action","reason"]}],"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/articles":{"get":{"operationId":"listAdminArticles","summary":"List articles","description":"List operator article drafts and publication versions.","tags":["Articles"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAdminArticle","summary":"Create article draft","description":"Create an audited draft using the existing D1 and R2 article lifecycle. Reconcile by slug before retrying.","tags":["Articles"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operatorEmail":{"type":"string","format":"email"},"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":3,"maxLength":100},"authorName":{"type":"string","minLength":1,"maxLength":120}},"required":["title","slug","authorName"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/articles/{articleId}":{"get":{"operationId":"getAdminArticle","summary":"Read article","description":"Read an operator article and its complete stored body.","tags":["Articles"],"security":[{"oauth2":["mcp:read"]},{"adminToken":[]}],"parameters":[{"name":"articleId","in":"path","required":true,"description":"articleId","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"saveAdminArticle","summary":"Save or publish article","description":"Validate editor fields and save, publish, or schedule with optimistic concurrency, immutable bodies, and audit events. OAuth public writes require recent authentication; machine writes use the operator automation token.","tags":["Articles"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"articleId","in":"path","required":true,"description":"articleId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operatorEmail":{"type":"string","format":"email"},"articleId":{"type":"string","minLength":1,"maxLength":200},"expectedVersion":{"type":"integer","exclusiveMinimum":0},"action":{"type":"string","enum":["save","publish","schedule"]},"fields":{"type":"object","additionalProperties":{"type":"string","maxLength":500000}}},"required":["articleId","expectedVersion","action","fields"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/articles/{articleId}/media":{"post":{"operationId":"uploadAdminArticleMedia","summary":"Upload article image","description":"Upload base64 image bytes through the verified, immutable article media workflow (10 MiB maximum). Returns the media URL; save it on the article separately.","tags":["Articles"],"security":[{"oauth2":["mcp:write"]},{"adminToken":[]}],"parameters":[{"name":"articleId","in":"path","required":true,"description":"articleId","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operatorEmail":{"type":"string","format":"email"},"articleId":{"type":"string","minLength":1,"maxLength":200},"filename":{"type":"string","minLength":1,"maxLength":200},"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif"]},"base64":{"type":"string","minLength":4,"maxLength":13981016}},"required":["articleId","filename","contentType","base64"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{},"meta":{"$ref":"#/components/schemas/ApiMeta"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}