> ## Documentation Index
> Fetch the complete documentation index at: https://developer.omni.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send location

> Send location messages

export const ChannelSupport = ({whatsapp = 'yes', web = 'yes', instagram = 'yes', messenger = 'yes', telegram = 'yes', lang = 'pt'}) => {
  const L = ({
    pt: {
      title: 'Disponibilidade por canal',
      win: 'No WhatsApp Oficial exige a janela de 24 horas aberta. Nos outros canais não há janela.',
      names: ['WhatsApp Oficial', 'WhatsApp Web', 'Instagram', 'Messenger', 'Telegram']
    },
    en: {
      title: 'Availability per channel',
      win: 'On WhatsApp Official it requires the 24-hour window to be open. The other channels have no window.',
      names: ['WhatsApp Official', 'WhatsApp Web', 'Instagram', 'Messenger', 'Telegram']
    },
    es: {
      title: 'Disponibilidad por canal',
      win: 'En WhatsApp Oficial exige que la ventana de 24 horas esté abierta. Los demás canales no tienen ventana.',
      names: ['WhatsApp Oficial', 'WhatsApp Web', 'Instagram', 'Messenger', 'Telegram']
    }
  })[lang];
  const mark = v => v === 'yes' ? '✅' : v === 'partial' ? '⚠️' : '❌';
  const vals = [whatsapp, web, instagram, messenger, telegram];
  return <div>
      <p><strong>{L.title}</strong></p>
      <table>
        <thead>
          <tr>{L.names.map(n => <th key={n} style={{
    textAlign: 'center'
  }}>{n}</th>)}</tr>
        </thead>
        <tbody>
          <tr>{vals.map((v, i) => <td key={i} style={{
    textAlign: 'center'
  }}>{mark(v)}</td>)}</tr>
        </tbody>
      </table>
      {whatsapp === 'yes' && <p>{L.win}</p>}
    </div>;
};

## Overview

Sends a location message to a contact. The `content.type` field must be `LOCATION` and the coordinates are provided in the `attachments` array using `latitude` and `longitude`.

The `name` and `address` fields are optional and allow displaying the place name and address directly in the message.

<Warning>
  The API does not validate the `latitude` and `longitude` fields. Requests without these values will be accepted, but the message will not display the location correctly on WhatsApp. Always provide both fields.
</Warning>

<ChannelSupport lang="en" instagram="no" messenger="no" />

<Note>
  Details of the WhatsApp Official rule in [conversation window](/en/conversation-window). See the [capability matrix](/en/channels/overview) for every channel.
</Note>


## OpenAPI

````yaml en/messages/openapi-location.json POST /v1/channels/{channelId}/messages
openapi: 3.1.0
info:
  title: Omni Z-API - Send Location
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/messages:
    post:
      tags:
        - Messages
      summary: Send location
      description: >-
        Sends a location message. Only works when the 24-hour conversation
        window is open.
      operationId: sendLocationMessage
      parameters:
        - name: channelId
          in: path
          required: true
          description: Channel ID
          schema:
            type: string
            example: YOUR_CHANNEL_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendLocationRequest'
            example:
              recipient:
                identifier: '5544936181064'
                name: Recipient Name
                subject: Title
                picture: ''
              sender:
                identifier: '5544936181064'
                name: Sender Name
                picture: ''
              content:
                type: LOCATION
                attachments:
                  - name: Google Brasil
                    address: >-
                      Av. Brg. Faria Lima, 3477 - Itaim Bibi, São Paulo - SP,
                      04538-133
                    latitude: '-23.0696347'
                    longitude: '-50.4357913'
      responses:
        '200':
          $ref: '#/components/responses/MessageSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/WindowClosed'
components:
  schemas:
    SendLocationRequest:
      type: object
      required:
        - recipient
        - content
      properties:
        recipient:
          type: object
          required:
            - identifier
          description: Recipient data
          properties:
            identifier:
              type: string
              description: Recipient phone number (country code + area code + number)
              example: '5544936181064'
            name:
              type: string
              description: Recipient name (optional)
              example: Recipient Name
            subject:
              type: string
              description: Title or subject (optional)
              example: Title
            picture:
              type: string
              description: Recipient profile picture URL (optional)
              example: ''
        sender:
          type: object
          description: Sender data (optional)
          properties:
            identifier:
              type: string
              description: Sender phone number
              example: '5544936181064'
            name:
              type: string
              description: Sender name
              example: Sender Name
            picture:
              type: string
              description: Sender profile picture URL
              example: ''
        content:
          type: object
          required:
            - type
            - attachments
          properties:
            type:
              type: string
              description: Message type
              enum:
                - LOCATION
            attachments:
              type: array
              description: List with location data
              items:
                type: object
                properties:
                  latitude:
                    type: string
                    description: >-
                      Location latitude. Not validated by the API, but required
                      for the pin to display correctly on WhatsApp.
                    example: '-23.0696347'
                  longitude:
                    type: string
                    description: >-
                      Location longitude. Not validated by the API, but required
                      for the pin to display correctly on WhatsApp.
                    example: '-50.4357913'
                  name:
                    type: string
                    description: Place name (optional)
                    example: Google Brasil
                  address:
                    type: string
                    description: Place address (optional)
                    example: >-
                      Av. Brg. Faria Lima, 3477 - Itaim Bibi, São Paulo - SP,
                      04538-133
    MessageResponse:
      type: object
      properties:
        messageId:
          type: string
          description: Sent message ID
    Error:
      type: object
      properties:
        error:
          type: integer
        message:
          type: string
  responses:
    MessageSuccess:
      description: Message sent successfully
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            messageId: wamid.HBgNNTU0NDk3MDUwNzg1FQIAERgSM0
    Unauthorized:
      description: Invalid or missing token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 401
            message: Unauthorized
    WindowClosed:
      description: 24-hour conversation window is closed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 422
            message: Conversation window is closed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generated in the Omni Z-API Security panel

````