{"openapi":"3.0.3","info":{"title":"Fiskon Relay API","version":"1.0.0","description":"Email, SMS, WhatsApp, push, transactional email and OTP through one API."},"servers":[{"url":"https:\/\/relay.naweriindustries.com\/api\/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"publicKey":{"type":"apiKey","in":"header","name":"X-Public-Key"}}},"paths":{"\/email":{"post":{"summary":"Send an email","description":"Queue an HTML email to one or many recipients. Delivery happens through your terminals with automatic failover; a failed delivery returns the token. Cost: 1 email token per recipient.","tags":["Messaging"],"operationId":"sendEmail","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"queued","message":"Queued 1 email.","data":{"ids":[1042],"queued":1,"rejected_as_spam":0,"balance":499}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":[],"description":"Recipient address, or a list (max 100)."},"subject":{"type":"string","description":"Subject line."},"html":{"type":"string","description":"HTML body. (Also accepted as body or message.)"},"from":{"type":"string","description":"Used as Reply-To. The message is sent from your terminal address."},"attachments":{"type":"array","items":[],"description":"multipart\/form-data only. Up to 5 files, 10 MB total (pdf, office, csv, txt, images, zip)."}},"required":["to","subject","html"]},"example":{"to":["customer@example.com"],"subject":"Your receipt","html":"<h2>Thanks for your order<\/h2><p>Order #1042 is confirmed.<\/p>","from":"orders@yourshop.com"}}}}}},"\/sms":{"post":{"summary":"Send an SMS","description":"Send a plain-text SMS to one or many numbers (international format, digits only). Cost: 1 SMS token per recipient.","tags":["Messaging"],"operationId":"sendSms","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"queued","message":"Queued 1 SMS.","data":{"ids":[88],"queued":1,"balance":119}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":[],"description":"Phone number(s), e.g. 256700000000. Max 100."},"message":{"type":"string","description":"Text, up to 640 characters."},"name":{"type":"string","description":"Recipient name, shown in your logs."}},"required":["to","message"]},"example":{"to":"256700000000","message":"Your order #1042 has shipped.","name":"Amina"}}}}}},"\/whatsapp":{"post":{"summary":"Send a WhatsApp message","description":"Send through the WhatsApp Business Platform. Free-form text works only inside the 24-hour window after the customer last messaged you; otherwise send an approved template. Delivery receipts update the status to delivered \/ read, and a failed receipt returns the token. Cost: 1 WhatsApp token per recipient.","tags":["Messaging"],"operationId":"sendWhatsapp","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"queued","message":"Queued 1 WhatsApp message.","data":{"ids":[31],"queued":1,"balance":40}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":[],"description":"WhatsApp number(s), international format, digits only. Max 100."},"message":{"type":"string","description":"Free text (4096 chars). Required unless you send a template."},"template":{"type":"object","description":"{ name, language, params: [..] } for an approved template (params fill {{1}}, {{2}}...). Or pass raw Meta \"components\"."}},"required":["to"]},"example":{"to":"256700000000","template":{"name":"order_update","language":"en","params":["Amina","#1042"]}}}}}}},"\/push":{"post":{"summary":"Send a push notification","description":"Push to devices registered from your web, iOS or Android app. Messages go through YOUR Firebase project (connect it once under Dashboard > Push). Target by your own user id, tag, raw tokens, or everyone (500 devices per request). Cost: 1 push token per device.","tags":["Messaging"],"operationId":"sendPush","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"queued","message":"Queued 1 push notification.","data":{"ids":[901],"queued":1,"balance":998}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"object","description":"One of { external_id: \"user-42\" | [..] }, { tag: \"vip\" }, { tokens: [..] }, { all: true }. Optional platform: web | ios | android."},"title":{"type":"string","description":"Max 120 characters."},"body":{"type":"string","description":"Max 2000 characters."},"url":{"type":"string","description":"Opened when the notification is tapped (web link \/ deep link)."},"image":{"type":"string","description":"Image URL."},"data":{"type":"object","description":"Custom key\/value payload delivered to your app."}},"required":["to","title","body"]},"example":{"to":{"external_id":"user-42"},"title":"Order shipped","body":"Your order #1042 is on its way.","url":"https:\/\/yourshop.com\/orders\/1042","data":{"order_id":1042}}}}}}},"\/push\/devices":{"post":{"summary":"Register a device","description":"Call this from your app or website when you receive an FCM token. Uses your PUBLISHABLE key (pk_...), which is safe to ship inside apps and web pages and can do nothing except register devices. Calling again refreshes the record. Cost: free.","tags":["Push devices"],"operationId":"registerDevice","security":[{"bearerAuth":[]},{"publicKey":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"registered","message":"Device registered.","data":{"device_id":17}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The FCM registration token."},"platform":{"type":"string","description":"web, ios or android."},"external_id":{"type":"string","description":"Your own user id, so you can target the person instead of a token."},"tags":{"type":"array","items":[],"description":"Up to 20 tags such as [\"vip\",\"kampala\"]."}},"required":["token","platform"]},"example":{"token":"fcm_registration_token_here","platform":"android","external_id":"user-42","tags":["vip"]}}}}},"delete":{"summary":"Remove a device","description":"Call on sign-out or when the user turns notifications off. Dead tokens are also removed automatically when Firebase reports them as unregistered. Cost: free.","tags":["Push devices"],"operationId":"removeDevice","security":[{"bearerAuth":[]},{"publicKey":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"removed","message":"Device removed.","data":{"removed":1}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The FCM registration token to remove."}},"required":["token"]},"example":{"token":"fcm_registration_token_here"}}}}}},"\/transactional\/email":{"post":{"summary":"Send a transactional email","description":"For receipts, password resets, alerts: renders one of your saved templates with variables ({{name}}, {{order.total}}), jumps the queue and is attempted inline, so the reply already tells you whether it was sent. Create templates under Dashboard > Templates, or pass subject + html directly. Cost: 1 email token per recipient.","tags":["Transactional"],"operationId":"transactionalEmail","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"queued","message":"Accepted 1 transactional email.","data":{"ids":[1043],"status":{"1043":"sent"},"balance":498}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":[],"description":"Recipient(s)."},"template":{"type":"string","description":"Template slug or id."},"data":{"type":"object","description":"Variables for the template. Values are HTML-escaped."},"subject":{"type":"string","description":"Overrides the template subject (or required with html)."},"html":{"type":"string","description":"Inline HTML instead of a template."},"reply_to":{"type":"string","description":"Reply-To address."}},"required":["to"]},"example":{"to":"customer@example.com","template":"order-receipt","data":{"name":"Amina","order":{"id":1042,"total":"UGX 85,000"}}}}}}}},"\/templates":{"get":{"summary":"List templates","description":"Your saved email templates and the variables each one expects. Cost: free.","tags":["Transactional"],"operationId":"listTemplates","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"ok","message":"Templates","data":{"templates":[{"id":3,"slug":"order-receipt","name":"Order receipt","subject":"Receipt for order {{order.id}}","variables":["name","order.id","order.total"]}]}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}}}},"\/otp":{"post":{"summary":"Send a one-time code","description":"Generates a secure code, delivers it by SMS, email or WhatsApp straight away, and returns a reference. The code itself is never returned or stored in readable form, and it is wiped from your logs after delivery. Limited to 5 codes per recipient per 10 minutes. Cost: 1 token of the channel used.","tags":["Transactional"],"operationId":"sendOtp","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"sent","message":"Code sent.","data":{"reference":"otp_9f3a1c7b2d5e8a4f6b01","channel":"sms","expires_at":"2026-10-30T10:05:00+03:00","message_id":88,"status":"sent"}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"Phone number (digits) or email, matching the channel."},"channel":{"type":"string","description":"sms (default), email or whatsapp."},"length":{"type":"integer","description":"4 to 8 digits. Default 6."},"ttl":{"type":"integer","description":"Lifetime in seconds, 60 to 900. Default 300."},"brand":{"type":"string","description":"Name shown in the message. Defaults to your account name."},"message":{"type":"string","description":"Custom text using {code}, {minutes}, {brand}."},"template":{"type":"object","description":"WhatsApp only: { name, language } of an approved authentication template."}},"required":["to"]},"example":{"to":"256700000000","channel":"sms","brand":"Yourshop","ttl":300}}}}}},"\/otp\/verify":{"post":{"summary":"Verify a one-time code","description":"Checks what the user typed. A code works once, expires, and locks after 5 wrong attempts. Cost: free.","tags":["Transactional"],"operationId":"verifyOtp","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"verified","message":"Code verified.","data":{"valid":true,"destination":"256700000000","channel":"sms"}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"reference":{"type":"string","description":"The reference returned by Send a one-time code."},"code":{"type":"string","description":"The code the user entered."}},"required":["reference","code"]},"example":{"reference":"otp_9f3a1c7b2d5e8a4f6b01","code":"482913"}}}}}},"\/balance":{"get":{"summary":"Check balances","description":"Token balance for every channel. Cost: free.","tags":["Account"],"operationId":"balance","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"ok","message":"Balance","data":{"email":499,"sms":120,"whatsapp":40,"push":998}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}}}},"\/messages\/{channel}\/{id}":{"get":{"summary":"Message status","description":"Poll a message you queued. channel is email, sms, whatsapp or push. Statuses: pending, sending, sent, delivered, read (WhatsApp), failed, spam. Cost: free.","tags":["Account"],"operationId":"messageStatus","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application\/json":{"example":{"error":0,"code":"ok","message":"Status","data":{"id":1042,"status":"sent","error":null,"token_returned":false,"attempts":1,"created_at":"2026-10-30 10:00:01","sent_at":"2026-10-30 10:00:03"}}}}},"4XX":{"description":"Error: { error: 1, code, message }"}},"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"},"description":"email | sms | whatsapp | push (in the path)."},{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"Message id returned when you queued it (in the path)."}]}}}}