# Edit campaign settings

> PATCH /campaigns/{id}. HeyRik API parameters and documented request and response examples.

Source: https://www.heyrik.com/docs/api-reference/campaigns/patch-campaigns-id-edit-campaign-settings

PATCH https://server.heyrik.com/api/v1/campaigns/{id}

## Path parameters

- id (required): Replace {id} in the request URL with the value for this resource.

## Headers

Authorization: Bearer $HEYRIK_API_KEY (required). Keep your key on your server.

## Parameters

- name (string): Rename the campaign.
- max_retries (number): How many times to re-dial a lead that didn't connect.
- retry_delay_sec (number): Seconds to wait before a retry.
- schedule_at (string): ISO time to start automatically (null to clear).
- call_window_start / call_window_end (string): "HH:MM" 24h — only dial within this daily window (in `timezone`).
- call_days (number[]): Days to dial, 0=Sun…6=Sat. null/[] = every day.
- timezone (string): IANA tz for the window, e.g. "Asia/Kolkata".
- extraction_schema (object[]): Per-campaign fields to extract on every call: [{ name, description }].
- classify (object): Auto-tag each call into a bucket: { field, buckets: [{ label, description }] } — lands on each contact's category.
- webhook_url (string): POST each finished call to this URL.

## Notes

Edit anytime — a running campaign picks the new settings up on its next dial. The calling window keeps a bulk run inside business hours.

## Request example

```sh
curl -X PATCH https://server.heyrik.com/api/v1/campaigns/cmp_4a19 \
  -H "Authorization: Bearer $HEYRIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "max_retries": 2,
    "retry_delay_sec": 600,
    "call_window_start": "10:00",
    "call_window_end": "18:00",
    "call_days": [1, 2, 3, 4, 5],
    "timezone": "Asia/Kolkata",
    "classify": { "field": "lead_category", "buckets": [
      { "label": "hot", "description": "ready to buy" },
      { "label": "cold", "description": "not interested" }
    ] }
  }'
```
