Quickstart
Get up and running with HueChat API in 5 minutes.
Prerequisites
- HueChat account (sign up free)
- cURL or any HTTP client
Step 1: Get Your API Key
- Log into HueChat Dashboard
- Go to Settings > API Keys
- Click Create API Key
- Copy your key (format:
sk_live_xxxorsk_test_xxx)
Use Test Keys for Development
Test keys (sk_test_xxx) work with the sandbox environment and don't send real messages.
Step 2: Make Your First Request
Let's create a contact:
curl -X POST https://api.huechat.ai/v2/contact \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1234567890",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"preferred_channel": "whatsapp"
}'
Response:
{
"id": "cnt_1a2b3c4d5e6f",
"phone": "+1234567890",
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"preferred_channel": "whatsapp",
"status": "active",
"created_at": "2026-01-25T14:20:00Z"
}
Step 3: Send a Message
Send a WhatsApp message to your new contact:
curl -X POST https://api.huechat.ai/v2/contact/cnt_1a2b3c4d5e6f/message \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"channel": "whatsapp",
"message_type": "text",
"content": "Hello! Welcome to our service."
}'
Response:
{
"id": "msg_abc123xyz",
"conversation_id": "conv_xyz123",
"contact_id": "cnt_1a2b3c4d5e6f",
"channel": "whatsapp",
"content": "Hello! Welcome to our service.",
"status": "sent",
"sent_at": "2026-01-25T15:45:00Z"
}
Step 4: View Conversations
List your open conversations:
curl https://api.huechat.ai/v2/conversations?status=open \
-H "X-API-Key: sk_live_your_api_key_here"
Response:
{
"data": [
{
"id": "conv_xyz123",
"contact_id": "cnt_1a2b3c4d5e6f",
"channel": "whatsapp",
"status": "open",
"message_count": 1,
"created_at": "2026-01-25T15:44:00Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 1,
"has_more": false
}
}
Step 5: Set Up Webhooks (Optional)
Receive real-time notifications when events happen:
curl -X POST https://api.huechat.ai/v2/webhooks \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/webhooks/huechat",
"events": ["message.received", "conversation.created"]
}'
Next Steps
- API Keys - Learn about API key management
- Send WhatsApp Messages - Detailed messaging guide
- Webhooks - Real-time event handling
- API Reference - Full endpoint documentation