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

# Enviar mensagem de localização.

> Compartilha latitude e longitude com o contato.

<Badge size="lg" shape="rounded" color="green" stroke color="green">POST</Badge> /message/location

<CodeGroup>
  ```javascript Node.js theme={null}
  await zap.sendMessageLocation('my-session-id', {
    to: '5564999999999',
    latitude: -16.7033,
    longitude: -49.263,
  });
  ```

  ```python python.py theme={null}
  zap = LoceZap(API_KEY)
  zap.send_message_location("SESSION_ID", "5511973495909", latitude=-16.7033, longitude=-49.263)
  ```

  ```curl curl theme={null}
  curl --request POST \
    --url https://apizap.loce.io/v1/message/location \
    --header 'Authorization: Bearer lz_xxxxxxxxxx' \
    --header 'Content-Type: application/json'
    --data '{
    "sessionId": "string",
    "phone": "string",
    "latitude": 0,
    "longitude": 0,
    "quoteId": "string"
  }'
  ```
</CodeGroup>


## OpenAPI

````yaml POST /message/location
openapi: 3.1.0
info:
  title: Loce Zap API
  description: >-
    API REST para conectar sessões do WhatsApp e enviar mensagens de texto,
    mídia e automações via Loce Zap.
  version: 1.0.0
servers:
  - url: https://apizap.loce.io/v1
    description: Ambiente de produção
security:
  - bearerAuth: []
paths:
  /message/location:
    post:
      summary: Enviar localização
      description: Compartilha latitude e longitude com o contato.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationMessageRequest'
      responses:
        '200':
          description: Localização enviada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
components:
  schemas:
    LocationMessageRequest:
      allOf:
        - $ref: '#/components/schemas/MessageBase'
        - type: object
          required:
            - latitude
            - longitude
          properties:
            latitude:
              type: number
              format: double
            longitude:
              type: number
              format: double
    MessageResponse:
      type: object
      properties:
        messageId:
          type: string
        sessionId:
          type: string
        phone:
          type: string
        type:
          type: string
        status:
          type: string
        quoteId:
          type: string
        createdAt:
          type: string
          format: date-time
    MessageBase:
      type: object
      required:
        - sessionId
        - phone
      properties:
        sessionId:
          type: string
          description: Sessão que enviará a mensagem.
        phone:
          type: string
          description: Destino no formato MSISDN com DDI e DDD.
        quoteId:
          type: string
          description: ID da mensagem original quando for uma resposta.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````