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
Path Parameters
The name of your WhatsApp instance that you created
Request Body
The recipient’s WhatsApp number in international format (without + symbol)Example:
5511999999999 for a Brazilian numberThe latitude coordinate of the locationExample:
-23.550520 (São Paulo, Brazil)The longitude coordinate of the locationExample:
-46.633308 (São Paulo, Brazil)The name of the location or placeExample:
Paulista AvenueThe full address of the locationExample:
Av. Paulista, 1578 - Bela Vista, São Paulo - SP, BrazilDelay before sending the message in millisecondsExample:
1000 for 1 second delayQuote a previous message by providing its key and message object
Mention all participants in a groupDefault:
falseArray of phone numbers to mention. Each number should be a numeric string.Example:
["5511999999999", "5511888888888"]Response
Message key information
The sent message object containing the location data
Unix timestamp when the message was sent
Message status (e.g., “PENDING”, “SENT”)
Code Examples
Advanced Examples
Send location of a restaurant
Send location of a restaurant
Send location with mentions
Send location with mentions
Send location as reply
Send location as reply
Location Coordinates Guide
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)
How to Get Coordinates
-
Google Maps:
- Right-click on a location
- Click on the coordinates to copy them
- Format: latitude, longitude
-
GPS Devices:
- Most GPS devices provide latitude and longitude
- Ensure they’re in decimal format (not degrees/minutes/seconds)
-
Geolocation API:
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:- Recipients see a map preview with a pin
- The location name appears as a title
- The address appears as a subtitle
- Tapping the message opens the location in their default maps app
- Recipients can get directions to the location
Error Responses
HTTP status code
Error description
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 |
Latitude and longitude should be sent as numbers, not strings. Ensure your JSON payload uses numeric types for these values.