> ## Documentation Index
> Fetch the complete documentation index at: https://docs.foxreach.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Campaign

> Update campaign settings. Cannot edit while the campaign is active.

## Path Parameters

<ParamField path="campaign_id" type="string" required>
  The unique identifier of the campaign.
</ParamField>

## Request Body

All fields are optional. Only include the fields you want to update.

<ParamField body="name" type="string">Campaign name.</ParamField>
<ParamField body="timezone" type="string">Sending timezone.</ParamField>
<ParamField body="sendingDays" type="array">Days of the week to send.</ParamField>
<ParamField body="sendingStartHour" type="integer">Start hour.</ParamField>
<ParamField body="sendingEndHour" type="integer">End hour.</ParamField>
<ParamField body="dailyLimit" type="integer">Maximum emails per day.</ParamField>
<ParamField body="context" type="string">AI context for draft replies.</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.foxreach.io/api/v1/campaigns/cmp_abc123" \
    -H "X-API-Key: otr_your_key" \
    -H "Content-Type: application/json" \
    -d '{
      "dailyLimit": 75,
      "sendingEndHour": 18
    }'
  ```

  ```python Python SDK theme={null}
  from foxreach import FoxReach
  from foxreach.types import CampaignUpdate

  client = FoxReach(api_key="otr_your_key")
  campaign = client.campaigns.update(
      "cmp_xyz789",
      CampaignUpdate(
          daily_limit=200,
          sending_end_hour=19,
      ),
  )
  ```

  ```typescript TypeScript SDK theme={null}
  import { FoxReach } from "foxreach";

  const client = new FoxReach({ apiKey: "otr_your_key" });
  const campaign = await client.campaigns.update("cmp_xyz789", {
    dailyLimit: 200,
    sendingEndHour: 19,
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": {
      "id": "cmp_abc123",
      "name": "Q1 Outreach",
      "status": "draft",
      "dailyLimit": 75,
      "sendingEndHour": 18,
      "..."
    }
  }
  ```
</ResponseExample>

## Errors

| Status | Description                                  |
| ------ | -------------------------------------------- |
| `400`  | Cannot edit active campaign. Pause it first. |
| `404`  | Campaign not found                           |

## Rate Limit

* **100 requests per minute, per API key.** Fixed 60-second window.
* Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (unix epoch seconds).
* A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns (`Retry-After`, exponential backoff, monitoring `X-RateLimit-Remaining`), see [Rate Limiting](/rate-limiting).
