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

# Updates the custom agent's configuration.

PUT https://api.awork.com/api/v1/agents/{agentId}
Content-Type: application/json

Updates the custom agent's configuration and returns the saved agent.
Saves a new system prompt version if the prompt changes.
The user must have manage access to the agent. Changing workspace sharing also requires permission to contribute to the agent library.

Reference: https://developers.awork.com/apiv1/custom-agents/put-agents-by-agent-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `agentId` (string, required) — The agent id.

### Body (application/json)

This endpoint expects an UpdateAgentRequestModel.

- `name` (string, required) — The name shown to users.
- `description` (string, required) — A short explanation of what the agent does.
- `workspaceAccessLevel` (enum, required) — The access level granted to every member of the workspace.
  - Allowed values: `none`, `read`, `manage`
- `reasoningLevel` (string, required) — The amount of reasoning the model uses.
- `systemPrompt` (string, required) — The instructions that control the agent's behavior.
- `webSearchEnabled` (boolean, required) — Whether web search is enabled.
- `aworkAccessEnabled` (boolean, required) — Whether awork access is enabled.
- `googleGenAiAccessEnabled` (boolean, required) — Whether Google image generation is enabled.
- `openAiImageGenerationAccessEnabled` (boolean, required) — Whether OpenAI image generation is enabled.
- `modelProvider` (string, optional, nullable) — The model provider when no preset is selected.
- `modelName` (string, optional, nullable) — The model name when no preset is selected.
- `presetKey` (string, optional, nullable) — The workspace model preset to use.

## Response

### 200

OK

- `id` (string, optional) — The id of the entity.
- `createdOn` (string, optional) — The date this entity was created.
- `createdBy` (string, optional) — The id of the user who created this entity.
- `updatedOn` (string, optional) — The date this entity was last modified.
- `updatedBy` (string, optional) — The id of the user who last modified this entity.
- `type` (string, optional, nullable) — The public agent type.
- `connectors` (list of AgentConnectorLinkResponseModel, optional, nullable) — The linked connectors.
- `name` (string, optional, nullable) — The name shown to users.
- `description` (string, optional, nullable) — A short explanation of what the agent does.
- `currentSystemPromptVersionId` (string, optional, nullable) — The current system prompt version.
- `modelProvider` (string, optional, nullable) — The configured model provider when no preset is selected.
- `modelName` (string, optional, nullable) — The configured model name when no preset is selected.
- `presetKey` (string, optional, nullable) — The configured workspace model preset key.
- `reasoningLevel` (string, optional, nullable) — The configured reasoning level.
- `systemPrompt` (string, optional, nullable) — The current system prompt.
- `webSearchEnabled` (boolean, optional) — Whether web search is enabled.
- `aworkAccessEnabled` (boolean, optional) — Whether awork access is enabled.
- `googleGenAiAccessEnabled` (boolean, optional) — Whether Google image generation is enabled.
- `openAiImageGenerationAccessEnabled` (boolean, optional) — Whether OpenAI image generation is enabled.
- `skillIds` (list of string, optional, nullable) — The skills linked to the agent.
- `hasImage` (boolean, optional) — Whether the agent has a profile image.
- `isArchived` (boolean, optional) — Whether the agent is archived.
- `workspaceAccessLevel` (enum, optional, nullable) — The workspace-wide access level.
  - Allowed values: `read`, `manage`
- `accessLevel` (enum, optional) — The requesting user's access level.
  - Allowed values: `read`, `manage`

## Errors

### 400 Bad Request Error

Bad Request

- `code` (string, required) — The error code.
- `description` (string, required) — The description of the error.
- `link` (string, required) — The link to the API documentation page.
- `details` (list of string, optional, nullable) — A list of details describing the error.
- `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property.
- `traceId` (string, optional, nullable) — The request trace id for tracking the request.

### 401 Unauthorized Error

Unauthorized

- `code` (string, required) — The error code.
- `description` (string, required) — The description of the error.
- `link` (string, required) — The link to the API documentation page.
- `details` (list of string, optional, nullable) — A list of details describing the error.
- `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property.
- `traceId` (string, optional, nullable) — The request trace id for tracking the request.

### 404 Not Found Error

Not Found

- `code` (string, required) — The error code.
- `description` (string, required) — The description of the error.
- `link` (string, required) — The link to the API documentation page.
- `details` (list of string, optional, nullable) — A list of details describing the error.
- `validationErrors` (list of ValidationErrorResponse, optional, nullable) — If a validation error occurred, this contains the validation errors for each property.
- `traceId` (string, optional, nullable) — The request trace id for tracking the request.

## Types

### AgentConnectorLinkResponseModel

A connector linked to a custom agent, with settings shared by everyone who uses the agent.

- `id` (string, optional) — The linked connector identifier.
- `name` (string, optional, nullable) — The connector name.
- `status` (string, optional, nullable) — Always pending in this shared response. It does not indicate whether an account is connected. Read the agent's configuration endpoint for the current user's connection status.
- `connectionMode` (string, optional, nullable) — How the agent chooses an account: actingUser lets each user supply their own; specificConnection uses the editor-provided account for everyone.
- `connectionId` (string, optional, nullable) — The editor-provided account id in specificConnection mode; otherwise null.

### ValidationErrorResponse

The validation error response.

- `property` (string, optional, nullable) — The name of the property that failed validation.
- `message` (string, optional, nullable) — The reason why this property failed validation.

## Examples

**Request**

```json
{
  "name": "Client Status Reporter",
  "description": "Prepares client-ready project status reports.",
  "workspaceAccessLevel": "none",
  "reasoningLevel": "medium",
  "systemPrompt": "Prepare concise client-ready project updates from awork data.",
  "webSearchEnabled": true,
  "aworkAccessEnabled": true,
  "googleGenAiAccessEnabled": false,
  "openAiImageGenerationAccessEnabled": false
}
```

**Response**

```json
{
  "id": "23e68187-91d6-4f7e-8d31-e3f2c60d7427",
  "createdOn": "2022-03-11T15:33:47.100Z",
  "createdBy": "9ad63972-4396-4b0b-9e7d-40b852cdebf8",
  "updatedOn": "2022-03-11T21:15:00.100Z",
  "updatedBy": "3d844c62-7410-4df9-a5b2-78805c0ee260",
  "type": "custom-agent",
  "connectors": [
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "name": "Google Drive",
      "status": "pending",
      "connectionMode": "specificConnection",
      "connectionId": "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
    }
  ],
  "name": "Client Status Reporter",
  "description": "Prepares client-ready project status reports.",
  "currentSystemPromptVersionId": "fd077515-d4a8-4f79-9fbf-19271bd0123d",
  "modelProvider": "openai",
  "modelName": "gpt-5.6-terra",
  "presetKey": "balanced",
  "reasoningLevel": "medium",
  "systemPrompt": "Prepare concise client-ready project updates from awork data.",
  "webSearchEnabled": true,
  "aworkAccessEnabled": true,
  "googleGenAiAccessEnabled": false,
  "openAiImageGenerationAccessEnabled": false,
  "skillIds": [
    "string"
  ],
  "hasImage": true,
  "isArchived": false,
  "workspaceAccessLevel": null,
  "accessLevel": "manage"
}
```

**SDK Code**

```python
import requests

url = "https://api.awork.com/api/v1/agents/agentId"

payload = {
    "name": "Client Status Reporter",
    "description": "Prepares client-ready project status reports.",
    "workspaceAccessLevel": "none",
    "reasoningLevel": "medium",
    "systemPrompt": "Prepare concise client-ready project updates from awork data.",
    "webSearchEnabled": True,
    "aworkAccessEnabled": True,
    "googleGenAiAccessEnabled": False,
    "openAiImageGenerationAccessEnabled": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.awork.com/api/v1/agents/agentId';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Client Status Reporter","description":"Prepares client-ready project status reports.","workspaceAccessLevel":"none","reasoningLevel":"medium","systemPrompt":"Prepare concise client-ready project updates from awork data.","webSearchEnabled":true,"aworkAccessEnabled":true,"googleGenAiAccessEnabled":false,"openAiImageGenerationAccessEnabled":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.awork.com/api/v1/agents/agentId"

	payload := strings.NewReader("{\n  \"name\": \"Client Status Reporter\",\n  \"description\": \"Prepares client-ready project status reports.\",\n  \"workspaceAccessLevel\": \"none\",\n  \"reasoningLevel\": \"medium\",\n  \"systemPrompt\": \"Prepare concise client-ready project updates from awork data.\",\n  \"webSearchEnabled\": true,\n  \"aworkAccessEnabled\": true,\n  \"googleGenAiAccessEnabled\": false,\n  \"openAiImageGenerationAccessEnabled\": false\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.awork.com/api/v1/agents/agentId")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Client Status Reporter\",\n  \"description\": \"Prepares client-ready project status reports.\",\n  \"workspaceAccessLevel\": \"none\",\n  \"reasoningLevel\": \"medium\",\n  \"systemPrompt\": \"Prepare concise client-ready project updates from awork data.\",\n  \"webSearchEnabled\": true,\n  \"aworkAccessEnabled\": true,\n  \"googleGenAiAccessEnabled\": false,\n  \"openAiImageGenerationAccessEnabled\": 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.put("https://api.awork.com/api/v1/agents/agentId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Client Status Reporter\",\n  \"description\": \"Prepares client-ready project status reports.\",\n  \"workspaceAccessLevel\": \"none\",\n  \"reasoningLevel\": \"medium\",\n  \"systemPrompt\": \"Prepare concise client-ready project updates from awork data.\",\n  \"webSearchEnabled\": true,\n  \"aworkAccessEnabled\": true,\n  \"googleGenAiAccessEnabled\": false,\n  \"openAiImageGenerationAccessEnabled\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.awork.com/api/v1/agents/agentId', [
  'body' => '{
  "name": "Client Status Reporter",
  "description": "Prepares client-ready project status reports.",
  "workspaceAccessLevel": "none",
  "reasoningLevel": "medium",
  "systemPrompt": "Prepare concise client-ready project updates from awork data.",
  "webSearchEnabled": true,
  "aworkAccessEnabled": true,
  "googleGenAiAccessEnabled": false,
  "openAiImageGenerationAccessEnabled": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.awork.com/api/v1/agents/agentId");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Client Status Reporter\",\n  \"description\": \"Prepares client-ready project status reports.\",\n  \"workspaceAccessLevel\": \"none\",\n  \"reasoningLevel\": \"medium\",\n  \"systemPrompt\": \"Prepare concise client-ready project updates from awork data.\",\n  \"webSearchEnabled\": true,\n  \"aworkAccessEnabled\": true,\n  \"googleGenAiAccessEnabled\": false,\n  \"openAiImageGenerationAccessEnabled\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Client Status Reporter",
  "description": "Prepares client-ready project status reports.",
  "workspaceAccessLevel": "none",
  "reasoningLevel": "medium",
  "systemPrompt": "Prepare concise client-ready project updates from awork data.",
  "webSearchEnabled": true,
  "aworkAccessEnabled": true,
  "googleGenAiAccessEnabled": false,
  "openAiImageGenerationAccessEnabled": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.awork.com/api/v1/agents/agentId")! 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()
```