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

# Introduction

> Welcome to the Domix AI Developer Platform

Welcome to the **Domix AI Developer API** documentation. Whether you are building custom workflows for your support team, integrating Domix AI with your CRM or ERP, sending automated WhatsApp notifications, or developing conversational bots, our APIs provide the flexibility and power to do more.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="#quickstart-send-a-message-in-60-seconds">
    Send your first WhatsApp message in under 60 seconds.
  </Card>

  <Card title="Authentication" icon="key" href="#authentication-overview">
    Learn how to authenticate requests using your API tokens.
  </Card>

  <Card title="Unified Messaging" icon="message">
    Single-step endpoint to dispatch messages and templates directly.
  </Card>

  <Card title="Webhooks" icon="webhook">
    Subscribe to real-time events like incoming messages and updates.
  </Card>
</CardGroup>

***

## 📚 API Categories

Domix AI APIs are organized into three primary categories:

<AccordionGroup>
  <Accordion title="1. Unified Messaging API (Recommended)" icon="paper-plane">
    Our high-level messaging engine designed specifically for integrations:

    * **Single Request**: Dispatches plain text or pre-approved WhatsApp templates directly by phone number.
    * **Automatic Creation**: If the customer contact or open conversation does not exist, Domix AI automatically creates or resolves them.
    * **Endpoint**: `POST /developer/api/v1/messages`
  </Accordion>

  <Accordion title="2. Core CRM & Conversation APIs" icon="users">
    Provides granular control over your customer support infrastructure:

    * **Contacts**: Search contacts by phone or email (`GET /contacts/search`), create records, and update custom attributes.
    * **Conversations**: Manage statuses (`open`, `resolved`, `pending`, `snoozed`) and assign agents or teams.
    * **Messages**: Access historical logs, reply to conversations, or add internal staff notes (`private: true`).
    * **Inboxes**: Retrieve connected communication channels (WhatsApp, Web Chat, Email, API).
  </Accordion>

  <Accordion title="3. Real-Time Webhooks" icon="bolt">
    Stream live data to your backend services:

    * Receive immediate HTTP POST notifications for events such as `message_created`, `conversation_created`, and `contact_created`.
    * Ideal for syncing chats with external databases, analytics, or AI pipelines.
  </Accordion>
</AccordionGroup>

***

## 🔐 Authentication Overview

Domix AI utilizes API Access Tokens for request authentication.

<Note>
  **Flexible Header Convention:** Domix AI accepts both **hyphenated** (`api-access-token`) and **underscored** (`api_access_token`) header formats to ensure seamless compatibility with your programming language and HTTP clients.
</Note>

| Header           | Accepted Formats                         | Required In           | Description                         |
| :--------------- | :--------------------------------------- | :-------------------- | :---------------------------------- |
| **Access Token** | `api-access-token` or `api_access_token` | All API requests      | Your private API access token       |
| **Account ID**   | `api-account-id` or `api_account_id`     | Unified Messaging API | Your account identifier in Domix AI |

***

## ⚡ Quickstart: Send a Message in 60 Seconds

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://chat.domix.ai/developer/api/v1/messages \
    -H "Content-Type: application/json" \
    -H "api-access-token: YOUR_ACCESS_TOKEN" \
    -H "api-account-id: YOUR_ACCOUNT_ID" \
    -d '{
      "inbox_id": 1,
      "phone_number": "+966555555555",
      "content": "Hello from Domix AI API!",
      "name": "Customer Name"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://chat.domix.ai/developer/api/v1/messages', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'api-access-token': 'YOUR_ACCESS_TOKEN',
      'api-account-id': 'YOUR_ACCOUNT_ID'
    },
    body: JSON.stringify({
      inbox_id: 1,
      phone_number: '+966555555555',
      content: 'Hello from Domix AI API!',
      name: 'Customer Name'
    })
  });

  const data = await response.json();
  console.log('Response:', data);
  ```
</CodeGroup>

***

## ❓ Frequently Asked Questions (FAQ)

<AccordionGroup>
  <Accordion title="How do I get my API Access Token?">
    Log in to your Domix AI dashboard at [chat.domix.ai](https://chat.domix.ai), click your profile icon in the bottom-left corner, go to **Profile Settings**, and copy the token from the **Access Token** section.
  </Accordion>

  <Accordion title="Can I use api-access-token or api_access_token?">
    Yes, Domix AI fully supports both `api-access-token` (hyphen) and `api_access_token` (underscore). Choose whichever fits your HTTP client best.
  </Accordion>

  <Accordion title="How can I check if a contact exists before creating a new one?">
    Always execute `GET /api/v1/accounts/{account_id}/contacts/search?q=+966555555555` first. This searches phone numbers, emails, and names, returning the existing contact ID to avoid duplication.
  </Accordion>

  <Accordion title="How do I send WhatsApp Template messages?">
    Use the Unified Messages endpoint (`POST /developer/api/v1/messages`) with `"message_type": "template"` and pass the pre-approved template name, language, and variable components in `template_params`.
  </Accordion>

  <Accordion title="How do I receive incoming messages in real-time?">
    Register an endpoint via `POST /api/v1/accounts/{account_id}/webhooks` subscribed to `message_created`. Your server will receive an instant JSON payload whenever an incoming message arrives.
  </Accordion>
</AccordionGroup>
