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

# Set campaign status

PUT https://api.youratlas.com/v1/api/campaign/{id}/status
Content-Type: application/json

Enable or disable a campaign

Reference: https://docs.youratlas.com/api-reference/atlas-api/campaigns/set-campaign-status

## Authentication

- `api-key` header (required) — Your Atlas API key. Get it from the Atlas Portal under Settings > API Keys.

## Request

### Path parameters

- `id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `enabled` (boolean, required)

## Response

### 200

Status updated

- `list of Voice`

## Errors

### 404 Not Found Error

Resource not found

- `error` (ErrorError, optional)

### 500 Internal Server Error

Internal server error

- `error` (ErrorError, optional)

## Types

### Voice

PascalCase Azure Table Storage row returned by `GET /voices`.

- `odata.etag` (string, optional)
- `PartitionKey` (string, optional)
- `RowKey` (string, optional)
- `Timestamp` (datetime, optional)
- `Name` (string, optional)
- `Description` (string, optional)
- `Gender` (string, optional)
- `Language` (string, optional)
- `Provider` (string, optional)
- `ProviderID` (string, optional)
- `PreviewUrl` (string, optional)
- `ProviderSettings` (string, optional) — JSON-encoded string, e.g. \{"Stability":0.5,"SimilarityBoost":0.75,"Model":"eleven\_monolingual\_v1"}

### ErrorError

- `message` (string, optional)
- `code` (string, optional)
- `requestId` (string, optional)

## Examples

**Request**

```json
{
  "enabled": true
}
```

**Response**

```json
[
  {
    "odata.etag": "string",
    "PartitionKey": "string",
    "RowKey": "string",
    "Timestamp": "2024-01-15T09:30:00Z",
    "Name": "string",
    "Description": "string",
    "Gender": "string",
    "Language": "string",
    "Provider": "string",
    "ProviderID": "string",
    "PreviewUrl": "string",
    "ProviderSettings": "string"
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.youratlas.com/v1/api/campaign/id/status"

payload = { "enabled": True }
headers = {
    "api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.youratlas.com/v1/api/campaign/id/status';
const options = {
  method: 'PUT',
  headers: {'api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"enabled":true}'
};

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.youratlas.com/v1/api/campaign/id/status"

	payload := strings.NewReader("{\n  \"enabled\": true\n}")

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

	req.Header.Add("api-key", "<apiKey>")
	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.youratlas.com/v1/api/campaign/id/status")

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

request = Net::HTTP::Put.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"enabled\": true\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.put("https://api.youratlas.com/v1/api/campaign/id/status")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"enabled\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.youratlas.com/v1/api/campaign/id/status', [
  'body' => '{
  "enabled": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.youratlas.com/v1/api/campaign/id/status");
var request = new RestRequest(Method.PUT);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"enabled\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["enabled": true] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.youratlas.com/v1/api/campaign/id/status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```