Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to MSG91

Scalekit connector
Open markdown

The MSG91 connector lets your AI agent act in each user's MSG91 account. Each user connects their own MSG91 API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 67 tools.

Tools
67
What they doRead · write · destructive
31 · 31 · 531 read31 write5 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the MSG91 connection

    In AgentKit > Connections, create a MSG91 connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'msg91'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize MSG91:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'msg91_email_analytics_get',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their MSG91 credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • msg91_email_analytics_getGet aggregated email statistics for a date range of up to the last 31 days.Read-only

    Get Email Analytics

    Get aggregated email statistics for a date range of up to the last 31 days. Returns totals such as sent, delivered, failed and credits used for the range. Use this for totals and delivery rates. Use msg91_email_logs_list for per-message detail.

    Inputs

    end_datestring
    End date in YYYY-MM-DD format; the range can cover at most the last 31 days. Example: 2026-11-13
    start_datestring
    Start date in YYYY-MM-DD format. Example: 2026-11-01
  • msg91_email_css_inlineConvert an HTML email's CSS into inline styles so it renders in email clients.Read-only

    Inline Email CSS

    Convert an HTML email's CSS into inline styles so it renders in email clients. Returns the HTML with styles inlined. Use this before msg91_email_template_create when the HTML relies on a style block. It saves nothing.

    Inputs

    htmlstringrequired
    HTML to inline. Example: <style>h1{color:#c00}</style><h1>Hello</h1>
  • msg91_email_logs_listList per-message email delivery logs for up to 3 days within the last 3 days.Read-only

    List Email Logs

    List per-message email delivery logs for up to 3 days within the last 3 days. Returns one row per message with status, recipient, timestamps, failure reason and request ID; date problems come back as an error field with HTTP 200. Use this to confirm delivery of specific messages. Use msg91_email_analytics_get for totals.

    Inputs

    end_datestringrequired
    End date in YYYY-MM-DD format; at most 3 days after start_date. Example: 2026-11-13
    start_datestringrequired
    Start date in YYYY-MM-DD format; it must be within the last 3 days. Example: 2026-11-11
  • msg91_email_template_version_getGet one version of an email template, including its subject and HTML body.Read-only

    Get Email Template Version

    Get one version of an email template, including its subject and HTML body. Returns the version details and, with with=template, its parent template. Use this to read a template's content. Use msg91_email_templates_list to find version IDs.

    Inputs

    version_idstringrequired
    Template version ID. Example: 12345
    withstring
    Set to template to include the parent template. Example: template
  • msg91_email_templates_listList the email templates in your MSG91 account, optionally searched by keyword and filtered by status.Read-only

    List Email Templates

    List the email templates in your MSG91 account, optionally searched by keyword and filtered by status. Returns templates with their IDs, slugs, names and versions. Use this to find a template_id for msg91_email_send. Use msg91_email_template_version_get for one version's content.

    Inputs

    keywordstring
    Search text. Example: welcome
    pageinteger
    Page number, starting at 1. Example: 1
    per_pageinteger
    Templates per page. Example: 25
    search_instring
    Field to search the keyword in, for example name. Example: name
    status_idinteger
    Only return templates with this status ID. Example: 2
    withstring
    Related data to include, for example versions. Example: versions
  • msg91_otp_analytics_getGet aggregated OTP statistics for a date range of up to the last 31 days.Read-only

    Get OTP Analytics

    Get aggregated OTP statistics for a date range of up to the last 31 days. Returns totals such as sent, delivered, failed and credits used for the range. Use this for totals and delivery rates. Use msg91_otp_logs_list for per-message detail.

    Inputs

    end_datestring
    End date in YYYY-MM-DD format; the range can cover at most the last 31 days. Example: 2026-11-13
    start_datestring
    Start date in YYYY-MM-DD format. Example: 2026-11-01
  • msg91_otp_logs_listList per-message OTP delivery logs for up to 3 days within the last 3 days.Read-only

    List OTP Logs

    List per-message OTP delivery logs for up to 3 days within the last 3 days. Returns one row per message with status, recipient, timestamps, failure reason and request ID; date problems come back as an error field with HTTP 200. Use this to confirm delivery of specific messages. Use msg91_otp_analytics_get for totals.

    Inputs

    end_datestringrequired
    End date in YYYY-MM-DD format; at most 3 days after start_date. Example: 2026-11-13
    start_datestringrequired
    Start date in YYYY-MM-DD format; it must be within the last 3 days. Example: 2026-11-11