{"openapi":"3.1.0","info":{"title":"Bolrach WhatsApp API","version":"1.0.0","description":"Send WhatsApp messages through the Bolrach platform's business number on the Meta Cloud API — free-form text inside an open 24-hour customer-service window, approved templates anytime. `whatsapp:send` is a high-trust scope issued deliberately.","contact":{"url":"https://docs.bolrach.com/whatsapp"}},"servers":[{"url":"https://api.bolrach.com"}],"security":[{"bearerKey":[]},{"headerKey":[]}],"paths":{"/v1/whatsapp/send":{"post":{"operationId":"whatsappSend","summary":"Send free-form text (open session)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"International number, e.g. +2348012345678."},"text":{"type":"string","maxLength":4096},"preview_url":{"type":"boolean","default":false}},"required":["to","text"]},"example":{"to":"+2348012345678","text":"Your order 1042 has shipped."}}}},"responses":{"200":{"description":"Accepted by Meta.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean"},"messageId":{"type":["string","null"],"description":"Meta's wamid for the accepted message."},"to":{"type":"string"}},"required":["sent","messageId","to"]}}}},"400":{"description":"Bad input, or Meta rejected the send (`whatsapp_rejected`: bad number, closed 24h session, unknown template).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"403":{"description":"Key lacks the `whatsapp:send` scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"429":{"description":"Rate limit or daily quota exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"502":{"description":"Meta did not answer (`upstream_error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}}}}},"/v1/whatsapp/send-template":{"post":{"operationId":"whatsappSendTemplate","summary":"Send an approved template (anytime)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"},"template":{"type":"string","description":"Approved template name (lowercase snake_case)."},"language":{"type":"string","default":"en_US"},"components":{"type":"array","items":{"type":"object"},"description":"Meta template components (body params, buttons)."}},"required":["to","template"]},"example":{"to":"+2348012345678","template":"bolrach_otp","language":"en_US"}}}},"responses":{"200":{"description":"Accepted by Meta.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean"},"messageId":{"type":["string","null"],"description":"Meta's wamid for the accepted message."},"to":{"type":"string"}},"required":["sent","messageId","to"]}}}},"400":{"description":"Bad input, or Meta rejected the send (`whatsapp_rejected`: bad number, closed 24h session, unknown template).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"403":{"description":"Key lacks the `whatsapp:send` scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"429":{"description":"Rate limit or daily quota exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"502":{"description":"Meta did not answer (`upstream_error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}}}}},"/v1/whatsapp/templates":{"get":{"operationId":"whatsappTemplates","summary":"List the approved template catalogue","responses":{"200":{"description":"Templates with name, status, category and language.","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"},"language":{"type":"string"}}}}}}}}},"400":{"description":"Bad input, or Meta rejected the send (`whatsapp_rejected`: bad number, closed 24h session, unknown template).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"403":{"description":"Key lacks the `whatsapp:send` scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"429":{"description":"Rate limit or daily quota exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}},"502":{"description":"Meta did not answer (`upstream_error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}},"required":["code","message","status"]}},"required":["error"]}}}}}}}},"components":{"securitySchemes":{"bearerKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer bt_..."},"headerKey":{"type":"apiKey","in":"header","name":"x-api-key"}}}}