---
updatedAt: 2026-07-14T10:24:48.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Location

Use this API to send messages with the Location template.

## Request Parameters

<Table align={["left","left","left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Key
      </th>

      <th>
        Description
      </th>

      <th>
        Value
      </th>

      <th>
        Data type
      </th>

      <th>
        Required/Optional
      </th>

      <th>
        Constraints
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        Authorization
      </td>

      <td>
        Access Token for the application
      </td>

      <td>
        `{{PARTNER_APP_TOKEN}}`
      </td>

      <td>
        String
      </td>

      <td>
        Required
      </td>

      <td>
        Should be a valid Partner App Access Token
      </td>
    </tr>

    <tr>
      <td>
        src
      </td>

      <td>
        Source Phone Number
      </td>

      <td>
        `{{SOURCE}}`
      </td>

      <td>
        Integer
      </td>

      <td>
        Required
      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        sandbox
      </td>

      <td>
        Boolean value
      </td>

      <td>
        `{SANDBOX}`
      </td>

      <td>
        Boolean
      </td>

      <td>
        Optional
      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        destination
      </td>

      <td>
        Destination Phone Number
      </td>

      <td>
        `{{DESTINATION}}`
      </td>

      <td>
        Integer
      </td>

      <td>
        Required
      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        message
      </td>

      <td>
        Message Json
      </td>

      <td>
        `{           "recipient_type": "individual",           "preview_url": false,           "to": "919970754444",           "type": "location",           "location":{                 "name":"R. 7 de Abril - República",                 "address":"São Paulo - SP, Brazil",              "longitude":-46.6444751,"latitude":-23.5463588           },   "caption":"The location for the event is Hadapsar,Pune",           "channel": "whatsapp"       }`
      </td>

      <td>
        String
      </td>

      <td>
        Required
      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        APP\_ID
      </td>

      <td>
        App ID to fetch the access token
      </td>

      <td>
        `{{APP_ID}}`
      </td>

      <td>
        String
      </td>

      <td>
        Required
      </td>

      <td>
        - The Id should be a valid app Id of Gupshup. - The App must be associated with the account that owns the PARTNER\_APP\_TOKEN being used.
      </td>
    </tr>

    <tr>
      <td>
        userId
      </td>

      <td>
        BSUID
      </td>

      <td>
        {{userId}}
      </td>

      <td>

      </td>

      <td>

      </td>

      <td>

      </td>
    </tr>
  </tbody>
</Table>

## Sample Request

```curl
curl --location 'https://partner.gupshup.io/partner/app/07c7c72d-20e3-4ff9-a5a1-14d1186eeec8/template/msg' \
--header 'Connection: keep-alive' \
--header 'Authorization: sk_8eb35b1f81c24af293a405164a392f30' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source=917835039205' \
--data-urlencode 'sandbox=false' \
--data-urlencode 'destination=919970754444' \
--data-urlencode 'template={"id": "f7163aa4-b0fa-4a4e-8478-13d75e08ed4a","params": []}' \
--data-urlencode 'src.name=PartnerPortal' \
--data-urlencode 'userId={{BSUID}}' \
--data-urlencode 'message={"type":"LOCATION","LOCATION":{\"example\":\"The place for the event is kothrud,Pune\"}}'	
```

## Sample Response

```json
{
    "status": "submitted",
    "messageId": "d255d161-2d9e-455a-8776-9f64d0291e36"
}	
```

## Status Codes

| Status Code | Response                                                                                                                                                     | Comments               |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- |
| **Success** |                                                                                                                                                              |                        |
| 200         | `{       "status": "submitted",       "messageId": "d255d161-2d9e-455a-8776-9f64d0291e36"   }`                                                               |                        |
| **Error**   |                                                                                                                                                              |                        |
| 429         | `{     "status": "error",     "message": "Too Many Requests"   }`                                                                                            | 10 Requests per Minute |
| 500         | `{     "status": "error",     "message": "Internal server error. Please try again later. If the issue still persists, then contact Gupshup Dev Support"   }` | For any Internal Error |

<br />

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Send Message With Location Template",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io"
    }
  ],
  "paths": {
    "/partner/app/{appId}/msg": {
      "post": {
        "tags": [
          "default"
        ],
        "summary": "Location",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "msg",
                  "src"
                ],
                "properties": {
                  "msg": {
                    "type": "string",
                    "description": "Message Json",
                    "example": "{\n        \"recipient_type\": \"individual\",\n        \"preview_url\": false,\n        \"to\": \"919970754444\",\n        \"type\": \"location\",\n        \"location\":{\n              \"name\":\"R. 7 de Abril - República\",\n              \"address\":\"São Paulo - SP, Brazil\",\n           \"longitude\":-46.6444751,\"latitude\":-23.5463588\n        },\n\"caption\":\"The location for the event is Hadapsar,Pune\",\n        \"channel\": \"whatsapp\"\n    }"
                  },
                  "sandbox": {
                    "type": "boolean",
                    "description": "Boolean Value",
                    "example": "false"
                  },
                  "src": {
                    "type": "integer",
                    "description": "Source Phone Number",
                    "example": "918929874278"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Your app token, please refer [**Get access token api**](https://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": {
                    "status": {
                      "type": "string",
                      "example": "submitted"
                    },
                    "messageId": {
                      "type": "string",
                      "example": "183dc8f1-7ecc-4419-895f-04fd0b1bfe07"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Use this API to send messages with the Location template."
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```