← Back to API Dashboard

XEELAA API Key Guide

Everything you need to know about using the XEELAA API — from creation to building your own platform

1. Overview — What You Can Build

XEELAA's API v2 gives you full programmatic access to every feature on the platform. With 39+ endpoints covering chatbots, conversations, AI chat, WhatsApp, video studio, audio, webhooks, and more — you can build your own applications on top of XEELAA.

🤖 Custom AI Applications

Build your own AI-powered customer support, sales assistants, or automation tools using XEELAA's AI engine with your own UI.

📱 WhatsApp Integrations

Connect WhatsApp accounts, manage conversations, and send messages programmatically. Build WhatsApp bots that work 24/7.

🎬 Media Generation

Generate videos, audio, and images through the API. Integrate AI media creation into your own workflow or platform.

NEW

2. API v2 — Global Standard

API v2 is the next-generation XEELAA REST API. It uses key_id:secret authentication, pay-as-you-go credit billing, IP whitelisting, webhooks, and provides access to every platform feature.

Base URL

https://xeelaa.com/api/v2

Authentication

Authorization: Bearer xla_key_id:your_secret
⚠️

Key Format Change

API v2 uses a two-part key format: a public key_id (starts with xla_) and a private secret. You send them together as key_id:secret in the Authorization header. The secret is shown only once at creation, just like before.

Available Endpoints (39 total)

System: GET /verify, GET /usage
Account: GET /me
API Keys: CRUD + regenerate + revoke
Chatbots: CRUD + settings + crawl
Conversations: CRUD + handoff + search
Messages: List + send (with AI response)
Documents: CRUD
AI Chat: POST /ai/chat
WhatsApp: Accounts + conversations + send
Video: List projects + details
Skills: List all skills
Webhooks: Deliveries + test

3. How Authentication Works

API v2 (Recommended): key_id:secret

Each API key has two parts:

key_id:xla_FIf5ikEkuduD(public identifier, starts with xla_)
secret:sk_4e84b070d416bf31322e1cf311c1b6db(private, shown once)
full_key:xla_FIf5ikEkuduD:sk_4e84b070d416bf31322e1cf311c1b6db

Authentication Flow

1.Your app sends: Authorization: Bearer xla_keyId:secret
2.XEELAA splits the key into key_id and secret, looks up the key by key_id
3.XEELAA validates: hash(key_id + ':' + secret) matches stored hash
4.Checks: active status, not expired, quota not exceeded, sufficient credit balance, IP allowed, domain allowed
5.If valid → request proceeds, usage counted, credits burned on success (1 per request), rate limit headers returned
6.Out of credits → 402 Payment Required with your balance and the amount needed

Rate Limit Headers

Every API response includes: X-RateLimit-Limit (max requests/min), X-RateLimit-Remaining (remaining in current window), and X-RateLimit-Reset (when the window resets).

4. Quick Start

Try the API in 30 seconds. No authentication needed for the verify endpoint:

Step 1: Test connectivity (public)

curl https://xeelaa.com/api/v2/verify

Step 2: Create an API key (via UI)

Go to API Dashboard → Create New Key → Copy the full key shown once.

Step 3: Test with your key

curl -H "Authorization: Bearer xla_yourKeyId:yourSecret" https://xeelaa.com/api/v2/me

Step 4: List your chatbots

curl -H "Authorization: Bearer xla_yourKeyId:yourSecret" https://xeelaa.com/api/v2/chatbots

Step 5: Get a chatbot's greeting (conversation starter)

curl -H "Authorization: Bearer xla_yourKeyId:yourSecret" https://xeelaa.com/api/v2/chatbots/{id}/settings

Returns greeting message, quick replies, theme color, position, and all widget settings — everything you need to start a conversation in your own UI.

5. Creating an API Key

You can create API keys from the dashboard or programmatically via the API.

Via Dashboard

  1. Go to API Dashboard
  2. Fill in the key name
  3. Optionally set a platform URL and expiry
  4. Click "Generate Key"
  5. Copy the key immediately — it's shown once

Via API v2

curl -X POST https://xeelaa.com/api/v2/api-keys \
-H "Authorization: Bearer existing_key:secret" \
-H "Content-Type: application/json" \
-d '{"name": "My App", "test_mode": true}'
⚠️

Secret Shown Only Once

The key_id:secret combination is displayed only at creation. After that, only the hashed version is stored. If you lose the secret, you must regenerate it.

6. Billing & Rate Limits

The API is billed with pay-as-you-go credits. Every API request burns credits from your account balance. Test-mode keys never burn credits. Top up any time from the API Dashboard or pricing page.

API Request

1 credit

per authenticated request, charged only on success. 402 Payment Required if your balance runs out.

Task Execution

Proxied

1 credits

POST /api/v1/execute burns these on top of the per-request charge when the proxied call succeeds.

🧪 Test Mode

Free

Requests never burn credits or count toward usage. Enable on each key from the key detail page.

Rate Limits

All keys share a platform baseline of 60 requests/minute. Responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers.

7. Permissions (28 Scopes)

Permissions control what each API key can access. If no permissions are set, all are granted. Once any permission is added, the key is restricted to only those listed.

Permission Allows
chatbots:readView chatbot details and list chatbots
chatbots:writeCreate, update, delete chatbots
chatbots:trainTrain chatbots with documents and URL crawl
conversations:readView conversations and messages
conversations:writeSend messages to conversations
conversations:handoffRequest human agent handoff
documents:readView knowledge base documents
documents:writeUpload and manage documents
ai:chatUse the AI chat endpoint
ai:imageGenerate images via AI
ai:voiceUpload and transcribe voice
ai:searchPerform web searches
whatsapp:readView WhatsApp accounts and conversations
whatsapp:writeSend WhatsApp messages
whatsapp:manageConnect and disconnect WhatsApp accounts
whatsapp:trainManage WhatsApp training data
video:readView video projects and scenes
video:writeCreate and manage video projects
video:renderSubmit and manage video renders
audio:generateGenerate audio, voice, effects
audio:processMaster, spatialize, analyze audio
api-keys:readView API keys
api-keys:writeCreate and revoke API keys
webhooks:manageConfigure webhook endpoints and events
account:readView account and profile information
account:writeUpdate account settings
memory:readAccess conversation memory and embeddings
memory:writeStore conversation memories

8. Webhooks

Webhooks let XEELAA notify your platform when events happen. Configure a webhook URL on your API key's detail page, then choose which events to subscribe to.

How Webhooks Work

1.An event occurs (e.g., a message is received in a conversation)
2.XEELAA checks the API key's webhook configuration
3.If the event is subscribed and a webhook URL is set, a POST request is sent
4.The payload contains the event type and relevant data
5.XEELAA expects a 2xx response. Delivery history is recorded.

Supported Events

message.received message.sent conversation.created conversation.handoff whatsapp.message_received whatsapp.account_connected whatsapp.account_disconnected chatbot.created chatbot.updated chatbot.deleted

Webhook Headers

Each webhook POST includes these headers:

X-Webhook-Event — The event type (e.g., message.received)
X-Webhook-ID — Unique delivery ID
X-Webhook-Timestamp — When the event occurred (Unix timestamp)
User-Agent — XEELAA-Webhook/1.0

Test Your Webhook

Use the POST /api/v2/webhooks/test endpoint to send a test ping to your configured webhook URL. Check GET /api/v2/webhooks/deliveries to see delivery history.

9. Security Features

🔒 IP Whitelisting

Restrict API key usage to specific IP addresses or CIDR ranges. Requests from non-whitelisted IPs are rejected with 403. Leave empty to allow all IPs.

203.0.113.1 198.51.100.0/24

🌐 Domain Restrictions

Restrict API key usage to requests coming from specific domains (Origin/Referer headers). Useful when your frontend calls the API directly.

myapp.com myotherdomain.com

🧪 Test Mode

When enabled, API requests don't count toward usage quota or burn credits. Perfect for development and testing. Toggle on/off on the key detail page.

X-RateLimit-Remaining stays unchanged

10. Managing Your API Keys

✏️ Edit

Click a key name to edit its name, permissions, webhook URL, IP whitelist, domains, test mode, and skills.

🔄 Regenerate

Creates a new secret. The old key_id:secret stops working immediately. New secret shown once.

🚫 Revoke

Disables the key immediately. Status changes to "revoked". Irreversible — create a new key to restore access.

🗑️ Delete

Permanently removes a revoked key from the database. Only available after the key has been revoked.

11. Best Practices

✓ Separate Keys Per Environment

Create one key for dev, staging, and production. If one is compromised, rotate only that one.

✓ Use Descriptive Names

"Production App", "CI/CD Pipeline", "Backend Service" — names help you identify keys later.

✓ Set Expiry for Temporary Keys

For short-term projects or contractor access, always set an expiry date. Keys auto-disable.

✓ Enable IP Whitelisting

Restrict keys to known IPs whenever possible. This prevents unauthorized use even if the key is leaked.

✓ Use Test Mode for Development

Enable test mode while developing. Requests won't count toward your quota or burn credits. Switch to live when ready.

✓ Store Secrets Securely

Use environment variables, a password manager, or a secrets manager. Never hardcode keys in source code or commit them to git.

✗ Never Commit Keys

Add .env to .gitignore. If committed, revoke immediately and regenerate.

✗ Don't Share Keys Across Services

Each integration gets its own key. Easy to revoke access for one service without affecting others.

⚠️ Monitor Usage

Check last_used_at and last_used_ip regularly for unexpected patterns.

⚠️ Apply Least Privilege

Grant only the permissions each key needs. Read-only keys should only have read permissions.

12. Code Examples

cURL: Full Conversation Lifecycle

# 1. Verify API is working curl https://xeelaa.com/api/v2/verify # 2. Get your account info curl -H "Authorization: Bearer xla_keyId:secret" \ https://xeelaa.com/api/v2/me # 3. List your chatbots curl -H "Authorization: Bearer xla_keyId:secret" \ https://xeelaa.com/api/v2/chatbots # 4. Get chatbot settings (conversation starter) curl -H "Authorization: Bearer xla_keyId:secret" \ https://xeelaa.com/api/v2/chatbots/1/settings # 5. Create a conversation curl -X POST -H "Authorization: Bearer xla_keyId:secret" \ -H "Content-Type: application/json" \ -d '{"title": "Customer Support"}' \ https://xeelaa.com/api/v2/chatbots/1/conversations # 6. Send a message and get AI response curl -X POST -H "Authorization: Bearer xla_keyId:secret" \ -H "Content-Type: application/json" \ -d '{"message": "What products do you offer?"}' \ https://xeelaa.com/api/v2/chatbots/1/conversations/1/messages # 7. List conversations curl -H "Authorization: Bearer xla_keyId:secret" \ https://xeelaa.com/api/v2/chatbots/1/conversations?status=active # 8. Request human handoff curl -X POST -H "Authorization: Bearer xla_keyId:secret" \ https://xeelaa.com/api/v2/chatbots/1/conversations/1/handoff

PHP: Validate API Key on Your Platform

// Your platform receives a request with X-API-Key header $receivedKey = $_SERVER['HTTP_X_API_KEY'] ?? ''; // For v2: split key_id:secret and validate $parts = explode(':', $receivedKey); if (count($parts) === 2) { [$keyId, $secret] = $parts; $computed = hash('sha256', $keyId . ':' . $secret); } else { // Legacy single-key format $computed = hash('sha256', $receivedKey); } // Look up the stored hash (you saved this from the dashboard) $storedHash = 'abc123...'; // From your database if (hash_equals($storedHash, $computed)) { // Valid! Process the request http_response_code(200); echo json_encode(['success' => true]); } else { // Invalid key http_response_code(401); echo json_encode(['error' => 'Invalid API key']); }

JavaScript: Frontend Chat Widget

// Get conversation starter const settings = await fetch( 'https://xeelaa.com/api/v2/chatbots/1/settings?customer_name=John&logged_in=false' ).then(r => r.json()); // Show greeting console.log(settings.data.settings.greeting); // "Hello! How can I help you today?" // Show quick replies console.log(settings.data.settings.quick_replies); // Create conversation const conv = await fetch( 'https://xeelaa.com/api/v2/chatbots/1/conversations', { method: 'POST', headers: { 'Authorization': 'Bearer xla_keyId:secret', 'Content-Type': 'application/json' }, body: JSON.stringify({ title: 'Website Chat' }) } ).then(r => r.json()); // Send message const reply = await fetch( `https://xeelaa.com/api/v2/chatbots/1/conversations/${conv.data.id}/messages`, { method: 'POST', headers: { 'Authorization': 'Bearer xla_keyId:secret', 'Content-Type': 'application/json' }, body: JSON.stringify({ message: 'Hello!' }) } ).then(r => r.json()); // Show AI response console.log(reply.data.response);

Webhook Receiver (PHP)

// Your server receives a POST from XEELAA $payload = json_decode(file_get_contents('php://input'), true); $event = $_SERVER['HTTP_X_WEBHOOK_EVENT'] ?? ''; $webhookId = $_SERVER['HTTP_X_WEBHOOK_ID'] ?? ''; $timestamp = $_SERVER['HTTP_X_WEBHOOK_TIMESTAMP'] ?? ''; // Log the event error_log("Webhook received: {$event}"); // Handle different event types match ($event) { 'message.received' => handleNewMessage($payload), 'conversation.handoff' => handleHandoff($payload), 'whatsapp.message_received' => handleWhatsApp($payload), default => error_log("Unknown event: {$event}"), }; // Always return 200 to acknowledge receipt http_response_code(200); echo json_encode(['status' => 'received']);