Documentation Index
Fetch the complete documentation index at: https://docs.ruach.ng/llms.txt
Use this file to discover all available pages before exploring further.
USSD Session Webhook
The USSD API sendsPOST requests to your configured endpoint for each stage of a USSD session. Your endpoint should parse the payload and return a JSON response that tells the network whether to continue or end the session.
Overview
The USSD session follows three stages:- Begin: Starts a new session.
- Continue: Sends user input during an active session.
- End: Closes the session and displays a final response.
Endpoint Setup
Provide a publicly reachablePOST URL that can:
- Receive JSON payloads for
beginandcontinueevents. - Return JSON responses in the expected format.
- Handle optional
backenddata when provided by the network/backend.
Request Format
Begin Request
Continue Request
Response Format
Continue Response (Prompt User for More Input)
Use this response when you want the session to remain active.End Response (Close Session)
Use this response when the interaction is complete.Field Descriptions
Common Fields
Subscriber phone number (for example,
2348099999999).Mobile network name. Expected values include
9mobile, mtn, glo, and airtel.USSD shortcode used for the session (for example,
123).Current USSD input/message content.
Session Fields
Session stage code (
2 = begin, 3 = continue, 4 = end).Session stage name (
begin, continue, end).UI mode code (
0 = none, 1 = input, 2 = dialog).UI mode name (
none, input, dialog).Optional Backend Fields
Optional backend payload. This may vary by telco/network integration and can be omitted in responses.
USSD backend body information.
USSD backend header information.
Status Fields
Request status code (for example,
200).Request status message (for example,
OK).Best Practices
- Return only valid JSON in the expected shape.
- Keep responses short and fast to avoid session timeout.
- Treat
backendas optional and parse defensively. - Log
msisdn,session.type, andtextfor troubleshooting.

