Msg91 connects to a Nagent workspace with an API key. Once it is connected, agents can call 8 Msg91 actions, such as "Create User Events", "Get Event Types" and "Get Failed Events". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Msg91, with input parameters and output schema.
MSG91_CREATE_USER_EVENTSCreate and track user events in MSG91 Segmento for customer behavior analysis and segmentation. Use this tool to record user actions and behaviors such as logins, purchases, page views, button clicks, or any custom events. These events help build user profiles and enable targeted campaigns based on user behavior. Examples: - Track user login events for engagement analysis - Record purchase events with product details for sales tracking - Log page views and clicks for behavior analytics - Capture custom events with properties for detailed segmentation
Input parameters
List of user events to record. You can submit multiple events for the same user in a single request.
Unique identifier for the user. Can be an email address or phone number with country code (e.g., '+919999999999' or 'user@example.com').
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_GET_EVENT_TYPESRetrieves all event types configured in MSG91 Segmento. Event types represent different user actions and behaviors that can be tracked (e.g., purchases, signups, page views). Use this action to discover what events are available for tracking user behavior in your Segmento account. No parameters required - returns all event types.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_GET_FAILED_EVENTSRetrieve failed user events from a MSG91 Segmento campaign. This tool fetches events that failed to process during campaign execution, helping you identify and debug issues such as validation errors, invalid recipients, or missing required data. Use this when you need to: - Investigate why certain events didn't process successfully - Get detailed failure reasons for troubleshooting - Monitor campaign health and identify patterns in failures - Retrieve failed events within a specific date range Results are paginated for large datasets. Requires a valid campaign_id from a Segmento campaign.
Input parameters
Page number for pagination. Starts at 1. Use this to navigate through multiple pages of failed events.
Maximum number of failed events to return per page. Must be between 1 and 100. Default is 10.
Optional end date to filter failed events (format: YYYY-MM-DD). Only events that failed on or before this date will be included.
Optional start date to filter failed events (format: YYYY-MM-DD). Only events that failed on or after this date will be included.
The unique identifier of the Segmento campaign. This is the campaign ID returned when creating or listing campaigns.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_LIST_CAMPAIGNSTool to list all campaigns in Segmento. Use when you need to retrieve campaigns with pagination support.
Input parameters
Page number for pagination.
Number of campaigns per page.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_RESEND_OTPResend OTP to the same mobile number via text message or voice call. Use when the original OTP was not received or expired, and the user needs a new code sent to the same number.
Input parameters
Mobile number to resend OTP to, in international format without '+' prefix (e.g., '919999999999' for India). Must be the same number that received the original OTP.
Method to resend the OTP: 'text' for SMS message or 'voice' for voice call. Voice calls are useful when SMS delivery fails or for accessibility.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_SEND_OTPTool to send OTP (One-Time Password) to a mobile number using a pre-configured MSG91 template. Use when you need to verify user phone numbers for authentication, account registration, password reset, or transaction confirmation.
Input parameters
Custom OTP value to send. If not provided, MSG91 will auto-generate an OTP based on otp_length parameter. Use this when you need to send a specific OTP code.
Recipient mobile number in international format with country code (e.g., '919999999999' for India, '15551234567' for USA). Do not include '+' prefix or spaces.
End user's IP address for security tracking and fraud prevention. Helps identify the request origin.
Set to 1 for sending SMS in non-English languages (Hindi, Arabic, Chinese, etc.). Set to 0 for English only. Default: 0
For MOBILE APP only (do not use for web browsers). Set to 1 to enable invisible OTP verification, 0 to disable. Default: 0
OTP expiry time in minutes. Minimum: 1 minute, Maximum: 10080 minutes (7 days), Default: 60 minutes. After this duration, the OTP becomes invalid.
Number of digits in the auto-generated OTP. Minimum: 4, Maximum: 9, Default: 4. Only applies when 'otp' parameter is not provided.
OTP template ID from the OTP section of MSG91 dashboard. This template defines the SMS content format with OTP placeholder.
Set to 1 to enable real-time response due to caching. This provides immediate delivery status. Set to 0 for standard response.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_SEND_SMS_V5Send SMS messages using pre-defined templates via MSG91 Flow API v5. Use when you need to send template-based SMS with dynamic variable substitution to single or multiple recipients. Templates must be created and approved in MSG91 dashboard before use.
Input parameters
Enable URL shortening in SMS: '1' to enable, '0' to disable. When enabled, long URLs in the message are automatically shortened to save characters. Default: '0'
Array of recipient objects containing mobile numbers and dynamic variable values. Each recipient can have different variable values for personalized messages.
SMS template ID (Flow ID) from MSG91 dashboard. Create templates at https://control.msg91.com/flow/. Template must be approved before use.
Enable real-time delivery response: '1' to get immediate delivery status for each message. Note: This may increase response time. Default: '0' (asynchronous)
Short URL expiry time in seconds. Only applicable when short_url is enabled. After expiry, the shortened URL will no longer redirect. Default: no expiry
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
MSG91_VERIFY_OTPTool to verify an OTP (One-Time Password) sent to a mobile number. Use when you need to confirm that the OTP code entered by the user matches the one sent via Send OTP API.
Input parameters
The OTP code to verify. This is the code that was sent to the mobile number via Send OTP API and entered by the user.
Mobile number in international format with country code (e.g., '919876543210' for India, '15551234567' for USA). Must match the number used in Send OTP. Do not include '+' prefix or spaces.
OTP expiry time in minutes. Only required if you passed a custom expiry time when sending the OTP. If not provided, the default expiry time (60 minutes) is used.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 8 Msg91 actions on Nagent, including "Create User Events", "Get Event Types" and "Get Failed Events". Create User Events: Create and track user events in MSG91 Segmento for customer behavior analysis and segmentation. Each action is listed on this page with its input parameters and its output.
Msg91 connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Create User Events takes 2 required inputs: events and identifier. It returns data, error and successful.