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

# Send Location

> Send a location pin to an existing contact.

## Basic Usage

```bash theme={null}
curl -X POST "https://api.flowiq.live/send-whatsapp" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+27123456789",
    "message_type": "location",
    "location": {
      "latitude": -33.9249,
      "longitude": 18.4241,
      "name": "Cape Town Office",
      "address": "123 Main Street, Cape Town"
    }
  }'
```

***

## Request Body

| Field                | Type   | Required | Description                              |
| -------------------- | ------ | -------- | ---------------------------------------- |
| `phone_number`       | string | Yes      | Recipient phone number with country code |
| `message_type`       | string | Yes      | Must be `"location"`                     |
| `location.latitude`  | number | Yes      | Latitude coordinate                      |
| `location.longitude` | number | Yes      | Longitude coordinate                     |
| `location.name`      | string | No       | Location name shown to the recipient     |
| `location.address`   | string | No       | Full address shown to the recipient      |
| `context_message_id` | string | No       | WhatsApp message ID to reply to          |

```json theme={null}
{
  "phone_number": "+27123456789",
  "message_type": "location",
  "location": {
    "latitude": -33.9249,
    "longitude": 18.4241,
    "name": "Cape Town Office",
    "address": "123 Main Street, Cape Town"
  }
}
```

***

## Response

### Success (200)

```json theme={null}
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "message_id": "wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...",
    "recipient": "27123456789",
    "message_type": "location"
  }
}
```

### Error: Missing Required Field (400)

```json theme={null}
{
  "error": "Missing required field",
  "message": "location.latitude and location.longitude are required for location messages"
}
```

***

## Integration Example

```javascript theme={null}
async function sendLocation(apiKey, phoneNumber, location) {
  const response = await fetch(
    `https://api.flowiq.live/send-whatsapp`,
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ phone_number: phoneNumber, message_type: "location", location }),
    }
  );
  const data = await response.json();
  if (!response.ok) throw new Error(data.message);
  return data;
}
```


## OpenAPI

````yaml flowiq-api-reference/openapi-send-location.json POST /send-whatsapp
openapi: 3.1.0
info:
  title: FlowIQ - Send Location
  version: 1.0.0
servers:
  - url: https://api.flowiq.live
    description: FlowIQ Production API
security:
  - BearerAuth: []
paths:
  /send-whatsapp:
    post:
      tags:
        - Endpoints
      summary: Send Location
      description: Send a location pin to an existing contact.
      operationId: sendLocationMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                phone_number:
                  type: string
                  description: Recipient phone number with country code
                  example: '+27123456789'
                message_type:
                  type: string
                  enum:
                    - location
                  description: Must be "location"
                  example: location
                location:
                  type: object
                  description: Location coordinates and details
                  properties:
                    latitude:
                      type: number
                      description: Latitude coordinate
                      example: -33.9249
                    longitude:
                      type: number
                      description: Longitude coordinate
                      example: 18.4241
                    name:
                      type: string
                      description: Location name
                      example: Cape Town Office
                    address:
                      type: string
                      description: Location address
                      example: 123 Main Street, Cape Town
                  required:
                    - latitude
                    - longitude
                context_message_id:
                  type: string
                  description: WhatsApp message ID to reply to
                  example: wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...
              required:
                - phone_number
                - message_type
                - location
      responses:
        '200':
          description: Message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Message sent successfully
                  data:
                    type: object
                    properties:
                      message_id:
                        type: string
                        example: wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...
                      recipient:
                        type: string
                        example: '27123456789'
                      message_type:
                        type: string
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Bearer token for authentication. Format: `Bearer YOUR_BEARER_TOKEN`'
      bearerFormat: JWT

````