---
title: "Update a campaign"
method: PATCH
path: "/api/v1/campaigns/{id}"
tags: ["Campaigns"]
---

# Update a campaign

`PATCH /api/v1/campaigns/{id}`

## Request

- Base URL: `https://api.sendly.now`
- URL: `https://api.sendly.now/api/v1/campaigns/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `better-auth.session_token`
  - OAuth 2 (authorization code, authorization URL `https://app.sendly.now/api/auth/oauth2/authorize`, token URL `https://app.sendly.now/api/auth/oauth2/token`, scopes: `campaigns:write`)

Partial update: an omitted field is left untouched. Only `DRAFT` and `SCHEDULED` campaigns are editable — editing one that is already sending would change what half its recipients receive, so it answers 400.

Changing `from` re-verifies the sender domain. Changing the audience on a `DRAFT` campaign schedules a recipient recount, so `stats.total_recipients` converges shortly after the response.

A new `audience_condition` is checked as it is on create: an unsupported field or operator answers 400, and a list is targeted with `audience_type: "LIST"` and `list_id`, never a filter.

Requires the `campaigns:write` scope — Create, edit, and organize your campaigns.

## Path parameters

- `id` string, uuid, required: Resource id.

## Request body

- CampaignV1Update: Body for PATCH /api/v1/campaigns/{id}. All fields optional.
  - `audience_condition` FilterConditionV1: A filter condition: one or more groups combined with `logic`.
    - `groups` FilterGroupV1[], required
      - `conditions` FilterConditionV1 (recursive)
      - `filters` SegmentFilterV1[], required
        - `field` string, required
        - `operator` 'equals' | 'notEquals' | 'contains' | 'notContains' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'exists' | 'notExists' | 'within' | 'olderThan' | 'triggered' | 'triggeredWithin' | 'triggeredOlderThan' | 'notTriggered' | 'notTriggeredWithin' | 'isMemberOf', required
        - `unit` 'days' | 'hours' | 'minutes'
        - `value` unknown
    - `logic` 'AND' | 'OR', required
  - `audience_type` 'ALL' | 'FILTERED' | 'SEGMENT' | 'LIST'
  - `body` string
  - `description` string
  - `email_category` 'TRANSACTIONAL' | 'MARKETING' | 'SELF_MANAGED_UNSUBSCRIBE'
  - `from` string, email: Sender address. Its domain must be verified for this project.
  - `from_name` string, nullable
  - `list_id` string, uuid: Required when `audience_type` is `LIST`. Only that list's CONFIRMED members receive the campaign.
  - `name` string
  - `reply_to` string, email, nullable
  - `segment_id` string, uuid
  - `subject` string
  - `topic_id` string, uuid, nullable: The subject this campaign is about. A contact who unsubscribed from the topic is excluded WHATEVER the audience type — a topic opt-out is a standing answer, not an audience filter, so it cannot be routed around by selecting a different audience. Ignored for `TRANSACTIONAL` campaigns, which a marketing preference does not cancel.

## Response `200`

The updated campaign

- CampaignV1: A campaign as exposed on the v1 API.
  - `audience_type` 'ALL' | 'FILTERED' | 'SEGMENT' | 'LIST', required
  - `created_at` string, date-time, required
  - `id` string, uuid, required
  - `list_id` string, uuid, nullable, required
  - `name` string, required
  - `scheduled_at` string, date-time, nullable, required
  - `sent_at` string, date-time, nullable, required
  - `stats` object, required
    - `bounced` integer, required
    - `clicked` integer, required
    - `delivered` integer, required
    - `opened` integer, required
    - `sent` integer, required
    - `total_recipients` integer, required
  - `status` 'DRAFT' | 'SCHEDULED' | 'SENDING' | 'PAUSED' | 'SENT' | 'CANCELLED', required
  - `subject` string, required
  - `topic_id` string, uuid, nullable, required

## Other responses

- `400`: `validation_error` — the campaign is not in an editable status, the segment change is not allowed, or `audience_condition` filters on a field contacts cannot be filtered on, or uses an operator that field does not have. A list is not a filter field: use `audience_type: "LIST"` with `list_id`.
- `401`: `invalid_api_key` or `invalid_session` — missing or invalid credentials.
- `403`: `scope_missing`, `project_access_denied`, or `project_disabled`.
- `404`: `resource_not_found` — no campaign with this id belongs to the authenticated project.
- `422`: `validation_error` — query, path, or body parameters did not match the schema.
- `429`: `rate_limited` — see `Retry-After` and the `RateLimit` headers.
- `500`: `internal_error`.

---

[API](https://skmtc.dev/sendly/apis/sendly-api.md) · [All operations](https://skmtc.dev/sendly/apis/sendly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sendly/apis/sendly-api/revisions/ce7cfb7f7c7e?raw)
