> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# Create a campaign

POST https://api.jelliu.co/api/campaigns
Content-Type: application/json

Creates a campaign in `draft` status, bound to an agent, a channel and a weekly calling window.
Nothing is sent or dialed until you add contacts and call
`PATCH /api/campaigns/{campaignId}/activate`. A WhatsApp template or email content can be
included now, so the campaign is ready to send in one request.

These checks run before the campaign is saved, in this order:

* the agent exists in this workspace (404 `AGENT_NOT_FOUND`);
* the agent serves the campaign's `channel` (400);
* for `channel: email`, the workspace has its own sending mailbox connected **and** selected
  as sender (409);
* template placeholder maps and `{{token}}`s in the email subject and body resolve (400);
* the WhatsApp variable map only uses placeholders the template body has (400).
  `maxConcurrentCalls` is silently lowered to the plan's ceiling (Starter 3, Growth 10, Business
  25\), and the stored value is what you get back. The WhatsApp template's approval status is
  **not** checked here; activation checks it.

**Side effects.** Writes the campaign row and an audit entry. No provider is called and no
contact is reached.

**Idempotency.** Not idempotent: retrying after a timeout creates a second draft. List
campaigns before retrying, or delete the duplicate with `DELETE /api/campaigns/{campaignId}`.

**Webhook events.** `audit.log_recorded` for webhooks subscribed to it. See [Webhooks](/webhooks).

**Access**

* **Required scope:** `full`. Admin-only route: `read`/`write` keys get 403; signed-in users need the admin or owner role.
* **Rate limit:** Configuration mutations — 10 requests/min per workspace, shared with agent mutations, on top of the general API limit (120 to 600 requests/min by plan). See [Rate limits](/rate-limits).
* **Plan:** Counts against the plan's **active**-campaign cap (Starter 1, Growth 3, Business and Enterprise unlimited). The draft does not use a slot, but creation is refused with 403 `BILLING_ERROR` while every slot is taken, or when the workspace has no active plan.

Reference: https://developer.jelliu.co/api-reference/campaigns/post-campaigns

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Body (application/json)

This endpoint expects an object.

- `agentId` (string, required) — Agent of this workspace. It must serve the campaign's `channel` (400 otherwise); an unknown agent answers 404.
- `name` (string, required) — Display name.
- `productContext` (string, required) — What the campaign is about, given to the agent. At least 10 characters after trimming.
- `targetAudience` (string, required) — Who the contacts are, given to the agent.
- `schedule` (object, required) — Weekly calling window, stored and returned exactly as sent (camelCase inside the object). The dialer starts a call only when the local hour in `timezone` is `>= startHour` and `< endHour` on an enabled day; outside it, the call is rescheduled to the next window. A call that started inside the window may run past `endHour`. Days that are left out count as disabled. Validation: `timezone` must be a valid IANA zone (`Invalid IANA timezone`), every enabled day needs `startHour < endHour`, and at least one day must be enabled (`At least one day must be enabled`). WhatsApp and email sends are not bound to this window.
  - `timezone` (string, required) — IANA timezone the hours are expressed in.
  - `days` (list of object, required) — One entry per weekday. Only the first entry for a given day is used.
    - `day` (enum, required) — Day of the week, lowercase English.
      - Allowed values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`
    - `startHour` (integer, required) — First hour (inclusive) in which calls may start.
    - `endHour` (integer, required) — Hour (exclusive) at which calls stop starting. `18` means the last call starts before 18:00.
    - `enabled` (boolean, required) — Whether calls may be placed on this day.
- `maxConcurrentCalls` (integer, optional, default: 10) — Maximum simultaneous calls. Silently lowered to the plan's ceiling (Starter 3, Growth 10, Business 25) and to the platform maximum.
- `maxRetryAttempts` (integer, optional, default: 3) — Maximum dial attempts per contact, counting the first; unanswered, busy or unconnected calls are redialed until this many exist. `0` or `1` disables redialing. Voice only. A plan gate (403 `BILLING_ERROR`) exists for values above 0, but every plan includes retries today.
- `retryIntervalMinutes` (integer, optional, default: 60) — Minutes between a missed call and its redial.
- `channel` (enum, optional, default: voice) — `voice`, `whatsapp`, `webchat` or `email` (see `Campaign.channel`). An `email` campaign needs the workspace's own mailbox connected in Integrations and selected as sender (409 otherwise).
  - Allowed values: `voice`, `whatsapp`, `webchat`, `email`
- `category` (enum, optional, default: sales) — Purpose of the campaign, used to classify outcomes (see `Campaign.category` for each value).
  - Allowed values: `sales`, `support`, `scheduling`, `surveys`, `collections`, `retention`, `notifications`, `interview`, `language_assessment`, `general`
- `whatsappTemplateId` (string, optional) — WhatsApp template (from the workspace's templates) that makes activation send outbound messages. WhatsApp approval is checked at activation, not here.
- `whatsappTemplateVariables` (list of string or map from string to string, optional) — Campaign-wide placeholder values, the same for every contact. Either an array of up to 20 strings (`{{1}}` is index 0) or an object keyed by index (keys up to 8 characters); values up to 500 characters.
- `whatsappTemplateVariableMap` (map from string to string or object, optional) — Placeholders filled per contact, keyed by placeholder index (up to 3 characters), for example `{"1": "contact.first_name"}`. A value is the token alone, meaning skip a contact that cannot resolve it, or `{ token, fallback }` to write the fallback instead. Skipped contacts end as `invalid`. Indexes must exist in the template body (400 otherwise).
  - object
    - `token` (string, required)
    - `fallback` (string, optional, nullable)
- `emailSubject` (string, optional) — Subject for outbound email, may contain tokens. Needs `emailBody` too; activation refuses one without the other.
- `emailBody` (string, optional) — Plain-text body for outbound email, may contain tokens.

## Response

### 201

The campaign was created in `draft` status.

- `data` (object, required) — A campaign row as returned by the retrieve, create, update, activate and pause endpoints. Keys are snake_case, exactly as stored. The list endpoint returns a lighter `CampaignListItem` instead.
  - `id` (string, optional) — Unique identifier of the campaign.
  - `tenant_id` (string, optional) — Workspace that owns the campaign.
  - `agent_id` (string, optional) — Agent that calls or chats with the contacts. Set at creation and cannot be changed.
  - `name` (string, optional) — Display name of the campaign.
  - `product_context` (string, optional) — What the campaign offers or is about. It is given to the agent as context for every conversation.
  - `target_audience` (string, optional) — Who the contacts are, given to the agent as context.
  - `status` (enum, optional) — Lifecycle state, changed only by activate, pause and the system: `draft` (created, nothing sent), `active` (running), `paused` (stopped, resumable), `completed` (no pending work left; frozen) or `archived` (frozen).
    - Allowed values: `draft`, `active`, `paused`, `completed`, `archived`
  - `channel` (enum, optional) — How the campaign reaches contacts: `voice` (phone calls), `whatsapp` (WhatsApp messages), `email` (email from the workspace's own mailbox) or `webchat` (inbound web chat only).
    - Allowed values: `voice`, `whatsapp`, `webchat`, `email`
  - `category` (enum, optional) — Purpose of the campaign; it decides how call and conversation outcomes are classified. One of `sales`, `support`, `scheduling`, `surveys`, `collections`, `retention`, `notifications`, `interview`, `language_assessment`, `general`, or the system-only `manual`.
    - Allowed values: `sales`, `support`, `scheduling`, `surveys`, `collections`, `retention`, `notifications`, `interview`, `language_assessment`, `general`, `manual`
  - `schedule` (object, optional) — Weekly calling window, stored and returned exactly as sent (camelCase inside the object). The dialer starts a call only when the local hour in `timezone` is `>= startHour` and `< endHour` on an enabled day; outside it, the call is rescheduled to the next window. A call that started inside the window may run past `endHour`. Days that are left out count as disabled. Validation: `timezone` must be a valid IANA zone (`Invalid IANA timezone`), every enabled day needs `startHour < endHour`, and at least one day must be enabled (`At least one day must be enabled`). WhatsApp and email sends are not bound to this window.
    - `timezone` (string, required) — IANA timezone the hours are expressed in.
    - `days` (list of object, required) — One entry per weekday. Only the first entry for a given day is used.
      - `day` (enum, required) — Day of the week, lowercase English.
        - Allowed values: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`
      - `startHour` (integer, required) — First hour (inclusive) in which calls may start.
      - `endHour` (integer, required) — Hour (exclusive) at which calls stop starting. `18` means the last call starts before 18:00.
      - `enabled` (boolean, required) — Whether calls may be placed on this day.
  - `max_concurrent_calls` (integer, optional) — Maximum simultaneous calls for this campaign. The stored value is already lowered to the plan's ceiling (Starter 3, Growth 10, Business 25).
  - `max_retry_attempts` (integer, optional) — Maximum dial attempts per contact, counting the first. An unanswered, busy or unconnected call is redialed until this many calls exist; `0` or `1` means no redial. Voice only.
  - `retry_interval_minutes` (integer, optional) — Minutes to wait before redialing an unanswered contact (still subject to `schedule`).
  - `blocked_reason` (string, optional, nullable) — Why the **system** paused the campaign, in Spanish, naming the fix (for example, the workspace has no phone number, or the agent is paused). `null` when a person paused it or it was never blocked. It is not cleared on reactivation, so read it only while `status` is `paused`.
  - `retry_policy` (map from string to any, optional) — Legacy column, always `{}` for campaigns created through this API. Not used by the dialer.
  - `voicemail_action` (string, optional) — Legacy column, defaults to `retry`. Not settable and not used today; unanswered calls follow `max_retry_attempts`.
  - `voicemail_message` (string, optional, nullable) — Legacy column, always `null` for campaigns created through this API.
  - `whatsapp_template_id` (string, optional, nullable) — Approved WhatsApp template used for outbound sends. `null` keeps a WhatsApp campaign inbound-only.
  - `whatsapp_template_variables` (list of string or map from string to string, optional, nullable) — Campaign-wide values for the template placeholders, as an array (`{{1}}` is index 0) or an object keyed by placeholder index. The same value reaches every contact.
  - `whatsapp_template_variable_map` (map from string to any, optional, nullable) — Placeholders filled per contact, keyed by placeholder index. The value is a token, or `{ token, fallback }`. Indexes not in the map use `whatsapp_template_variables`.
  - `email_subject` (string, optional, nullable) — Subject of the outbound email, may contain `{{tokens}}`. Outbound email needs both subject and body.
  - `email_body` (string, optional, nullable) — Plain-text body of the outbound email, may contain `{{tokens}}`.
  - `created_at` (datetime, optional) — When the campaign was created.
  - `updated_at` (datetime, optional) — Last change to the row, including status changes.
  - `deleted_at` (datetime, optional, nullable) — Always `null` in responses; deleted campaigns are not returned.

## Errors

### 400 Bad Request Error

The body failed validation (`Invalid campaign input`, with Zod's field map in `details`), the agent does not serve the channel, or a placeholder token does not resolve.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

API key without the `full` scope, a user without the admin/owner role, or the plan's active-campaign cap is full.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 404 Not Found Error

The agent does not exist in this workspace.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 409 Conflict Error

An `email` campaign was requested but the workspace has no usable sending mailbox selected (or the selected one is broken; the message then names what to reconnect).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

The configuration-mutation limit or the general API limit was exceeded.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

### Campaigns_postCampaigns_example

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": "9f1e2d3c-4b5a-4968-8776-655443322110",
    "name": "Renovaciones septiembre",
    "product_context": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
    "target_audience": "Clientes con plan vencido en los últimos 60 días",
    "status": "draft",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        },
        {
          "day": "tuesday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 3,
    "max_retry_attempts": 3,
    "retry_interval_minutes": 120,
    "blocked_reason": null,
    "retry_policy": {},
    "voicemail_action": "retry",
    "voicemail_message": null,
    "whatsapp_template_id": null,
    "whatsapp_template_variables": {},
    "whatsapp_template_variable_map": {},
    "email_subject": null,
    "email_body": null,
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-14T15:02:11.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Campaigns_postCampaigns_example
import requests

url = "https://api.jelliu.co/api/campaigns"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Campaigns_postCampaigns_example
const url = 'https://api.jelliu.co/api/campaigns';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Campaigns_postCampaigns_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Campaigns_postCampaigns_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Campaigns_postCampaigns_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Campaigns_postCampaigns_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Campaigns_postCampaigns_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Campaigns_postCampaigns_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Voice campaign with retries

**Request**

```json
{
  "agentId": "9f1e2d3c-4b5a-4968-8776-655443322110",
  "name": "Renovaciones septiembre",
  "productContext": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
  "targetAudience": "Clientes con plan vencido en los últimos 60 días",
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "monday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "tuesday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "wednesday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "thursday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "friday",
        "startHour": 9,
        "endHour": 17,
        "enabled": true
      }
    ]
  },
  "maxConcurrentCalls": 3,
  "maxRetryAttempts": 3,
  "retryIntervalMinutes": 120,
  "channel": "voice",
  "category": "sales"
}
```

**Response**

```json
{
  "data": {
    "id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": "9f1e2d3c-4b5a-4968-8776-655443322110",
    "name": "Renovaciones septiembre",
    "product_context": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
    "target_audience": "Clientes con plan vencido en los últimos 60 días",
    "status": "draft",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        },
        {
          "day": "tuesday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 3,
    "max_retry_attempts": 3,
    "retry_interval_minutes": 120,
    "blocked_reason": null,
    "retry_policy": {},
    "voicemail_action": "retry",
    "voicemail_message": null,
    "whatsapp_template_id": null,
    "whatsapp_template_variables": {},
    "whatsapp_template_variable_map": {},
    "email_subject": null,
    "email_body": null,
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-14T15:02:11.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Voice campaign with retries
import requests

url = "https://api.jelliu.co/api/campaigns"

payload = {
    "agentId": "9f1e2d3c-4b5a-4968-8776-655443322110",
    "name": "Renovaciones septiembre",
    "productContext": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
    "targetAudience": "Clientes con plan vencido en los últimos 60 días",
    "schedule": {
        "timezone": "America/Bogota",
        "days": [
            {
                "day": "monday",
                "startHour": 9,
                "endHour": 18,
                "enabled": True
            },
            {
                "day": "tuesday",
                "startHour": 9,
                "endHour": 18,
                "enabled": True
            },
            {
                "day": "wednesday",
                "startHour": 9,
                "endHour": 18,
                "enabled": True
            },
            {
                "day": "thursday",
                "startHour": 9,
                "endHour": 18,
                "enabled": True
            },
            {
                "day": "friday",
                "startHour": 9,
                "endHour": 17,
                "enabled": True
            }
        ]
    },
    "maxConcurrentCalls": 3,
    "maxRetryAttempts": 3,
    "retryIntervalMinutes": 120,
    "channel": "voice",
    "category": "sales"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Voice campaign with retries
const url = 'https://api.jelliu.co/api/campaigns';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"agentId":"9f1e2d3c-4b5a-4968-8776-655443322110","name":"Renovaciones septiembre","productContext":"Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.","targetAudience":"Clientes con plan vencido en los últimos 60 días","schedule":{"timezone":"America/Bogota","days":[{"day":"monday","startHour":9,"endHour":18,"enabled":true},{"day":"tuesday","startHour":9,"endHour":18,"enabled":true},{"day":"wednesday","startHour":9,"endHour":18,"enabled":true},{"day":"thursday","startHour":9,"endHour":18,"enabled":true},{"day":"friday","startHour":9,"endHour":17,"enabled":true}]},"maxConcurrentCalls":3,"maxRetryAttempts":3,"retryIntervalMinutes":120,"channel":"voice","category":"sales"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Voice campaign with retries
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns"

	payload := strings.NewReader("{\n  \"agentId\": \"9f1e2d3c-4b5a-4968-8776-655443322110\",\n  \"name\": \"Renovaciones septiembre\",\n  \"productContext\": \"Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.\",\n  \"targetAudience\": \"Clientes con plan vencido en los últimos 60 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"thursday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"friday\",\n        \"startHour\": 9,\n        \"endHour\": 17,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 3,\n  \"maxRetryAttempts\": 3,\n  \"retryIntervalMinutes\": 120,\n  \"channel\": \"voice\",\n  \"category\": \"sales\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Voice campaign with retries
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agentId\": \"9f1e2d3c-4b5a-4968-8776-655443322110\",\n  \"name\": \"Renovaciones septiembre\",\n  \"productContext\": \"Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.\",\n  \"targetAudience\": \"Clientes con plan vencido en los últimos 60 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"thursday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"friday\",\n        \"startHour\": 9,\n        \"endHour\": 17,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 3,\n  \"maxRetryAttempts\": 3,\n  \"retryIntervalMinutes\": 120,\n  \"channel\": \"voice\",\n  \"category\": \"sales\"\n}"

response = http.request(request)
puts response.read_body
```

```java Voice campaign with retries
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agentId\": \"9f1e2d3c-4b5a-4968-8776-655443322110\",\n  \"name\": \"Renovaciones septiembre\",\n  \"productContext\": \"Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.\",\n  \"targetAudience\": \"Clientes con plan vencido en los últimos 60 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"thursday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"friday\",\n        \"startHour\": 9,\n        \"endHour\": 17,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 3,\n  \"maxRetryAttempts\": 3,\n  \"retryIntervalMinutes\": 120,\n  \"channel\": \"voice\",\n  \"category\": \"sales\"\n}")
  .asString();
```

```php Voice campaign with retries
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns', [
  'body' => '{
  "agentId": "9f1e2d3c-4b5a-4968-8776-655443322110",
  "name": "Renovaciones septiembre",
  "productContext": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
  "targetAudience": "Clientes con plan vencido en los últimos 60 días",
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "monday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "tuesday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "wednesday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "thursday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      },
      {
        "day": "friday",
        "startHour": 9,
        "endHour": 17,
        "enabled": true
      }
    ]
  },
  "maxConcurrentCalls": 3,
  "maxRetryAttempts": 3,
  "retryIntervalMinutes": 120,
  "channel": "voice",
  "category": "sales"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Voice campaign with retries
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agentId\": \"9f1e2d3c-4b5a-4968-8776-655443322110\",\n  \"name\": \"Renovaciones septiembre\",\n  \"productContext\": \"Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.\",\n  \"targetAudience\": \"Clientes con plan vencido en los últimos 60 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"thursday\",\n        \"startHour\": 9,\n        \"endHour\": 18,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"friday\",\n        \"startHour\": 9,\n        \"endHour\": 17,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 3,\n  \"maxRetryAttempts\": 3,\n  \"retryIntervalMinutes\": 120,\n  \"channel\": \"voice\",\n  \"category\": \"sales\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Voice campaign with retries
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "agentId": "9f1e2d3c-4b5a-4968-8776-655443322110",
  "name": "Renovaciones septiembre",
  "productContext": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
  "targetAudience": "Clientes con plan vencido en los últimos 60 días",
  "schedule": [
    "timezone": "America/Bogota",
    "days": [
      [
        "day": "monday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      ],
      [
        "day": "tuesday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      ],
      [
        "day": "wednesday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      ],
      [
        "day": "thursday",
        "startHour": 9,
        "endHour": 18,
        "enabled": true
      ],
      [
        "day": "friday",
        "startHour": 9,
        "endHour": 17,
        "enabled": true
      ]
    ]
  ],
  "maxConcurrentCalls": 3,
  "maxRetryAttempts": 3,
  "retryIntervalMinutes": 120,
  "channel": "voice",
  "category": "sales"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Outbound WhatsApp campaign with per-contact placeholders

**Request**

```json
{
  "agentId": "2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081",
  "name": "Recordatorio de pago WhatsApp",
  "productContext": "Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.",
  "targetAudience": "Clientes con cuota vencida entre 1 y 15 días",
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "monday",
        "startHour": 8,
        "endHour": 20,
        "enabled": true
      }
    ]
  },
  "maxRetryAttempts": 0,
  "channel": "whatsapp",
  "category": "collections",
  "whatsappTemplateId": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "whatsappTemplateVariables": [
    "",
    "Financiera Andina"
  ],
  "whatsappTemplateVariableMap": {
    "1": {
      "fallback": "cliente",
      "token": "contact.first_name"
    }
  }
}
```

**Response**

```json
{
  "data": {
    "id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": "9f1e2d3c-4b5a-4968-8776-655443322110",
    "name": "Renovaciones septiembre",
    "product_context": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
    "target_audience": "Clientes con plan vencido en los últimos 60 días",
    "status": "draft",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        },
        {
          "day": "tuesday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 3,
    "max_retry_attempts": 3,
    "retry_interval_minutes": 120,
    "blocked_reason": null,
    "retry_policy": {},
    "voicemail_action": "retry",
    "voicemail_message": null,
    "whatsapp_template_id": null,
    "whatsapp_template_variables": {},
    "whatsapp_template_variable_map": {},
    "email_subject": null,
    "email_body": null,
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-14T15:02:11.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Outbound WhatsApp campaign with per-contact placeholders
import requests

url = "https://api.jelliu.co/api/campaigns"

payload = {
    "agentId": "2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081",
    "name": "Recordatorio de pago WhatsApp",
    "productContext": "Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.",
    "targetAudience": "Clientes con cuota vencida entre 1 y 15 días",
    "schedule": {
        "timezone": "America/Bogota",
        "days": [
            {
                "day": "monday",
                "startHour": 8,
                "endHour": 20,
                "enabled": True
            }
        ]
    },
    "maxRetryAttempts": 0,
    "channel": "whatsapp",
    "category": "collections",
    "whatsappTemplateId": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    "whatsappTemplateVariables": ["", "Financiera Andina"],
    "whatsappTemplateVariableMap": { "1": {
            "fallback": "cliente",
            "token": "contact.first_name"
        } }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Outbound WhatsApp campaign with per-contact placeholders
const url = 'https://api.jelliu.co/api/campaigns';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"agentId":"2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081","name":"Recordatorio de pago WhatsApp","productContext":"Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.","targetAudience":"Clientes con cuota vencida entre 1 y 15 días","schedule":{"timezone":"America/Bogota","days":[{"day":"monday","startHour":8,"endHour":20,"enabled":true}]},"maxRetryAttempts":0,"channel":"whatsapp","category":"collections","whatsappTemplateId":"7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f","whatsappTemplateVariables":["","Financiera Andina"],"whatsappTemplateVariableMap":{"1":{"fallback":"cliente","token":"contact.first_name"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Outbound WhatsApp campaign with per-contact placeholders
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns"

	payload := strings.NewReader("{\n  \"agentId\": \"2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081\",\n  \"name\": \"Recordatorio de pago WhatsApp\",\n  \"productContext\": \"Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.\",\n  \"targetAudience\": \"Clientes con cuota vencida entre 1 y 15 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 8,\n        \"endHour\": 20,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"whatsapp\",\n  \"category\": \"collections\",\n  \"whatsappTemplateId\": \"7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n  \"whatsappTemplateVariables\": [\n    \"\",\n    \"Financiera Andina\"\n  ],\n  \"whatsappTemplateVariableMap\": {\n    \"1\": {\n      \"fallback\": \"cliente\",\n      \"token\": \"contact.first_name\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Outbound WhatsApp campaign with per-contact placeholders
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agentId\": \"2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081\",\n  \"name\": \"Recordatorio de pago WhatsApp\",\n  \"productContext\": \"Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.\",\n  \"targetAudience\": \"Clientes con cuota vencida entre 1 y 15 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 8,\n        \"endHour\": 20,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"whatsapp\",\n  \"category\": \"collections\",\n  \"whatsappTemplateId\": \"7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n  \"whatsappTemplateVariables\": [\n    \"\",\n    \"Financiera Andina\"\n  ],\n  \"whatsappTemplateVariableMap\": {\n    \"1\": {\n      \"fallback\": \"cliente\",\n      \"token\": \"contact.first_name\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Outbound WhatsApp campaign with per-contact placeholders
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agentId\": \"2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081\",\n  \"name\": \"Recordatorio de pago WhatsApp\",\n  \"productContext\": \"Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.\",\n  \"targetAudience\": \"Clientes con cuota vencida entre 1 y 15 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 8,\n        \"endHour\": 20,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"whatsapp\",\n  \"category\": \"collections\",\n  \"whatsappTemplateId\": \"7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n  \"whatsappTemplateVariables\": [\n    \"\",\n    \"Financiera Andina\"\n  ],\n  \"whatsappTemplateVariableMap\": {\n    \"1\": {\n      \"fallback\": \"cliente\",\n      \"token\": \"contact.first_name\"\n    }\n  }\n}")
  .asString();
```

```php Outbound WhatsApp campaign with per-contact placeholders
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns', [
  'body' => '{
  "agentId": "2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081",
  "name": "Recordatorio de pago WhatsApp",
  "productContext": "Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.",
  "targetAudience": "Clientes con cuota vencida entre 1 y 15 días",
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "monday",
        "startHour": 8,
        "endHour": 20,
        "enabled": true
      }
    ]
  },
  "maxRetryAttempts": 0,
  "channel": "whatsapp",
  "category": "collections",
  "whatsappTemplateId": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "whatsappTemplateVariables": [
    "",
    "Financiera Andina"
  ],
  "whatsappTemplateVariableMap": {
    "1": {
      "fallback": "cliente",
      "token": "contact.first_name"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Outbound WhatsApp campaign with per-contact placeholders
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agentId\": \"2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081\",\n  \"name\": \"Recordatorio de pago WhatsApp\",\n  \"productContext\": \"Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.\",\n  \"targetAudience\": \"Clientes con cuota vencida entre 1 y 15 días\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 8,\n        \"endHour\": 20,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"whatsapp\",\n  \"category\": \"collections\",\n  \"whatsappTemplateId\": \"7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n  \"whatsappTemplateVariables\": [\n    \"\",\n    \"Financiera Andina\"\n  ],\n  \"whatsappTemplateVariableMap\": {\n    \"1\": {\n      \"fallback\": \"cliente\",\n      \"token\": \"contact.first_name\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Outbound WhatsApp campaign with per-contact placeholders
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "agentId": "2a3b4c5d-6e7f-4081-9a2b-3c4d5e6f7081",
  "name": "Recordatorio de pago WhatsApp",
  "productContext": "Recordatorio amable de la cuota de septiembre. Se puede pagar por PSE o en cualquier Efecty.",
  "targetAudience": "Clientes con cuota vencida entre 1 y 15 días",
  "schedule": [
    "timezone": "America/Bogota",
    "days": [
      [
        "day": "monday",
        "startHour": 8,
        "endHour": 20,
        "enabled": true
      ]
    ]
  ],
  "maxRetryAttempts": 0,
  "channel": "whatsapp",
  "category": "collections",
  "whatsappTemplateId": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "whatsappTemplateVariables": ["", "Financiera Andina"],
  "whatsappTemplateVariableMap": ["1": [
      "fallback": "cliente",
      "token": "contact.first_name"
    ]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Outbound email campaign

**Request**

```json
{
  "agentId": "4d5e6f70-8192-4a3b-9c4d-5e6f70819203",
  "name": "Invitación webinar octubre",
  "productContext": "Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.",
  "targetAudience": "Contadores y dueños de pymes registrados en el último año",
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "tuesday",
        "startHour": 9,
        "endHour": 12,
        "enabled": true
      }
    ]
  },
  "maxRetryAttempts": 0,
  "channel": "email",
  "category": "notifications",
  "emailSubject": "{{contact.first_name}}, te esperamos el 8 de octubre",
  "emailBody": "Hola {{contact.first_name}}:\n\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\nResponde este correo y te guardamos un cupo.\n"
}
```

**Response**

```json
{
  "data": {
    "id": "5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10",
    "tenant_id": "0e9d7c3b-8a1f-4c55-b7a2-3c4d5e6f7a8b",
    "agent_id": "9f1e2d3c-4b5a-4968-8776-655443322110",
    "name": "Renovaciones septiembre",
    "product_context": "Plan de datos móviles con 20 GB y llamadas ilimitadas por $59.900 al mes. Oferta válida hasta el 30 de septiembre.",
    "target_audience": "Clientes con plan vencido en los últimos 60 días",
    "status": "draft",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        },
        {
          "day": "tuesday",
          "startHour": 9,
          "endHour": 18,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 3,
    "max_retry_attempts": 3,
    "retry_interval_minutes": 120,
    "blocked_reason": null,
    "retry_policy": {},
    "voicemail_action": "retry",
    "voicemail_message": null,
    "whatsapp_template_id": null,
    "whatsapp_template_variables": {},
    "whatsapp_template_variable_map": {},
    "email_subject": null,
    "email_body": null,
    "created_at": "2026-09-14T15:02:11.000Z",
    "updated_at": "2026-09-14T15:02:11.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Outbound email campaign
import requests

url = "https://api.jelliu.co/api/campaigns"

payload = {
    "agentId": "4d5e6f70-8192-4a3b-9c4d-5e6f70819203",
    "name": "Invitación webinar octubre",
    "productContext": "Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.",
    "targetAudience": "Contadores y dueños de pymes registrados en el último año",
    "schedule": {
        "timezone": "America/Bogota",
        "days": [
            {
                "day": "tuesday",
                "startHour": 9,
                "endHour": 12,
                "enabled": True
            }
        ]
    },
    "maxRetryAttempts": 0,
    "channel": "email",
    "category": "notifications",
    "emailSubject": "{{contact.first_name}}, te esperamos el 8 de octubre",
    "emailBody": "Hola {{contact.first_name}}:

Te invitamos a nuestro webinar gratuito sobre facturación electrónica.
Responde este correo y te guardamos un cupo.
"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Outbound email campaign
const url = 'https://api.jelliu.co/api/campaigns';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"agentId":"4d5e6f70-8192-4a3b-9c4d-5e6f70819203","name":"Invitación webinar octubre","productContext":"Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.","targetAudience":"Contadores y dueños de pymes registrados en el último año","schedule":{"timezone":"America/Bogota","days":[{"day":"tuesday","startHour":9,"endHour":12,"enabled":true}]},"maxRetryAttempts":0,"channel":"email","category":"notifications","emailSubject":"{{contact.first_name}}, te esperamos el 8 de octubre","emailBody":"Hola {{contact.first_name}}:\n\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\nResponde este correo y te guardamos un cupo.\n"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Outbound email campaign
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/campaigns"

	payload := strings.NewReader("{\n  \"agentId\": \"4d5e6f70-8192-4a3b-9c4d-5e6f70819203\",\n  \"name\": \"Invitación webinar octubre\",\n  \"productContext\": \"Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.\",\n  \"targetAudience\": \"Contadores y dueños de pymes registrados en el último año\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 12,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"email\",\n  \"category\": \"notifications\",\n  \"emailSubject\": \"{{contact.first_name}}, te esperamos el 8 de octubre\",\n  \"emailBody\": \"Hola {{contact.first_name}}:\\n\\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\\nResponde este correo y te guardamos un cupo.\\n\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Outbound email campaign
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agentId\": \"4d5e6f70-8192-4a3b-9c4d-5e6f70819203\",\n  \"name\": \"Invitación webinar octubre\",\n  \"productContext\": \"Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.\",\n  \"targetAudience\": \"Contadores y dueños de pymes registrados en el último año\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 12,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"email\",\n  \"category\": \"notifications\",\n  \"emailSubject\": \"{{contact.first_name}}, te esperamos el 8 de octubre\",\n  \"emailBody\": \"Hola {{contact.first_name}}:\\n\\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\\nResponde este correo y te guardamos un cupo.\\n\"\n}"

response = http.request(request)
puts response.read_body
```

```java Outbound email campaign
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/campaigns")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agentId\": \"4d5e6f70-8192-4a3b-9c4d-5e6f70819203\",\n  \"name\": \"Invitación webinar octubre\",\n  \"productContext\": \"Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.\",\n  \"targetAudience\": \"Contadores y dueños de pymes registrados en el último año\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 12,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"email\",\n  \"category\": \"notifications\",\n  \"emailSubject\": \"{{contact.first_name}}, te esperamos el 8 de octubre\",\n  \"emailBody\": \"Hola {{contact.first_name}}:\\n\\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\\nResponde este correo y te guardamos un cupo.\\n\"\n}")
  .asString();
```

```php Outbound email campaign
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/campaigns', [
  'body' => '{
  "agentId": "4d5e6f70-8192-4a3b-9c4d-5e6f70819203",
  "name": "Invitación webinar octubre",
  "productContext": "Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.",
  "targetAudience": "Contadores y dueños de pymes registrados en el último año",
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "tuesday",
        "startHour": 9,
        "endHour": 12,
        "enabled": true
      }
    ]
  },
  "maxRetryAttempts": 0,
  "channel": "email",
  "category": "notifications",
  "emailSubject": "{{contact.first_name}}, te esperamos el 8 de octubre",
  "emailBody": "Hola {{contact.first_name}}:\\n\\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\\nResponde este correo y te guardamos un cupo.\\n"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Outbound email campaign
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agentId\": \"4d5e6f70-8192-4a3b-9c4d-5e6f70819203\",\n  \"name\": \"Invitación webinar octubre\",\n  \"productContext\": \"Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.\",\n  \"targetAudience\": \"Contadores y dueños de pymes registrados en el último año\",\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"tuesday\",\n        \"startHour\": 9,\n        \"endHour\": 12,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxRetryAttempts\": 0,\n  \"channel\": \"email\",\n  \"category\": \"notifications\",\n  \"emailSubject\": \"{{contact.first_name}}, te esperamos el 8 de octubre\",\n  \"emailBody\": \"Hola {{contact.first_name}}:\\n\\nTe invitamos a nuestro webinar gratuito sobre facturación electrónica.\\nResponde este correo y te guardamos un cupo.\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Outbound email campaign
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "agentId": "4d5e6f70-8192-4a3b-9c4d-5e6f70819203",
  "name": "Invitación webinar octubre",
  "productContext": "Webinar gratuito sobre facturación electrónica DIAN, 8 de octubre a las 10:00.",
  "targetAudience": "Contadores y dueños de pymes registrados en el último año",
  "schedule": [
    "timezone": "America/Bogota",
    "days": [
      [
        "day": "tuesday",
        "startHour": 9,
        "endHour": 12,
        "enabled": true
      ]
    ]
  ],
  "maxRetryAttempts": 0,
  "channel": "email",
  "category": "notifications",
  "emailSubject": "{{contact.first_name}}, te esperamos el 8 de octubre",
  "emailBody": "Hola {{contact.first_name}}:

Te invitamos a nuestro webinar gratuito sobre facturación electrónica.
Responde este correo y te guardamos un cupo.
"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```