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

# Update job agent

PATCH https://v1.getraya.app/api/job-agent/{id}
Content-Type: application/json

Updates specific fields of a job agent using its UUID. Verifies the agent has at least one job. At least one field must be provided for update. **Caution:** Update overwrites everything — ensure your payload includes all data you want to keep to prevent data loss (e.g. GET the job agent first, merge changes, then PATCH).

Reference: https://docs.getraya.app/api-reference/job-agents/update-job-agent

## Authentication

- `X-API-Key` header (required) — API key for authentication. Example: raya_ABCD1234567890abcdef

## Request

### Path parameters

- `id` (string, required) — The UUID of the job agent

### Body (application/json)

This endpoint expects an UpdateJobAgentRequest.

- `name` (string, optional) — Job agent name. If provided, replaces the existing name.
- `agent_role` (string, optional) — How the voice agent should behave (e.g. prescreening interviewer). Not the job/position title. If provided, replaces the agent role.
- `introduction` (string, optional) — Introduction text. If provided, replaces the introduction.
- `about_job` (string, optional) — About the job. If provided, replaces the about-job section.
- `about_company` (string, optional) — About the company. If provided, replaces the about-company section.
- `extra_instructions` (string, optional) — Extra instructions. If provided, replaces the extra instructions.
- `closing_message` (string, optional) — Closing message. If provided, replaces the closing message.
- `questions` (list of string, optional) — Interview questions. If provided, replaces the questions list.
- `output_fields` (list of UpdateJobAgentRequestOutputFieldsItems, optional) — Array of key-description pairs. Each item has key and description only. If provided, replaces the agent's output_fields.
- `output_instructions` (string, optional) — Instructions for how to populate output_fields after a call. If provided, replaces the agent's output_instructions.
- `webhook_url` (string, optional) — Webhook URL for callbacks (sent on call completed or call failure). Must be a valid URL or null. See [Webhooks](/voice-agents/core-concepts#webhooks) for payload format and when webhooks are sent.
- `required_silence_after_speech` (double, optional) — Required silence after speech in seconds
- `allowed_silence_before_nudge` (double, optional) — Allowed silence before nudge in seconds
- `allowed_speech_before_nudge` (double, optional) — Allowed speech before nudge in seconds
- `out_did` (double, optional) — Outbound DID number for the agent's phone record
- `allow_call_transfer` (boolean, optional) — India only. When true, live call transfer to a human is allowed.
- `transfer_destination_phone` (string, optional, nullable) — India mobile (10 digits, no +91). Null clears stored transfer destination.

## Response

### 200

Job agent updated successfully

- `uuid` (string, optional) — Unique identifier of the agent
- `name` (string, optional) — Name of the agent
- `agent_role` (string, optional) — Agent role: how the voice agent should behave (e.g. prescreening interviewer). Distinct from job role (the position being hired for).
- `introduction` (string, optional) — Introduction
- `about_job` (string, optional) — About job
- `about_company` (string, optional) — About company
- `extra_instructions` (string, optional) — Extra instructions
- `output_instructions` (string, optional) — Instructions for how to populate output_fields after a call.
- `closing_message` (string, optional) — Closing message
- `questions` (list of string, optional) — Questions
- `output_fields` (list of JobAgentDetailsResponseOutputFieldsItems, optional) — Array of key-description pairs. Each item has key and description only (no extra properties).
- `agent_args` (map from string to any, optional) — Agent arguments as a JSON object (e.g. \{"contact\_name": "John", "order\_id": "123"}). Not an array.
- `required_silence_after_speech` (double, optional, nullable) — Required silence after speech in seconds
- `allowed_silence_before_nudge` (double, optional, nullable) — Allowed silence before nudge in seconds
- `allowed_speech_before_nudge` (double, optional, nullable) — Allowed speech before nudge in seconds
- `out_did` (double, optional, nullable) — Outbound DID number
- `in_did` (double, optional, nullable) — Inbound DID number (read-only; for reference)
- `webhook_url` (string, optional, nullable) — Webhook URL for callbacks (sent on call completed or call failure). See [Webhooks](/voice-agents/core-concepts#webhooks) for payload format.
- `allow_call_transfer` (boolean, optional) — India only. When true, live call transfer to a human is allowed.
- `transfer_destination_phone` (string, optional, nullable) — India mobile (10 digits, no +91). Null if unused.

## Errors

### 400 Bad Request Error

Validation error

- `error` (string, optional)
- `message` (string, optional)

### 401 Unauthorized Error

Unauthorized - Invalid or missing API key

- `error` (string, optional)
- `message` (string, optional)

### 404 Not Found Error

Job agent not found

- `error` (string, optional)
- `message` (string, optional)

### 500 Internal Server Error

Internal server error

- `error` (string, optional)
- `message` (string, optional)

## Types

### UpdateJobAgentRequestOutputFieldsItems

- `key` (string, required)
- `description` (string, optional, default: )

### JobAgentDetailsResponseOutputFieldsItems

- `key` (string, required) — Field name (e.g. current_ctc)
- `description` (string, optional, default: ) — Description of what to extract

## Examples

**Request**

```json
{
  "webhook_url": "https://example.com/webhook",
  "required_silence_after_speech": 0.5,
  "allowed_silence_before_nudge": 25,
  "allowed_speech_before_nudge": 35,
  "out_did": 918040582331
}
```

**Response**

```json
{
  "uuid": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Senior Python Developer",
  "agent_role": "HR Prescreening Agent for Senior Python Developer Position",
  "introduction": "Hello! Thank you for your interest in our Senior Python Developer position. I'm calling to conduct a brief prescreening interview to learn more about your background and experience.",
  "about_job": "We are looking for a Senior Python Developer with 5+ years of experience in Python development, experience with Django or Flask frameworks, and strong knowledge of database systems. The role involves building scalable backend systems and working with microservices architecture.",
  "about_company": "We are a fast-growing technology company specializing in cloud-based solutions. We value innovation, collaboration, and continuous learning. Our team works on cutting-edge projects that impact millions of users worldwide.",
  "extra_instructions": "Be professional and friendly. Ask follow-up questions when needed. Take notes on the candidate's responses. If the candidate seems uninterested or unavailable, politely end the call.",
  "output_instructions": "Extract all candidate information accurately. Ensure dates are in YYYY-MM-DD format. Mark availability as \"immediate\", \"2 weeks\", \"1 month\", or \"negotiable\".",
  "closing_message": "Thank you for taking the time to speak with me today. Our hiring team will review your information and get back to you within the next few business days. Have a great day!",
  "questions": [
    "How many years of experience do you have with Python?",
    "What Python frameworks have you worked with?",
    "Do you have experience with Django or Flask?",
    "What is your current notice period?",
    "What is your expected salary range?",
    "Are you available for a technical interview next week?"
  ],
  "output_fields": [
    {
      "key": "current_ctc",
      "description": "Numeric only"
    },
    {
      "key": "notice_period",
      "description": "in days"
    }
  ],
  "agent_args": {},
  "required_silence_after_speech": 0.4,
  "allowed_silence_before_nudge": 20,
  "allowed_speech_before_nudge": 30,
  "out_did": 918040582331,
  "in_did": 918040582331,
  "webhook_url": "https://example.com/webhook",
  "allow_call_transfer": true,
  "transfer_destination_phone": "9876543210"
}
```

**SDK Code**

```python Job Agents_updateJobAgent_example
import requests

url = "https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000"

payload = {
    "webhook_url": "https://example.com/webhook",
    "required_silence_after_speech": 0.5,
    "allowed_silence_before_nudge": 25,
    "allowed_speech_before_nudge": 35,
    "out_did": 918040582331
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Job Agents_updateJobAgent_example
const url = 'https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000';
const options = {
  method: 'PATCH',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"webhook_url":"https://example.com/webhook","required_silence_after_speech":0.5,"allowed_silence_before_nudge":25,"allowed_speech_before_nudge":35,"out_did":918040582331}'
};

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

```go Job Agents_updateJobAgent_example
package main

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

func main() {

	url := "https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000"

	payload := strings.NewReader("{\n  \"webhook_url\": \"https://example.com/webhook\",\n  \"required_silence_after_speech\": 0.5,\n  \"allowed_silence_before_nudge\": 25,\n  \"allowed_speech_before_nudge\": 35,\n  \"out_did\": 918040582331\n}")

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

	req.Header.Add("X-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 Job Agents_updateJobAgent_example
require 'uri'
require 'net/http'

url = URI("https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000")

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

request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"webhook_url\": \"https://example.com/webhook\",\n  \"required_silence_after_speech\": 0.5,\n  \"allowed_silence_before_nudge\": 25,\n  \"allowed_speech_before_nudge\": 35,\n  \"out_did\": 918040582331\n}"

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

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

HttpResponse<String> response = Unirest.patch("https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"webhook_url\": \"https://example.com/webhook\",\n  \"required_silence_after_speech\": 0.5,\n  \"allowed_silence_before_nudge\": 25,\n  \"allowed_speech_before_nudge\": 35,\n  \"out_did\": 918040582331\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000', [
  'body' => '{
  "webhook_url": "https://example.com/webhook",
  "required_silence_after_speech": 0.5,
  "allowed_silence_before_nudge": 25,
  "allowed_speech_before_nudge": 35,
  "out_did": 918040582331
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Job Agents_updateJobAgent_example
using RestSharp;

var client = new RestClient("https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"webhook_url\": \"https://example.com/webhook\",\n  \"required_silence_after_speech\": 0.5,\n  \"allowed_silence_before_nudge\": 25,\n  \"allowed_speech_before_nudge\": 35,\n  \"out_did\": 918040582331\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Job Agents_updateJobAgent_example
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "webhook_url": "https://example.com/webhook",
  "required_silence_after_speech": 0.5,
  "allowed_silence_before_nudge": 25,
  "allowed_speech_before_nudge": 35,
  "out_did": 918040582331
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://v1.getraya.app/api/job-agent/123e4567-e89b-12d3-a456-426614174000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```