> 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 a custom agent's connection configuration for the current user.

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

Returns the linked connector and skill ids, the account selected for each connector,
why that account was selected, and whether it is available.
Uses a saved agent choice, or the enabled awork Agent default when no choice is saved.
An editor-provided account is used when the connector has specificConnection mode.
API-key requests do not inherit awork Agent defaults.
This read does not save or change any choices.
The user must have read access to the agent.

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

- `agentId` (string, optional) — The custom agent identifier.
- `enabledConnectorIds` (list of string, optional, nullable) — The ids of connectors linked to this agent. A linked connector may still need a working account.
- `enabledSkillIds` (list of string, optional, nullable) — The ids of skills linked to this agent.
- `connectorConnections` (list of CustomAgentConnectorConfigurationModel, optional, nullable) — One entry per linked connector, with this user's account choice, its source, and its availability.

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

### CustomAgentConnectorConfigurationModel

The account one connector would use for the current user, and whether that account is available.

- `connectorId` (string, optional) — The linked connector identifier.
- `selectedConnectionId` (string, optional, nullable) — The account this user explicitly chose for this agent and connector; null when no choice is saved.
- `defaultConnectionId` (string, optional, nullable) — The account the agent would try to use after applying the selection rules; null when none is selected. This may be a saved choice, an awork Agent default, or an editor-provided account. Check Status before treating the account as available.
- `connectionSource` (string, optional, nullable) — Why the account was selected: userSelection is this user's saved agent choice; personalDefault is their enabled awork Agent default; specificConnection is the editor-provided account; none means no account was selected.
- `status` (string, optional, nullable) — The account's availability: pending, connected, authRequired, error, or suspended. Missing means no account could be selected. Inaccessible means the user cannot use the connector or account.

### 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
{
  "agentId": "23e68187-91d6-4f7e-8d31-e3f2c60d7427",
  "enabledConnectorIds": [
    "string"
  ],
  "enabledSkillIds": [
    "string"
  ],
  "connectorConnections": [
    {
      "connectorId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "selectedConnectionId": "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
      "defaultConnectionId": "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
      "connectionSource": "userSelection",
      "status": "connected"
    }
  ]
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://api.awork.com/api/v1/agents/agentId/configuration';
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/configuration"

	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/configuration")

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/configuration")
  .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/configuration', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.awork.com/api/v1/agents/agentId/configuration");
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/configuration")! 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()
```