Skip to main content
Organizations with multiple WhatsApp numbers can control which instance sends each message using the from parameter.

How It Works

When your organization has multiple connected WhatsApp instances:
  1. Without from: API selects the most recently connected instance
  2. With from: API uses the specified instance

Specifying the Sender

The from parameter accepts two formats:
FormatExampleDescription
Phone number5585912345678WhatsApp number without + or @
Instance IDuuid-xxx-xxxInternal instance identifier
Phone numbers are the recommended format as they’re easier to remember and manage.

Example Usage

Send from a specific number

curl -X POST https://api.livchat.ai/v1/messages/send \
  -H "Authorization: Bearer lc_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "5511999999999",
    "body": "Message from Sales department",
    "from": "5585912345678"
  }'

Use different numbers for different purposes

// Sales messages from sales number
await api.send({
  phone: customerPhone,
  body: "Your order has been confirmed!",
  from: SALES_WHATSAPP_NUMBER,
});

// Support messages from support number
await api.send({
  phone: customerPhone,
  body: "Your ticket #123 has been resolved",
  from: SUPPORT_WHATSAPP_NUMBER,
});

Default Behavior

If you don’t specify from:
  • Single instance: The only available instance is used
  • Multiple instances: The most recently connected instance is automatically selected
For organizations with multiple numbers, we recommend always specifying from to ensure predictable behavior.

Error Handling

If you specify an invalid from value:
{
  "error": {
    "code": 403,
    "message": "Instance not found or not authorized: 5500000000000",
    "hint": "Use a valid phone number or instance ID from your organization"
  }
}

Best Practices

Use environment variables

Store your WhatsApp numbers in environment variables for easy management across environments.

Map numbers to departments

Create a mapping of department names to phone numbers for cleaner code.

Always specify from

For multi-instance orgs, always specify from to avoid unexpected behavior.

Monitor instance status

Ensure your instances are connected before sending messages.