{"openapi":"3.1.0","info":{"title":"Rolebooks Org Chart Rendering API","version":"1.0.0","description":"Render a US Letter PNG preview without storing the chart or sending email. Send role titles, not employee names. Limits: 40 roles, 24 KiB JSON, approximately 5 renders per minute per IP per Cloudflare location (shared with MCP)."},"servers":[{"url":"https://charts.getrolebooks.com"}],"paths":{"/v1/org-charts/render":{"post":{"operationId":"renderOrgChart","summary":"Render an org chart as a watermarked PNG preview","description":"Manager indices refer to the full roles array; self-references and cycles are invalid.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"company":{"type":"string","minLength":1,"maxLength":80,"pattern":"^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$","description":"Company label for the chart. Do not include personal or confidential information."},"roles":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":60,"pattern":"^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$","description":"Role title, not a person’s name."},"reportsTo":{"anyOf":[{"type":"integer","minimum":0,"maximum":39},{"type":"null"}],"description":"Zero-based index of the manager in roles, or null for a top-level role."},"department":{"description":"Optional department label.","type":"string","minLength":1,"maxLength":40,"pattern":"^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$"}},"required":["title","reportsTo"],"additionalProperties":false}}},"required":["company","roles"],"additionalProperties":false},"example":{"company":"Example Service Co.","roles":[{"title":"Service Manager","reportsTo":null},{"title":"Dispatcher","reportsTo":0}]}}}},"responses":{"200":{"description":"First page of the chart","content":{"image/png":{}}},"400":{"description":"Malformed JSON, invalid chart fields or invalid reporting lines","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON body exceeds 24 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Content-Type must be application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The chart could not be drawn","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Render rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Renderer unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"operationId":"getServiceHealth","summary":"Check HTTP service liveness","responses":{"200":{"description":"Worker responding; does not render a chart","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"const":"ok"}}}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["success","error"],"properties":{"success":{"const":false},"error":{"type":"string"}}}}}}