---
updatedAt: 2026-10-14T13:36:38.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Text-Based Message

Use this API to send messages using the Text based message.

> 📘 Note:
>
> Marketing Messages sent via Cloud API will be deprecated by October 2027, Update your endpoints to [MM Lite](https://partner-docs.gupshup.io/reference/sendmmlitegiftemplatemessage) for marketing messages.

> 📘 Note:
>
> 1. Sending Marketing Templates through MM Lite for enhanced delivery optimization. For more details, refer to [*MM Lite*](https://partner-docs.gupshup.io/docs/marketing-messages-lite-mm-lite-api) document.
> 2. To send a text-based message template, make a` POST` call to `/PHONE_NUMBER_ID/messages` and attach a message object with `type=template`. Then, add a `template `object.
> 3. Substitute the placeholder properties below using the properties table.
> 4. Use the `recipient` parameter only when BSUID is enabled for the app
> 5. When both `to` and `recipient` fields are used in the payload, the `to` field gets the priority.

## Request Parameters

<HTMLBlock>{`
<table style="width: 100%; border-collapse: collapse;">
<thead>
<tr>
  <th style="border: 1px solid #ddd; padding: 8px;">Key</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Value</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Description</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Data type</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Required/Optional</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Constraints</th>
</tr>
</thead>
<tbody>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Authorization</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{PARTNER_APP_TOKEN}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Access Token for the application</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Should be a valid<br>Partner App Access<br>Token.</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>appId</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{APP_ID}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>App ID to fetch the<br>access token</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The ID should be a valid app Id of Gupshup.</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>messaging_product</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>whatsapp</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Messaging product</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>recipient_type</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>individual</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Recipient type</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>to</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>91785876xxxx</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Destination phone number where the message needs to be sent</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required (Can be optional if BSUID is enabled for the app and recipient parameter is used instead)</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Must be a valid phone number</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>recipient</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>IN.461449821882xxxx</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Destination BSUID where the message needs to be sent</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Must be a valid BSUID</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>type</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>template</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Messaging type</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The type should be <code>template</code> to send a template message.</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>template</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p><code>{   	&quot;name&quot;:   	&quot;TEMPLATE_NAME&quot;,   	&quot;language&quot;:   	{   		&quot;code&quot;:   		&quot;LANGUAGE_AND_LOCALE_CODE&quot;   	},   	&quot;components&quot;: [   	&quot;&lt;NAMED_PARAMETER_INPUT&gt;&quot; OR   	&quot;&lt;POSITIONAL_PARAMETER_INPUT&gt;&quot;   	]   }</code></p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Template message inside body</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Object</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>&lt;NAMED_PARAMETER_<br>INPUT&gt;<br>Required when you have used named parameters in your<br>template&#39;s body text.  </p>
<p>&lt;POSITIONAL_PARAMT<br>ER_INPUT&gt;  </p>
<p>Required when you have used positional<br>parameters in your template&#39;s body text.</p>
</td>
</tr>
</tbody>
</table>
`}</HTMLBlock>

## Sample Request

```curl
curl --location 'https://partner.gupshup.io/partner/app/{{APP_ID}}/v3/message' \
--header 'accept: application/json' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
		"messaging_product": "whatsapp",
		"recipient_type": "individual",
    "to": "PHONE_NUMBER",
		"recipient": "BSUID",
    "type": "template",
    "template": {
    		"name": "TEMPLATE_NAME",
        "language": {
        		"code": "LANGUAGE_AND_LOCALE_CODE"
				},
				"components": [
        		"<NAMED_PARAMETER_INPUT>",
            "<POSITIONAL_PARAMETER_INPUT>"
        ]
		}
}' 
```

## Sample Response

```json
{			
	"messages": [		
		{		
			"id":	"GUPSHUP_MESSAGE_ID"	
		}		
 		],	
		"messaging_product": "whatsapp",	
		"contacts": [	
		{	
			"input": "DESTINATION_PHONE_NO",	
			"wa_id": "DESTINATION_PHONE_NO"	
		}	
	]	
}	
```

## Status Codes

| Status Code | Response                                                                                                                                                                                                                                          | Comments                                       |
| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------- |
| **Success** |                                                                                                                                                                                                                                                   |                                                |
| 200         | `{			   	"messages": [		   		{		   			"id":	"GUPSHUP_MESSAGE_ID"	   		}		    		],	   		"messaging_product": "whatsapp",	   		"contacts": [	   		{	   			"input": "DESTINATION_PHONE_NO",	   			"wa_id": "DESTINATION_PHONE_NO"	   		}	   	]	   }` |                                                |
| **Error**   |                                                                                                                                                                                                                                                   |                                                |
| 400         | `{   	"message": "Callback Billing must be enabled for this API",   	"status": "error"   }`                                                                                                                                                       | if Callback billing is not enabled for the app |
| 400         | `{   	"message": "Invalid App Details",   	"status": "error"   }`                                                                                                                                                                                 | if app details are not found                   |
| 401         | `{   	"status": "error",   	"message": "Authentication Failed"   }`                                                                                                                                                                               | When API key authentication fails              |

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Partner Portal API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io"
    }
  ],
  "paths": {
    "/partner/app/{appId}/v3/message": {
      "post": {
        "summary": "Text-Based Message",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "example": {
                  "messaging_product": "whatsapp",
                  "recipient_type": "individual",
                  "to": "PHONE_NUMBER",
                  "type": "template",
                  "template": {
                    "name": "TEMPLATE_NAME",
                    "language": {
                      "code": "LANGUAGE_AND_LOCALE_CODE"
                    },
                    "components": [
                      "<NAMED_PARAMETER_INPUT>",
                      "<POSITIONAL_PARAMETER_INPUT>"
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Your app token, please refer [**Get access token api**](https://partner-docs.gupshup.io/reference/get_partner-app-appid-token) to get the token from partner documentation.",
            "example": "sk_61b3021c97214370b341f8baaae0xxxx",
            "required": true
          },
          {
            "name": "appId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Unique identifier of the app.",
            "example": "9e97650d-xxxx-xxxx-xxxx-4cdf47c3fa68"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "GUPSHUP_MESSAGE_ID"
                          }
                        }
                      },
                      "example": [
                        {
                          "id": "GUPSHUP_MESSAGE_ID"
                        }
                      ]
                    },
                    "messaging_product": {
                      "type": "string",
                      "example": "whatsapp"
                    },
                    "contacts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "input": {
                            "type": "string",
                            "example": "DESTINATION_PHONE_NO"
                          },
                          "wa_id": {
                            "type": "string",
                            "example": "DESTINATION_PHONE_NO"
                          }
                        }
                      },
                      "example": [
                        {
                          "input": "DESTINATION_PHONE_NO",
                          "wa_id": "DESTINATION_PHONE_NO"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Callback Billing must be enabled for this API"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Authentication Failed"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Use this API to send messages using the Text based message."
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```