> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/EvolutionAPI/evolution-api/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Location Message

> Send geographic location coordinates to WhatsApp contacts via Evolution API

## Send Location Message

Send a location message with latitude, longitude, and optional name and address to WhatsApp contacts or groups. The location will be displayed as a map pin in the chat.

### Endpoint

```
POST /message/sendLocation/:instanceName
```

### Path Parameters

<ParamField path="instanceName" type="string" required>
  The name of your WhatsApp instance that you created
</ParamField>

### Request Body

<ParamField body="number" type="string" required>
  The recipient's WhatsApp number in international format (without + symbol)

  Example: `5511999999999` for a Brazilian number
</ParamField>

<ParamField body="latitude" type="number" required>
  The latitude coordinate of the location

  Example: `-23.550520` (São Paulo, Brazil)
</ParamField>

<ParamField body="longitude" type="number" required>
  The longitude coordinate of the location

  Example: `-46.633308` (São Paulo, Brazil)
</ParamField>

<ParamField body="name" type="string" required>
  The name of the location or place

  Example: `Paulista Avenue`
</ParamField>

<ParamField body="address" type="string" required>
  The full address of the location

  Example: `Av. Paulista, 1578 - Bela Vista, São Paulo - SP, Brazil`
</ParamField>

<ParamField body="delay" type="integer" optional>
  Delay before sending the message in milliseconds

  Example: `1000` for 1 second delay
</ParamField>

<ParamField body="quoted" type="object" optional>
  Quote a previous message by providing its key and message object

  <expandable title="quoted properties">
    <ParamField body="quoted.key" type="object" required>
      <expandable title="key properties">
        <ParamField body="quoted.key.id" type="string" required>
          The message ID to quote
        </ParamField>

        <ParamField body="quoted.key.remoteJid" type="string" optional>
          The JID of the chat where the message was sent
        </ParamField>

        <ParamField body="quoted.key.fromMe" type="boolean" optional>
          Whether the quoted message was sent by you
        </ParamField>
      </expandable>
    </ParamField>

    <ParamField body="quoted.message" type="object" required>
      The original message object being quoted
    </ParamField>
  </expandable>
</ParamField>

<ParamField body="mentionsEveryOne" type="boolean" optional>
  Mention all participants in a group

  Default: `false`
</ParamField>

<ParamField body="mentioned" type="array" optional>
  Array of phone numbers to mention. Each number should be a numeric string.

  Example: `["5511999999999", "5511888888888"]`
</ParamField>

### Response

<ResponseField name="key" type="object">
  Message key information

  <expandable title="key properties">
    <ResponseField name="key.remoteJid" type="string">
      The JID of the recipient
    </ResponseField>

    <ResponseField name="key.fromMe" type="boolean">
      Always true for sent messages
    </ResponseField>

    <ResponseField name="key.id" type="string">
      Unique message identifier
    </ResponseField>
  </expandable>
</ResponseField>

<ResponseField name="message" type="object">
  The sent message object containing the location data

  <expandable title="message properties">
    <ResponseField name="message.locationMessage" type="object">
      <expandable title="locationMessage properties">
        <ResponseField name="degreesLatitude" type="number">
          The latitude coordinate
        </ResponseField>

        <ResponseField name="degreesLongitude" type="number">
          The longitude coordinate
        </ResponseField>

        <ResponseField name="name" type="string">
          The location name
        </ResponseField>

        <ResponseField name="address" type="string">
          The location address
        </ResponseField>
      </expandable>
    </ResponseField>
  </expandable>
</ResponseField>

<ResponseField name="messageTimestamp" type="string">
  Unix timestamp when the message was sent
</ResponseField>

<ResponseField name="status" type="string">
  Message status (e.g., "PENDING", "SENT")
</ResponseField>

### Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://your-api-url.com/message/sendLocation/my-instance \
    -H "Content-Type: application/json" \
    -H "apikey: YOUR_API_KEY" \
    -d '{
      "number": "5511999999999",
      "latitude": -23.550520,
      "longitude": -46.633308,
      "name": "Paulista Avenue",
      "address": "Av. Paulista, 1578 - Bela Vista, São Paulo - SP, Brazil"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://your-api-url.com/message/sendLocation/my-instance', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      number: '5511999999999',
      latitude: -23.550520,
      longitude: -46.633308,
      name: 'Paulista Avenue',
      address: 'Av. Paulista, 1578 - Bela Vista, São Paulo - SP, Brazil'
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = 'https://your-api-url.com/message/sendLocation/my-instance'
  headers = {
      'Content-Type': 'application/json',
      'apikey': 'YOUR_API_KEY'
  }
  payload = {
      'number': '5511999999999',
      'latitude': -23.550520,
      'longitude': -46.633308,
      'name': 'Paulista Avenue',
      'address': 'Av. Paulista, 1578 - Bela Vista, São Paulo - SP, Brazil'
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => 'https://your-api-url.com/message/sendLocation/my-instance',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode([
      'number' => '5511999999999',
      'latitude' => -23.550520,
      'longitude' => -46.633308,
      'name' => 'Paulista Avenue',
      'address' => 'Av. Paulista, 1578 - Bela Vista, São Paulo - SP, Brazil'
    ]),
    CURLOPT_HTTPHEADER => [
      'Content-Type: application/json',
      'apikey: YOUR_API_KEY'
    ],
  ]);

  $response = curl_exec($curl);
  curl_close($curl);
  echo $response;
  ?>
  ```
</CodeGroup>

### Advanced Examples

<Accordion title="Send location of a restaurant">
  ```json theme={null}
  {
    "number": "5511999999999",
    "latitude": 40.758896,
    "longitude": -73.985130,
    "name": "Times Square",
    "address": "Manhattan, NY 10036, United States"
  }
  ```
</Accordion>

<Accordion title="Send location with mentions">
  ```json theme={null}
  {
    "number": "5511999999999-1234567890@g.us",
    "latitude": -23.550520,
    "longitude": -46.633308,
    "name": "Meeting Point",
    "address": "Av. Paulista, 1578 - Bela Vista, São Paulo - SP",
    "mentioned": ["5511888888888", "5511777777777"]
  }
  ```
</Accordion>

<Accordion title="Send location as reply">
  ```json theme={null}
  {
    "number": "5511999999999",
    "latitude": 51.507351,
    "longitude": -0.127758,
    "name": "Big Ben",
    "address": "Westminster, London SW1A 0AA, UK",
    "quoted": {
      "key": {
        "id": "BAE5F2D3E4F5A6B7",
        "remoteJid": "5511999999999@s.whatsapp.net",
        "fromMe": false
      },
      "message": {
        "conversation": "Where should we meet?"
      }
    }
  }
  ```
</Accordion>

## Location Coordinates Guide

<Note>
  Latitude and longitude values must be valid geographic coordinates:

  * **Latitude**: -90 to +90 (negative for South, positive for North)
  * **Longitude**: -180 to +180 (negative for West, positive for East)
</Note>

### How to Get Coordinates

1. **Google Maps**:
   * Right-click on a location
   * Click on the coordinates to copy them
   * Format: latitude, longitude

2. **GPS Devices**:
   * Most GPS devices provide latitude and longitude
   * Ensure they're in decimal format (not degrees/minutes/seconds)

3. **Geolocation API**:
   ```javascript theme={null}
   navigator.geolocation.getCurrentPosition((position) => {
     console.log('Latitude:', position.coords.latitude);
     console.log('Longitude:', position.coords.longitude);
   });
   ```

### Coordinate Format Examples

| City              | Latitude | Longitude |
| ----------------- | -------- | --------- |
| New York, USA     | 40.7128  | -74.0060  |
| London, UK        | 51.5074  | -0.1278   |
| Tokyo, Japan      | 35.6762  | 139.6503  |
| Sydney, Australia | -33.8688 | 151.2093  |
| São Paulo, Brazil | -23.5505 | -46.6333  |

## Location Display in WhatsApp

When you send a location message:

1. Recipients see a map preview with a pin
2. The location name appears as a title
3. The address appears as a subtitle
4. Tapping the message opens the location in their default maps app
5. Recipients can get directions to the location

<Warning>
  All four parameters (latitude, longitude, name, and address) are required. If any are missing, the API will return a 400 Bad Request error.
</Warning>

## Error Responses

<ResponseField name="status" type="number">
  HTTP status code
</ResponseField>

<ResponseField name="message" type="string">
  Error description
</ResponseField>

### Common Errors

| Status Code | Error Message                         | Solution                                                                             |
| ----------- | ------------------------------------- | ------------------------------------------------------------------------------------ |
| 400         | Bad Request - Missing required fields | Ensure all required fields (number, latitude, longitude, name, address) are provided |
| 400         | Invalid latitude/longitude values     | Check that coordinates are within valid ranges                                       |
| 401         | Unauthorized                          | Check your API key                                                                   |
| 404         | Not Found                             | Verify instance exists and is connected                                              |
| 500         | Internal Server Error                 | Check server logs or contact support                                                 |

<Note>
  Latitude and longitude should be sent as numbers, not strings. Ensure your JSON payload uses numeric types for these values.
</Note>
