{"info":{"version":"1.0.0","description":"Bulk SMS and OTP API for BulkBridge customers.","title":"BulkBridge API"},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"SmsStatus":{"type":"object","properties":{"status":{"type":"string","enum":["pending","queued","sending","sent","delivered","failed"]},"category":{"type":"string","enum":["PROMO","TXN","OTP"],"nullable":true},"updated_at":{"type":"string","format":"date-time"},"phone":{"type":"string"},"delivered_at":{"type":"string","format":"date-time","nullable":true},"message_id":{"type":"integer","format":"int64"},"campaign_id":{"type":"integer","format":"int64","nullable":true},"failed_at":{"type":"string","format":"date-time","nullable":true},"sent_at":{"type":"string","format":"date-time","nullable":true},"sender_id":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http","bearerFormat":"API key"}}},"tags":[{"name":"SMS"},{"name":"OTP"},{"name":"Account"}],"paths":{"/api/v1/balance":{"get":{"summary":"Read wallet balance","tags":["Account"],"operationId":"getBalance","responses":{"200":{"description":"Wallet balance","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/otp/cancel":{"post":{"summary":"Cancel an OTP","tags":["OTP"],"operationId":"cancelOtp","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"otp_id":123}}}},"responses":{"200":{"description":"OTP cancelled","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/otp/send":{"post":{"summary":"Send a verification code","tags":["OTP"],"operationId":"sendOtp","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"phone":"+260970000000"}}}},"responses":{"201":{"description":"OTP sent","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/otp/verify":{"post":{"summary":"Verify a code","tags":["OTP"],"operationId":"verifyOtp","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"code":"123456","otp_id":123}}}},"responses":{"200":{"description":"OTP verified","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/otp/{otp_id}":{"get":{"parameters":[{"in":"path","name":"otp_id","required":true,"schema":{"type":"integer"}}],"summary":"Read OTP status","tags":["OTP"],"operationId":"getOtp","responses":{"200":{"description":"OTP status","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/sms":{"get":{"description":"Requires sms:read. Newest first; sent means accepted, not delivered. Keep filters unchanged when following next_before_id.","parameters":[{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"type":"integer","minimum":1}},{"in":"query","name":"before_id","schema":{"type":"integer","format":"int64","minimum":1}},{"in":"query","name":"campaign_id","schema":{"type":"integer","format":"int64","minimum":1}},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","queued","sending","sent","delivered","failed"]}}],"summary":"Read account SMS history","tags":["SMS"],"operationId":"listSms","responses":{"200":{"description":"Message page","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SmsStatus"}},"next_before_id":{"type":"integer","format":"int64","nullable":true}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/sms/send":{"post":{"description":"Requires sms:send. Optional scheduled_at is a future ISO 8601 datetime with an explicit timezone. Omit or use null for immediate sending. Scheduled messages remain queued until due; the wallet is charged when queued. The response includes scheduled_at in UTC (or null).","summary":"Queue an SMS","tags":["SMS"],"operationId":"sendSms","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"},"example":{"message":"Your package has arrived.","category":"TXN","to":["+260970000000"],"sender_id":"MYSHOP"}}}},"responses":{"202":{"description":"Message queued","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/sms/{message_id}":{"get":{"description":"Requires sms:read. Use the message_id returned by sendSms. A different account's message returns 404.","parameters":[{"in":"path","name":"message_id","required":true,"schema":{"type":"integer","format":"int64","minimum":1}}],"summary":"Read one SMS status","tags":["SMS"],"operationId":"getSms","responses":{"200":{"description":"Message status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SmsStatus"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"openapi":"3.0.3","security":[{"bearerAuth":[]}],"servers":[{"url":"https://YOUR_DOMAIN"}]}