{"components":{"schemas":{"BatchRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/SendRequest"},"maxItems":1000,"type":"array"}},"type":"object"},"Billing":{"properties":{"address":{"description":"","type":"string"},"email":{"description":"","type":"string"},"name":{"description":"","type":"string"},"tax_id":{"description":"","type":"string"}},"type":"object"},"CampaignRequest":{"properties":{"body":{"description":"Supports {{variable}}","type":"string"},"category":{"description":"","type":"string"},"csv":{"description":"CSV with a mobile column","type":"string"},"name":{"description":"","type":"string"},"scheduled_at":{"format":"date-time","type":"string"}},"type":"object"},"Error":{"properties":{"error":{"properties":{"code":{"description":"Stable machine-readable code","type":"string"},"details":{"type":"object"},"message":{"description":"Human-readable message","type":"string"},"request_id":{"description":"Correlation ID","type":"string"}},"type":"object"}},"type":"object"},"LoginRequest":{"properties":{"email":{"description":"","type":"string"},"password":{"description":"","type":"string"}},"type":"object"},"MobileComplete":{"properties":{"challenge_id":{"description":"","type":"string"},"code":{"description":"","type":"string"},"mobile":{"description":"","type":"string"}},"type":"object"},"MobileStart":{"properties":{"mobile":{"description":"","type":"string"}},"type":"object"},"RegisterRequest":{"properties":{"email":{"description":"","type":"string"},"name":{"description":"","type":"string"},"organisation_name":{"description":"","type":"string"},"password":{"description":"min 12 characters","type":"string"}},"type":"object"},"SegmentPreviewRequest":{"properties":{"text":{"description":"","type":"string"}},"type":"object"},"SendRequest":{"properties":{"body":{"description":"Message text; mandatory prefix/branding is added by the platform","type":"string"},"brand_id":{"description":"Approved brand","type":"string"},"category":{"enum":["OTP","TRANSACTIONAL","BULK"],"type":"string"},"funding":{"enum":["PAID","TRIAL"],"type":"string"},"scheduled_at":{"format":"date-time","type":"string"},"sender":{"description":"Approved sender","type":"string"},"to":{"description":"Destination (E.164 or national format)","type":"string"},"validity_seconds":{"maximum":259200,"minimum":60,"type":"integer"}},"required":["to","body","category"],"type":"object"},"SendResult":{"properties":{"details":{"description":"final_text, encoding, segments, charge_micros, trial_credits, screening, prefix","type":"object"},"duplicate":{"type":"boolean"},"message_id":{"description":"","type":"string"},"status":{"description":"QUEUED on acceptance","type":"string"}},"type":"object"},"Wallet":{"properties":{"available_micros":{"type":"integer"},"reserved_micros":{"type":"integer"},"trial_credits_available":{"type":"integer"}},"type":"object"}},"securitySchemes":{"apiKey":{"description":"API key: Authorization: Bearer am_live_xxxx_yyyy","scheme":"bearer","type":"http"},"session":{"description":"Browser session; unsafe methods also require X-CSRF-Token.","in":"cookie","name":"am_session","type":"apiKey"}}},"info":{"description":"SMS gateway, prepaid wallet and commerce API. Amounts: *_micros = 1/1,000,000 MYR; *_minor = sen.","title":"Trio Mobile SMS API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/v1/api-keys":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"List API keys","tags":["Developer"]},"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Create a scoped API key (shown once)","tags":["Developer"]}},"/v1/api-keys/{id}":{"delete":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Revoke an API key","tags":["Developer"]}},"/v1/auth/login":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[],"summary":"Sign in; sets an HttpOnly session cookie and returns a CSRF token","tags":["Auth"]}},"/v1/auth/logout":{"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Sign out","tags":["Auth"]}},"/v1/auth/register":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[],"summary":"Register a customer account (trial-only until first purchase)","tags":["Auth"]}},"/v1/bank-transfers/{id}/evidence":{"post":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Upload transfer evidence (does not credit the wallet)","tags":["Commerce"]}},"/v1/brands":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"List brands","tags":["Senders"]},"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Request a brand (requires operator approval)","tags":["Senders"]}},"/v1/callbacks/payments/{gateway}":{"post":{"parameters":[{"in":"path","name":"gateway","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[],"summary":"Payment gateway webhook (HMAC-signed, replay-protected, independently verified)","tags":["Callbacks"]}},"/v1/callbacks/providers/{code}/dlr":{"post":{"parameters":[{"in":"path","name":"code","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[],"summary":"Provider delivery report (HMAC-signed)","tags":["Callbacks"]}},"/v1/campaigns":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"List campaigns","tags":["Campaigns"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Create a campaign from recipients or CSV (optionally scheduled)","tags":["Campaigns"]}},"/v1/cart":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Current cart with totals","tags":["Commerce"]}},"/v1/cart/items":{"put":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Set a product quantity (0 removes)","tags":["Commerce"]}},"/v1/cart/promo":{"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Apply a promo code","tags":["Commerce"]}},"/v1/catalogue":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Packages available to this organisation","tags":["Commerce"]}},"/v1/checkout":{"post":{"parameters":[{"description":"Retries with the same key return the original result and never charge twice.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Create an order from the cart (not proof of payment)","tags":["Commerce"]}},"/v1/invoices":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"List invoices, receipts and credit notes","tags":["Commerce"]}},"/v1/invoices/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Printable invoice (HTML; format=json for data)","tags":["Commerce"]}},"/v1/me":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Current principal, organisations and CSRF token","tags":["Auth"]}},"/v1/mobile/verify/complete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileComplete"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Confirm the mobile verification OTP","tags":["Onboarding"]}},"/v1/mobile/verify/start":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileStart"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Send a mobile verification OTP","tags":["Onboarding"]}},"/v1/orders":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"List orders","tags":["Commerce"]}},"/v1/orders/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Order with payments","tags":["Commerce"]}},"/v1/orders/{id}/bank-transfer":{"post":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Get bank transfer instructions","tags":["Commerce"]}},"/v1/orders/{id}/pay":{"post":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Start hosted checkout (FPX/card via gateway)","tags":["Commerce"]}},"/v1/orders/{id}/reorder":{"post":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Retries with the same key return the original result and never charge twice.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Repeat a previous order","tags":["Commerce"]}},"/v1/otp":{"post":{"parameters":[{"description":"Retries with the same key return the original result and never charge twice.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResult"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Send an OTP via the dedicated OTP Express queue","tags":["Messaging"]}},"/v1/public/catalogue":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[],"summary":"Packages, list tariffs and trial offer","tags":["Public"]}},"/v1/public/segment-preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[],"summary":"Encoding and segment count for a text","tags":["Public"]}},"/v1/reports/usage":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Usage by day/country/category (format=csv for download)","tags":["Reports"]}},"/v1/senders":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"List sender IDs","tags":["Senders"]},"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Request a sender ID (requires operator approval)","tags":["Senders"]}},"/v1/sms":{"get":{"responses":{"202":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"List messages (cursor: next_before)","tags":["Messaging"]},"post":{"parameters":[{"description":"Retries with the same key return the original result and never charge twice.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResult"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Send one SMS (atomic admission; 202 Accepted)","tags":["Messaging"]}},"/v1/sms/batch":{"post":{"parameters":[{"description":"Retries with the same key return the original result and never charge twice.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Send up to 1,000 messages (each admitted independently)","tags":["Messaging"]}},"/v1/sms/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}},"required":true},"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Dry-run the full pipeline: final text, prefix, segments, price, screening","tags":["Messaging"]}},"/v1/sms/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Message status with full lifecycle events","tags":["Messaging"]}},"/v1/sms/{id}/cancel":{"post":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Cancel a queued message and release funds","tags":["Messaging"]}},"/v1/templates":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"List templates","tags":["Campaigns"]},"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Create a template","tags":["Campaigns"]}},"/v1/trial/claim":{"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"session":[]}],"summary":"Claim the one-time trial credits","tags":["Onboarding"]}},"/v1/wallet":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wallet"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Paid wallet and trial credit balances","tags":["Wallet"]}},"/v1/webhooks":{"get":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"List webhook endpoints and recent deliveries","tags":["Developer"]},"post":{"responses":{"200":{"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"security":[{"apiKey":[]},{"session":[]}],"summary":"Register a signed webhook endpoint","tags":["Developer"]}}},"servers":[{"url":"https://messaging.triomobile.com"}]}
