> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://doc.youratlas.com/v1/llms.txt
> - v2: https://doc.youratlas.com/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://doc.youratlas.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://doc.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://doc.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 of the campaign.
- `id` (string, required) — ID of the agent.

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

### 401 Unauthorized Error

Invalid or missing API key

- `error` (ErrorError, optional)

### 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": "Front desk agent",
  "Language": "en-US",
  "VoiceId": "21m00Tcm4TlvDq8ikWAM",
  "AgentTypeName": "Receptionist",
  "PreScript": "Hi, thanks for calling Example Dental. How can I help?",
  "PostScript": "Thanks for calling. Have a great day.",
  "Provider": "11labs",
  "Stability": 0.5,
  "SimilarityBoost": 0.75,
  "Speed": 1,
  "FillerInjectionEnabled": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python Agents_updateAgent_example
import requests

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

payload = {
    "Name": "Front desk agent",
    "Language": "en-US",
    "VoiceId": "21m00Tcm4TlvDq8ikWAM",
    "AgentTypeName": "Receptionist",
    "PreScript": "Hi, thanks for calling Example Dental. How can I help?",
    "PostScript": "Thanks for calling. Have a great day.",
    "Provider": "11labs",
    "Stability": 0.5,
    "SimilarityBoost": 0.75,
    "Speed": 1,
    "FillerInjectionEnabled": True
}
headers = {
    "api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Agents_updateAgent_example
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":"Front desk agent","Language":"en-US","VoiceId":"21m00Tcm4TlvDq8ikWAM","AgentTypeName":"Receptionist","PreScript":"Hi, thanks for calling Example Dental. How can I help?","PostScript":"Thanks for calling. Have a great day.","Provider":"11labs","Stability":0.5,"SimilarityBoost":0.75,"Speed":1,"FillerInjectionEnabled":true}'
};

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

```go Agents_updateAgent_example
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\": \"Front desk agent\",\n  \"Language\": \"en-US\",\n  \"VoiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n  \"AgentTypeName\": \"Receptionist\",\n  \"PreScript\": \"Hi, thanks for calling Example Dental. How can I help?\",\n  \"PostScript\": \"Thanks for calling. Have a great day.\",\n  \"Provider\": \"11labs\",\n  \"Stability\": 0.5,\n  \"SimilarityBoost\": 0.75,\n  \"Speed\": 1,\n  \"FillerInjectionEnabled\": 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 Agents_updateAgent_example
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\": \"Front desk agent\",\n  \"Language\": \"en-US\",\n  \"VoiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n  \"AgentTypeName\": \"Receptionist\",\n  \"PreScript\": \"Hi, thanks for calling Example Dental. How can I help?\",\n  \"PostScript\": \"Thanks for calling. Have a great day.\",\n  \"Provider\": \"11labs\",\n  \"Stability\": 0.5,\n  \"SimilarityBoost\": 0.75,\n  \"Speed\": 1,\n  \"FillerInjectionEnabled\": true\n}"

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

```java Agents_updateAgent_example
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\": \"Front desk agent\",\n  \"Language\": \"en-US\",\n  \"VoiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n  \"AgentTypeName\": \"Receptionist\",\n  \"PreScript\": \"Hi, thanks for calling Example Dental. How can I help?\",\n  \"PostScript\": \"Thanks for calling. Have a great day.\",\n  \"Provider\": \"11labs\",\n  \"Stability\": 0.5,\n  \"SimilarityBoost\": 0.75,\n  \"Speed\": 1,\n  \"FillerInjectionEnabled\": true\n}")
  .asString();
```

```php Agents_updateAgent_example
<?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": "Front desk agent",
  "Language": "en-US",
  "VoiceId": "21m00Tcm4TlvDq8ikWAM",
  "AgentTypeName": "Receptionist",
  "PreScript": "Hi, thanks for calling Example Dental. How can I help?",
  "PostScript": "Thanks for calling. Have a great day.",
  "Provider": "11labs",
  "Stability": 0.5,
  "SimilarityBoost": 0.75,
  "Speed": 1,
  "FillerInjectionEnabled": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

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

```csharp Agents_updateAgent_example
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\": \"Front desk agent\",\n  \"Language\": \"en-US\",\n  \"VoiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n  \"AgentTypeName\": \"Receptionist\",\n  \"PreScript\": \"Hi, thanks for calling Example Dental. How can I help?\",\n  \"PostScript\": \"Thanks for calling. Have a great day.\",\n  \"Provider\": \"11labs\",\n  \"Stability\": 0.5,\n  \"SimilarityBoost\": 0.75,\n  \"Speed\": 1,\n  \"FillerInjectionEnabled\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Agents_updateAgent_example
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "Name": "Front desk agent",
  "Language": "en-US",
  "VoiceId": "21m00Tcm4TlvDq8ikWAM",
  "AgentTypeName": "Receptionist",
  "PreScript": "Hi, thanks for calling Example Dental. How can I help?",
  "PostScript": "Thanks for calling. Have a great day.",
  "Provider": "11labs",
  "Stability": 0.5,
  "SimilarityBoost": 0.75,
  "Speed": 1,
  "FillerInjectionEnabled": true
] 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()
```