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

# Returns the custom agent's configuration.

GET https://api.awork.com/api/v1/agents/{agentId}

Returns the agent's shared settings, including the requesting user's access level.
Use this response to inspect the agent's model, prompt, and linked capabilities.
Read GET /agents/\{agentId}/configuration for the current user's selected accounts and connection status.
The user must have read access to the agent.

Reference: https://developers.awork.com/apiv1/custom-agents/get-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.

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

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

**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"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.awork.com/api/v1/agents/agentId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.get("https://api.awork.com/api/v1/agents/agentId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.awork.com/api/v1/agents/agentId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.awork.com/api/v1/agents/agentId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.awork.com/api/v1/agents/agentId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```