> 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.

# Update agent

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

Updates an agent using merge semantics — only the fields you include in the request body are changed; omitted fields keep their stored values. Voice and language settings are resolved from the voice catalog when `AtlasVoiceId` or `VoiceId` is provided.

Reference: https://docs.youratlas.com/api-reference/atlas-api/agents/update-agent

## Authentication

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

## Request

### Path parameters

- `campaignId` (string, required)
- `id` (string, required)

### Body (application/json)

This endpoint expects an AgentBody.

- `Name` (string, required)
- `Language` (string, required)
- `VoiceId` (string, required)
- `AgentTypeName` (string, optional)
- `PreScript` (string, optional)
- `PostScript` (string, optional)
- `AtlasVoiceId` (string, optional)
- `Model` (string, optional)
- `Provider` (enum, optional)
  - Allowed values: `11labs`, `cartesia`, `deepgram`, `internal`, `minimax`
- `Stability` (double, optional)
- `SimilarityBoost` (double, optional)
- `BackgroundSound` (string, optional)
- `Pitch` (double, optional) — Request-only — accepted on create/update but not returned in GET responses.
- `Speed` (double, optional)
- `Region` (string, optional) — Request-only — accepted on create/update but not returned in GET responses.
- `Volume` (double, optional) — Request-only — accepted on create/update but not returned in GET responses.
- `LanguageBoost` (string, optional) — Request-only — accepted on create/update but not returned in GET responses.
- `FillerInjectionEnabled` (boolean, optional) — Request-only — accepted on create/update but not returned in GET responses.
- `TextNormalizationEnabled` (boolean, optional) — Request-only — accepted on create/update but not returned in GET responses.

## Response

### 200

Agent updated

## Errors

### 404 Not Found Error

Resource not found

- `error` (ErrorError, optional)

### 500 Internal Server Error

Internal server error

- `error` (ErrorError, optional)

## Types

### ErrorError

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

## Examples

**Request**

```json
{
  "Name": "string",
  "Language": "string",
  "VoiceId": "string"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.youratlas.com/v1/api/agent/campaignId/id"

payload = {
    "Name": "string",
    "Language": "string",
    "VoiceId": "string"
}
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/agent/campaignId/id';
const options = {
  method: 'PUT',
  headers: {'api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"Name":"string","Language":"string","VoiceId":"string"}'
};

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/agent/campaignId/id"

	payload := strings.NewReader("{\n  \"Name\": \"string\",\n  \"Language\": \"string\",\n  \"VoiceId\": \"string\"\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/agent/campaignId/id")

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  \"Name\": \"string\",\n  \"Language\": \"string\",\n  \"VoiceId\": \"string\"\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/agent/campaignId/id")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"Name\": \"string\",\n  \"Language\": \"string\",\n  \"VoiceId\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.youratlas.com/v1/api/agent/campaignId/id', [
  'body' => '{
  "Name": "string",
  "Language": "string",
  "VoiceId": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Name": "string",
  "Language": "string",
  "VoiceId": "string"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.youratlas.com/v1/api/agent/campaignId/id")! 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()
```