> 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.

# Update a campaign

PATCH https://api.jelliu.co/api/campaigns/{campaignId}
Content-Type: application/json

Partially updates a `draft`, `active` or `paused` campaign. Only the fields in the body change,
an empty body returns the campaign unchanged, and the agent cannot be swapped. Send `null` for
`whatsappTemplateId`, `whatsappTemplateVariables`, `whatsappTemplateVariableMap`, `emailSubject`
or `emailBody` to clear it. Clearing the template, or the subject and body, makes the next
activation inbound-only.

Editing an `active` campaign is allowed and takes effect for work that has not started yet.
The dialer reads `schedule`, `status` and the retry settings each time it picks up a contact.
WhatsApp and email messages that are already queued keep the content rendered at activation, so
new content reaches only contacts queued later (pause, then activate again).

Checks: the campaign is not `completed`/`archived` (400); a new `channel` is served by the
campaign's agent (400); tokens and the WhatsApp variable map resolve against the template that
will be in effect after the change (400). `maxConcurrentCalls` is silently lowered to the plan's
ceiling.

**Side effects.** Updates the row, clears the campaign caches and writes an audit entry. No
provider is called.

**Idempotency.** Safe to retry: sending the same body again leaves the same state.

**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:** Available on every plan. The concurrency ceiling depends on the plan.


Reference: https://developer.jelliu.co/api-reference/campaigns/patch-campaigns-by-campaign-id

## 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

### Path parameters

- `campaignId` (string, required) — UUID of the campaign to update. A campaign from another workspace or a deleted one answers 404; a value that is not a UUID answers 400.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — New display name.
- `productContext` (string, optional) — New product context for the agent.
- `targetAudience` (string, optional) — New audience description for the agent.
- `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.
- `maxConcurrentCalls` (integer, optional) — New concurrency; silently lowered to the plan's ceiling.
- `maxRetryAttempts` (integer, optional) — New maximum dial attempts per contact (counting the first).
- `retryIntervalMinutes` (integer, optional) — New minutes between a missed call and its redial.
- `channel` (enum, optional) — New channel (`voice`, `whatsapp`, `webchat` or `email`). The campaign's current agent must serve it (400 otherwise).
  - Allowed values: `voice`, `whatsapp`, `webchat`, `email`
- `category` (enum, optional) — New purpose (see `Campaign.category` for each value).
  - Allowed values: `sales`, `support`, `scheduling`, `surveys`, `collections`, `retention`, `notifications`, `interview`, `language_assessment`, `general`
- `whatsappTemplateId` (string, optional, nullable) — New WhatsApp template, or `null` to make the campaign inbound-only. The variable map is re-checked against the new template body.
- `whatsappTemplateVariables` (list of string or map from string to string, optional, nullable) — New campaign-wide placeholder values (same shapes as on create), or `null` to clear them.
- `whatsappTemplateVariableMap` (map from string to any, optional, nullable) — New per-contact placeholder map (same shape as on create); `null` clears it so every placeholder uses the campaign-wide values.
- `emailSubject` (string, optional, nullable) — New email subject, or `null` to clear it.
- `emailBody` (string, optional, nullable) — New email body, or `null` to clear it.

## Response

### 200

The updated campaign (or the unchanged one, for an empty body).

- `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

Invalid id or body, the campaign is completed/archived, the agent does not serve the new channel, or a token/variable map 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 or a user without the admin/owner role.

- `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 campaign (or, when changing `channel`, its agent) was not found.

- `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_patchCampaignsByCampaignId_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": "active",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 10,
          "endHour": 13,
          "enabled": true
        },
        {
          "day": "wednesday",
          "startHour": 15,
          "endHour": 19,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 2,
    "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-10T14:02:11.000Z",
    "updated_at": "2026-09-15T09:12:45.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Campaigns_patchCampaignsByCampaignId_example
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

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

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

print(response.json())
```

```javascript Campaigns_patchCampaignsByCampaignId_example
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10';
const options = {method: 'PATCH', 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_patchCampaignsByCampaignId_example
package main

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

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

	req, _ := http.NewRequest("PATCH", 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_patchCampaignsByCampaignId_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")

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

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

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

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

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Campaigns_patchCampaignsByCampaignId_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Campaigns_patchCampaignsByCampaignId_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Narrow the calling window and lower concurrency

**Request**

```json
{
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "monday",
        "startHour": 10,
        "endHour": 13,
        "enabled": true
      },
      {
        "day": "wednesday",
        "startHour": 15,
        "endHour": 19,
        "enabled": true
      }
    ]
  },
  "maxConcurrentCalls": 2
}
```

**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": "active",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 10,
          "endHour": 13,
          "enabled": true
        },
        {
          "day": "wednesday",
          "startHour": 15,
          "endHour": 19,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 2,
    "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-10T14:02:11.000Z",
    "updated_at": "2026-09-15T09:12:45.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Narrow the calling window and lower concurrency
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

payload = {
    "schedule": {
        "timezone": "America/Bogota",
        "days": [
            {
                "day": "monday",
                "startHour": 10,
                "endHour": 13,
                "enabled": True
            },
            {
                "day": "wednesday",
                "startHour": 15,
                "endHour": 19,
                "enabled": True
            }
        ]
    },
    "maxConcurrentCalls": 2
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Narrow the calling window and lower concurrency
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"schedule":{"timezone":"America/Bogota","days":[{"day":"monday","startHour":10,"endHour":13,"enabled":true},{"day":"wednesday","startHour":15,"endHour":19,"enabled":true}]},"maxConcurrentCalls":2}'
};

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

```go Narrow the calling window and lower concurrency
package main

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

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

	payload := strings.NewReader("{\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 10,\n        \"endHour\": 13,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 15,\n        \"endHour\": 19,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 2\n}")

	req, _ := http.NewRequest("PATCH", 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 Narrow the calling window and lower concurrency
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 10,\n        \"endHour\": 13,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 15,\n        \"endHour\": 19,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 2\n}"

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

```java Narrow the calling window and lower concurrency
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 10,\n        \"endHour\": 13,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 15,\n        \"endHour\": 19,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 2\n}")
  .asString();
```

```php Narrow the calling window and lower concurrency
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10', [
  'body' => '{
  "schedule": {
    "timezone": "America/Bogota",
    "days": [
      {
        "day": "monday",
        "startHour": 10,
        "endHour": 13,
        "enabled": true
      },
      {
        "day": "wednesday",
        "startHour": 15,
        "endHour": 19,
        "enabled": true
      }
    ]
  },
  "maxConcurrentCalls": 2
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Narrow the calling window and lower concurrency
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"schedule\": {\n    \"timezone\": \"America/Bogota\",\n    \"days\": [\n      {\n        \"day\": \"monday\",\n        \"startHour\": 10,\n        \"endHour\": 13,\n        \"enabled\": true\n      },\n      {\n        \"day\": \"wednesday\",\n        \"startHour\": 15,\n        \"endHour\": 19,\n        \"enabled\": true\n      }\n    ]\n  },\n  \"maxConcurrentCalls\": 2\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Narrow the calling window and lower concurrency
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "schedule": [
    "timezone": "America/Bogota",
    "days": [
      [
        "day": "monday",
        "startHour": 10,
        "endHour": 13,
        "enabled": true
      ],
      [
        "day": "wednesday",
        "startHour": 15,
        "endHour": 19,
        "enabled": true
      ]
    ]
  ],
  "maxConcurrentCalls": 2
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Rename and refresh the product context

**Request**

```json
{
  "name": "Renovaciones septiembre (segunda ola)",
  "productContext": "Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre."
}
```

**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": "active",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 10,
          "endHour": 13,
          "enabled": true
        },
        {
          "day": "wednesday",
          "startHour": 15,
          "endHour": 19,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 2,
    "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-10T14:02:11.000Z",
    "updated_at": "2026-09-15T09:12:45.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Rename and refresh the product context
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

payload = {
    "name": "Renovaciones septiembre (segunda ola)",
    "productContext": "Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Rename and refresh the product context
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Renovaciones septiembre (segunda ola)","productContext":"Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre."}'
};

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

```go Rename and refresh the product context
package main

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

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

	payload := strings.NewReader("{\n  \"name\": \"Renovaciones septiembre (segunda ola)\",\n  \"productContext\": \"Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre.\"\n}")

	req, _ := http.NewRequest("PATCH", 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 Rename and refresh the product context
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Renovaciones septiembre (segunda ola)\",\n  \"productContext\": \"Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre.\"\n}"

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

```java Rename and refresh the product context
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Renovaciones septiembre (segunda ola)\",\n  \"productContext\": \"Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre.\"\n}")
  .asString();
```

```php Rename and refresh the product context
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10', [
  'body' => '{
  "name": "Renovaciones septiembre (segunda ola)",
  "productContext": "Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Rename and refresh the product context
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Renovaciones septiembre (segunda ola)\",\n  \"productContext\": \"Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rename and refresh the product context
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Renovaciones septiembre (segunda ola)",
  "productContext": "Plan de datos móviles con 30 GB por el mismo precio de 20 GB, solo hasta el 30 de septiembre."
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Turn a WhatsApp campaign back into inbound-only

**Request**

```json
{
  "whatsappTemplateId": null
}
```

**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": "active",
    "channel": "voice",
    "category": "sales",
    "schedule": {
      "timezone": "America/Bogota",
      "days": [
        {
          "day": "monday",
          "startHour": 10,
          "endHour": 13,
          "enabled": true
        },
        {
          "day": "wednesday",
          "startHour": 15,
          "endHour": 19,
          "enabled": true
        }
      ]
    },
    "max_concurrent_calls": 2,
    "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-10T14:02:11.000Z",
    "updated_at": "2026-09-15T09:12:45.000Z",
    "deleted_at": null
  }
}
```

**SDK Code**

```python Turn a WhatsApp campaign back into inbound-only
import requests

url = "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

payload = { "whatsappTemplateId": None }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Turn a WhatsApp campaign back into inbound-only
const url = 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"whatsappTemplateId":null}'
};

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

```go Turn a WhatsApp campaign back into inbound-only
package main

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

func main() {

	url := "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10"

	payload := strings.NewReader("{\n  \"whatsappTemplateId\": null\n}")

	req, _ := http.NewRequest("PATCH", 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 Turn a WhatsApp campaign back into inbound-only
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"whatsappTemplateId\": null\n}"

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

```java Turn a WhatsApp campaign back into inbound-only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"whatsappTemplateId\": null\n}")
  .asString();
```

```php Turn a WhatsApp campaign back into inbound-only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10', [
  'body' => '{
  "whatsappTemplateId": null
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Turn a WhatsApp campaign back into inbound-only
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"whatsappTemplateId\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Turn a WhatsApp campaign back into inbound-only
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["whatsappTemplateId": ] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/campaigns/5b0c8f7e-2f4a-4d7e-9a53-0f6f2f3c1a10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```