---
title: "Update campaign settings (Auto Lead Refill)"
method: PATCH
path: "/campaigns/{campaignId}"
tags: ["Campaigns"]
---

# Update campaign settings (Auto Lead Refill)

`PATCH /campaigns/{campaignId}`

## Request

- Base URL: `https://origami.chat/api/v2`
- URL: `https://origami.chat/api/v2/campaigns/{campaignId}`
- Auth: HTTP bearer

Deterministic settings patch. Currently the only writable field is
Auto Lead Refill (`autoLeadRefillEnabled`) — a spend/lifecycle
toggle, not content. Returns the updated Campaign object.

Turning refill **on** on an active campaign arms the daily sourcing
task and clears a prior Origami auto-stop. It clears a billing pause
(out of credits / spend limit) too, but funding is what resumes
sourcing: an unfunded account re-pauses on the next run. Turning it
**off** unarms the task. The intent flag survives pause and draft;
the task only runs while the campaign is `active`.

Turning refill off does **not** cancel a refill run already in
flight — that batch finishes, capped by the task's per-run budget.

Duplicate-protection, send windows, daily caps, and message
content stay out of this body: change those through
`POST /campaigns/{campaignId}/edits`.

## Request body

- object: At least one of autoLeadRefillEnabled / autoTopUpEnabled is required.
  - `autoLeadRefillEnabled` boolean
  - `autoTopUpEnabled` boolean: Pre-rename spelling of autoLeadRefillEnabled. Still accepted; autoLeadRefillEnabled wins when both are sent.

## Response `200`

The updated Campaign object.

- Campaign: A first-class `campaigns` row: org-global, homed in a workspace. Its queue is the set of sequences stamped with its id (one sequence per person). It owns no table: `tableId` is derived (informational) from the dominant table of its enrolled sequences.
  - `object` 'campaign', required
  - `id` string, uuid, required
  - `slug` string, nullable, required
  - `name` string, required
  - `status` 'draft' | 'active' | 'paused', required: The campaign's lifecycle state.
  - `workspaceId` string, uuid, nullable, required: Legacy home workspace; null for campaigns created from workspace-less chats.
  - `tableId` string, uuid, nullable, required: Derived leads table (dominant enrolled-sequence table); null for a shell campaign.
  - `channels` object, required: Which channels the campaign sends on.
    - `email` boolean, required
    - `linkedin` boolean, required
  - `settings` object, required: Auto-cancel toggles (read-only on this object) + Auto Lead Refill (writable via PATCH /campaigns/{campaignId}).
    - `blockActiveDuplicates` boolean, required
    - `blockPriorContacts` boolean, required
    - `autoLeadRefillEnabled` boolean, required
    - `autoTopUpEnabled` boolean, required: Pre-rename mirror of autoLeadRefillEnabled, always equal to it. Kept so clients written against the old name keep working; read autoLeadRefillEnabled in new code.
  - `brief` unknown, required
  - `outOfLeads` boolean, required
  - `haltedCount` integer, required: How many of an active campaign's people a disconnected sender stopped rather than their finishing. Reported for every active campaign, so it can be above zero while the campaign is still sending to everyone else; combine it with outOfLeads to read the campaign's end state. outOfLeads alone cannot tell a campaign that completed from one that was cut short, since both have nothing pending: outOfLeads with haltedCount above zero means the campaign ended early, and reconnecting the sender resumes those people while adding leads will not reach them. Zero for draft and paused campaigns.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: VALIDATION_ERROR.
- `404`: CAMPAIGN_NOT_FOUND.

## Changes

- **2026-11-03** `8c6b16fe0a3b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/origami/apis/origami-agent-api/changes/campaigns/:campaignId/patch.md)

---

[API](https://skmtc.dev/origami/apis/origami-agent-api.md) - [All operations](https://skmtc.dev/origami/apis/origami-agent-api/llms.txt) - [OpenAPI document](https://skmtc.dev/origami/apis/origami-agent-api/revisions/8c6b16fe0a3b?raw)
