> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.heyreach.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.heyreach.io/_mcp/server.

# UpdateSettings

POST https://api//api/public/campaign/UpdateSettings
Content-Type: application/json

## Updates the general settings of a campaign: name, lead list, and exclusion options.

Allowed statuses: DRAFT, SCHEDULED, PAUSED. Returns 400 for any other status (e.g. IN_PROGRESS, FINISHED). If the campaign was SCHEDULED, it reverts to DRAFT.

**Important:** this is a full replacement of the settings below - every exclusion field you omit from the body will be reset to its default (`false` for booleans, `null` for `excludeListId`). Always send the complete set of exclusion settings you want, not a partial diff.

### Body Parameters

- **campaignId** _(long, required)_: The campaign to update.
    
- **name** _(string, required)_: New campaign name. 1-50 characters.
    
- **linkedInUserListId** _(long, required)_: Replacement lead list ID. Must be of type USER_LIST. Cannot be changed once the campaign has been started at least once.
    
- **excludeContactedFromOtherCampaigns** _(bool, optional)_: Default `false`.
    
- **excludeHasOtherAccConversations** _(bool, optional)_: Default `false`.
    
- **excludeContactedFromSenderInOtherCampaign** _(bool, optional)_: Default `false`.
    
- **excludeListId** _(long, optional)_: Must not equal `linkedInUserListId`.

Reference: https://docs.heyreach.io/hey-reach-api/campaigns/update-settings

## Request

### Headers

- `X-API-KEY` (string, optional) — API key header using this scheme. Example: "X-API-KEY: \{API\_KEY}"

### Body (application/json)

This endpoint expects an object.

- `campaignId` (integer, required)
- `name` (string, required)
- `linkedInUserListId` (integer, required)
- `excludeContactedFromOtherCampaigns` (boolean, required)
- `excludeHasOtherAccConversations` (boolean, required)
- `excludeContactedFromSenderInOtherCampaign` (boolean, required)
- `excludeListId` (any, optional, nullable)

## Examples

**Request**

```json
{
  "campaignId": 12345,
  "name": "Renamed Campaign",
  "linkedInUserListId": 123456,
  "excludeContactedFromOtherCampaigns": false,
  "excludeHasOtherAccConversations": false,
  "excludeContactedFromSenderInOtherCampaign": false
}
```

**SDK Code**

```python
import requests

url = "https://api//api/public/campaign/UpdateSettings"

payload = {
    "campaignId": 12345,
    "name": "Renamed Campaign",
    "linkedInUserListId": 123456,
    "excludeContactedFromOtherCampaigns": False,
    "excludeHasOtherAccConversations": False,
    "excludeContactedFromSenderInOtherCampaign": False
}
headers = {
    "X-API-KEY": "{{HR_API_KEY}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api//api/public/campaign/UpdateSettings';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '{{HR_API_KEY}}', 'Content-Type': 'application/json'},
  body: '{"campaignId":12345,"name":"Renamed Campaign","linkedInUserListId":123456,"excludeContactedFromOtherCampaigns":false,"excludeHasOtherAccConversations":false,"excludeContactedFromSenderInOtherCampaign":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api//api/public/campaign/UpdateSettings"

	payload := strings.NewReader("{\n  \"campaignId\": 12345,\n  \"name\": \"Renamed Campaign\",\n  \"linkedInUserListId\": 123456,\n  \"excludeContactedFromOtherCampaigns\": false,\n  \"excludeHasOtherAccConversations\": false,\n  \"excludeContactedFromSenderInOtherCampaign\": false\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "{{HR_API_KEY}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api//api/public/campaign/UpdateSettings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '{{HR_API_KEY}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"campaignId\": 12345,\n  \"name\": \"Renamed Campaign\",\n  \"linkedInUserListId\": 123456,\n  \"excludeContactedFromOtherCampaigns\": false,\n  \"excludeHasOtherAccConversations\": false,\n  \"excludeContactedFromSenderInOtherCampaign\": false\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api//api/public/campaign/UpdateSettings")
  .header("X-API-KEY", "{{HR_API_KEY}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"campaignId\": 12345,\n  \"name\": \"Renamed Campaign\",\n  \"linkedInUserListId\": 123456,\n  \"excludeContactedFromOtherCampaigns\": false,\n  \"excludeHasOtherAccConversations\": false,\n  \"excludeContactedFromSenderInOtherCampaign\": false\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api//api/public/campaign/UpdateSettings', [
  'body' => '{
  "campaignId": 12345,
  "name": "Renamed Campaign",
  "linkedInUserListId": 123456,
  "excludeContactedFromOtherCampaigns": false,
  "excludeHasOtherAccConversations": false,
  "excludeContactedFromSenderInOtherCampaign": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '{{HR_API_KEY}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/campaign/UpdateSettings");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "{{HR_API_KEY}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"campaignId\": 12345,\n  \"name\": \"Renamed Campaign\",\n  \"linkedInUserListId\": 123456,\n  \"excludeContactedFromOtherCampaigns\": false,\n  \"excludeHasOtherAccConversations\": false,\n  \"excludeContactedFromSenderInOtherCampaign\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "{{HR_API_KEY}}",
  "Content-Type": "application/json"
]
let parameters = [
  "campaignId": 12345,
  "name": "Renamed Campaign",
  "linkedInUserListId": 123456,
  "excludeContactedFromOtherCampaigns": false,
  "excludeHasOtherAccConversations": false,
  "excludeContactedFromSenderInOtherCampaign": false
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/campaign/UpdateSettings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```