{"openapi":"3.0.3","info":{"title":"Bolrach Chat API","version":"1.0.0","description":"Tenant-keyed chat platform. Authenticate every /v1 call with an API key: Authorization: Bearer sk_live_... Realtime is Server-Sent Events on the channel stream endpoint."},"servers":[{"url":"https://chat.bolrach.com"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_*"}}},"security":[{"apiKey":[]}],"paths":{"/health":{"get":{"summary":"Health","security":[],"responses":{"200":{"description":"ok"}}}},"/v1/channels":{"get":{"summary":"List channels","responses":{"200":{"description":"channels"}}},"post":{"summary":"Create channel","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","default":"group"},"topic":{"type":"string"}}}}}},"responses":{"201":{"description":"created"},"409":{"description":"slug exists"}}}},"/v1/channels/{id}/members":{"get":{"summary":"List members","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"members"}}},"post":{"summary":"Add member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_ref"],"properties":{"user_ref":{"type":"string"},"display_name":{"type":"string"},"role":{"type":"string","default":"member"}}}}}},"responses":{"201":{"description":"added"}}}},"/v1/channels/{id}/messages":{"get":{"summary":"List messages (oldest first)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"messages"}}},"post":{"summary":"Post message (also broadcast to SSE subscribers)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_ref","body"],"properties":{"user_ref":{"type":"string"},"display_name":{"type":"string"},"body":{"type":"string"},"attachments":{"type":"array"}}}}}},"responses":{"201":{"description":"created"}}}},"/v1/channels/{id}/stream":{"get":{"summary":"Realtime message stream (Server-Sent Events; event: message)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"text/event-stream"}}}},"/v1/admin/tenants":{"post":{"summary":"Provision a tenant + first API key (admin only, header x-admin-secret)","security":[],"responses":{"201":{"description":"tenant + api_key (shown once)"}}}}}}