---
title: "Update campaign"
method: PUT
path: "/campaigns/{id}"
tags: ["Campaigns"]
---

# Update campaign

`PUT /campaigns/{id}`

## Request

- Base URL: `https://api.textla.com/v1`
- URL: `https://api.textla.com/v1/campaigns/{id}`
- Auth: HTTP bearer

Corrects a scheduled or pending-approval campaign — its message, audience or send time — before it fires. Every field is required: the body replaces all of them except media, which stays unchanged. It is 404 when the account has no campaign with the ID, and 409 when the campaign is not `active`, `paused` or `pending_approval` or a send is in progress.

## Path parameters

- `id` string, required

## Request body

- UpdateCampaignInput
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `audience` Audience, required
    - `all_contacts` boolean: Targets every contact. Must be true when set; cannot be combined with groups, keywords or tags.
    - `groups` Labels
      - `exclude` string[], nullable: Label names to exclude. Must not overlap include. At most 100.
      - `include` string[], nullable: Label names to match. At most 100.
      - `match` string: How include is applied: all, and, none or or. all takes no include values, none takes none. Defaults to and.
    - `keywords` Labels
      - `exclude` string[], nullable: Label names to exclude. Must not overlap include. At most 100.
      - `include` string[], nullable: Label names to match. At most 100.
      - `match` string: How include is applied: all, and, none or or. all takes no include values, none takes none. Defaults to and.
    - `tags` Labels
      - `exclude` string[], nullable: Label names to exclude. Must not overlap include. At most 100.
      - `include` string[], nullable: Label names to match. At most 100.
      - `match` string: How include is applied: all, and, none or or. all takes no include values, none takes none. Defaults to and.
  - `message` string, required: Message text, 1 to 1600 characters, with no leading whitespace. May use contact-field variables such as {{ first_name }}.
  - `name` string, required: Campaign name, 1 to 191 characters after trimming.
  - `phone_number` string, required: Sender number. Must be one of the account's verified senders (see List Senders).
  - `send_at` integer, required: Send time in milliseconds since the Unix epoch. Must be in the future.

## Response `200`

OK

- Campaign
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `audience` AudienceFilter, required
    - `all_contacts` boolean, nullable, required
    - `groups` LabelFilter, required
      - `exclude` string[], nullable, required
      - `include` string[], nullable, required
      - `match` string, nullable, required
    - `keywords` LabelFilter, required
      - `exclude` string[], nullable, required
      - `include` string[], nullable, required
      - `match` string, nullable, required
    - `tags` LabelFilter, required
      - `exclude` string[], nullable, required
      - `include` string[], nullable, required
      - `match` string, nullable, required
  - `batch_count` integer, required
  - `created_at` integer, required
  - `current_batch` CurrentBatch, required
    - `id` string, required
    - `status` string, required
  - `failure_code` string, nullable, required
  - `id` string, required
  - `media` Media[], nullable, required
    - `content_type` string, required
    - `height` integer, nullable, required
    - `id` string, required
    - `name` string, required
    - `size_bytes` integer, required
    - `url` string, nullable, required
    - `width` integer, nullable, required
  - `message` string, required
  - `message_count` integer, required
  - `name` string, required
  - `phone_number` string, required
  - `rejection_reason` string, nullable, required
  - `send_at` integer, nullable, required
  - `status` string, required
  - `updated_at` integer, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `412`: Precondition Failed
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error
- `501`: Not Implemented
- `502`: Bad Gateway
- `503`: Service Unavailable
- `504`: Gateway Timeout

---

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