Gupshup Opt-In API

Manage user opt-in / opt-out and list interacted users.

GitHub OpenAPI
Business capability
SMS & Messaging Apps AE-150.20

Operations 3

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /app/opt/in/{appName} Record a WhatsApp opt-in for a number · Mark a user opt-in #
Ask an LLM
“How do I record that a WhatsApp user has consented to receive messages?”
“Can I opt a number back in after it opted out?”
Tell an agent
Mark {user} as opted in on app {appName}.
Record WhatsApp consent for {user} in {appName}.
POST /app/opt/out/{appName} Record a WhatsApp opt-out for a number · Mark a user opt-out #
Ask an LLM
“How do I record that a WhatsApp user no longer wants messages?”
“Can I mark a number as opted out?”
Tell an agent
Mark {user} as opted out on app {appName}.
Record WhatsApp opt-out for {user} in {appName}.
GET /users/{appName} List WhatsApp users and their opt-in status · List interacted users and opt-in status #
Ask an LLM
“Which WhatsApp numbers have interacted with my business and what is their opt-in status?”
“Has a particular number opted in yet?”
Tell an agent
List users and opt-in status for app {appName}.
Show who has interacted with {appName} and whether they are opted in.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gupshup:gupshup-opt-in-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gupshup-opt-in-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gupshup WhatsApp Business Opt In API
  description: REST API for sending and managing WhatsApp Business messages through Gupshup.
  version: '1.0'
  contact:
    name: Gupshup
    url: https://www.gupshup.io
  x-modeled: true
servers:
- url: https://api.gupshup.io/wa/api/v1
  description: Gupshup WhatsApp Business API
security:
- apiKeyAuth: []
tags:
- name: Opt In
  description: Manage user opt-in / opt-out and list interacted users.
paths:
  /app/opt/in/{appName}:
    parameters:
    - $ref: '#/components/parameters/AppName'
    post:
      operationId: markUserOptIn
      tags:
      - Opt In
      summary: Mark a user opt-in
      description: Records that a user has consented to receive messages from the business, enabling template notifications to that number. Modeled from documentation. Legacy opt-in APIs are not supported for apps created after Aug 2025.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OptRequest'
      responses:
        '200':
          description: Opt-in recorded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /app/opt/out/{appName}:
    parameters:
    - $ref: '#/components/parameters/AppName'
    post:
      operationId: markUserOptOut
      tags:
      - Opt In
      summary: Mark a user opt-out
      description: Records that a user has opted out of receiving messages from the business. Modeled from documentation.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OptRequest'
      responses:
        '200':
          description: Opt-out recorded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /users/{appName}:
    parameters:
    - $ref: '#/components/parameters/AppName'
    get:
      operationId: listUsers
      tags:
      - Opt In
      summary: List interacted users and opt-in status
      description: Returns the users who have interacted with your business phone number and their opt-in status. Modeled from documentation.
      responses:
        '200':
          description: A list of users.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    StatusResponse:
      type: object
      properties:
        status:
          type: string
          example: success
    Error:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
    OptRequest:
      type: object
      required:
      - user
      properties:
        user:
          type: string
          description: The user's phone number (with country code) to opt in or out.
    User:
      type: object
      properties:
        phoneCode:
          type: string
        phoneNumber:
          type: string
        optinStatus:
          type: string
          description: Whether the user is opted in.
        lastInteraction:
          type: string
          description: Timestamp of the user's last interaction.
    UserListResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
  parameters:
    AppName:
      name: appName
      in: path
      required: true
      description: The Gupshup app name registered to the WhatsApp business number.
      schema:
        type: string
  responses:
    Unauthorized:
      description: Missing or invalid apikey.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: Account API key sent in the `apikey` request header. Available from the Gupshup dashboard. Scopes requests to your account and its registered apps.