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

# Send campaign message

> Add a message to a GIA campaign queue.

# Send campaign message

Adds a message to a GIA campaign queue. The campaign is created on the first request if it does not exist yet.

## Authentication

Send the GIA token as a bearer token:

```http theme={null}
Authorization: Bearer SEU_TOKEN_GIA
```

The token is compared with `project.gia_token`. Find it under **Settings → Inboxes → Inbox Settings → AI Resources**.

<Warning>
  Never expose the GIA token in client applications or public repositories.
</Warning>

## Common fields

| Field               | Required | Description                                                        |
| ------------------- | -------- | ------------------------------------------------------------------ |
| `account_id`        | Yes\*    | Account ID; must be sent with `inbox_id`                           |
| `inbox_id`          | Yes\*    | Inbox ID; must be sent with `account_id`                           |
| `project_id`        | Yes\*    | Alternative project identifier                                     |
| `identifier`        | Yes      | Non-empty contact identifier                                       |
| `name`              | No       | Contact name                                                       |
| `campaign_name`     | No       | Campaign name; defaults to `main` when omitted                     |
| `configuration_set` | No       | Configuration set used by GIA                                      |
| `message_type`      | Yes      | `direct_message`, `system_with_ai`, or `whatsapp_template_message` |
| `additional_data`   | No       | JSON object of up to 10 KB that follows the contact                |
| `add_label`         | No       | Labels added to the contact                                        |
| `remove_label`      | No       | Labels removed from the contact                                    |
| `priority`          | No       | Integer from `1` to `5`; `1` is the highest priority               |

\* Send `account_id` and `inbox_id` together, or use `project_id` according to the project format.

## Direct message

`content` is required for `direct_message`.

```json theme={null}
{
  "account_id": 10,
  "inbox_id": 25,
  "campaign_name": "customer-reactivation",
  "configuration_set": "production",
  "identifier": "5511999999999",
  "name": "John Smith",
  "message_type": "direct_message",
  "content": "Hello, John! Can we continue your conversation?",
  "additional_data": {
    "lead_id": "lead-987",
    "source": "crm"
  },
  "add_label": ["reactivation-campaign", "awaiting-response"],
  "remove_label": ["cold-lead"],
  "priority": 2
}
```

Minimum payload:

```json theme={null}
{
  "account_id": 10,
  "inbox_id": 25,
  "identifier": "5511999999999",
  "message_type": "direct_message",
  "content": "Hello!"
}
```

## AI-generated message

`content` is required for `system_with_ai` and acts as an instruction for the AI.

```json theme={null}
{
  "account_id": 10,
  "inbox_id": 25,
  "campaign_name": "ai-follow-up",
  "configuration_set": "main",
  "identifier": "cliente@example.com",
  "name": "Mary Johnson",
  "message_type": "system_with_ai",
  "content": "Briefly resume the negotiation with the customer.",
  "additional_data": {
    "customer_id": 4567,
    "preferred_contact_period": "afternoon"
  },
  "add_label": ["ai-follow-up"],
  "priority": 1
}
```

## WhatsApp template

`template_params`, `template_params.name`, and `template_params.language` are required for `whatsapp_template_message`. `category` is optional.

```json theme={null}
{
  "account_id": 10,
  "inbox_id": 25,
  "campaign_name": "appointment-confirmation",
  "configuration_set": "production",
  "identifier": "5511988887777",
  "name": "Charles Brown",
  "message_type": "whatsapp_template_message",
  "template_params": {
    "name": "appointment_confirmation",
    "category": "UTILITY",
    "language": "pt_BR",
    "processed_params": {
      "1": "Charles",
      "2": "28/08/2026",
      "3": "14:30",
      "4": "Example Store"
    }
  },
  "additional_data": {
    "appointment_id": 98765,
    "origin": "service_scheduler"
  },
  "priority": 1
}
```

`template_params` preserves additional properties. They must still be compatible with downstream processing and the WhatsApp API.

<Note>
  Projects using a `whatsapp_cloud` channel only accept `whatsapp_template_message` on this endpoint.
</Note>

## Validation rules

* `identifier` cannot be empty.
* `content` is required for `direct_message` and `system_with_ai`.
* `template_params` is required for `whatsapp_template_message`.
* `priority` only accepts integers from `1` to `5`.
* Unknown top-level fields are discarded; additional fields inside `template_params` are preserved.

## Response

```json theme={null}
{
  "success": true,
  "message": "Campaign message queued for processing",
  "campaign_id": "f7939011-fa8d-47bc-ac77-36ad7e283380"
}
```

This response confirms that the message was added to the queue. See **Campaigns → History** to monitor its execution.
