> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# エージェントを一覧表示

GET https://api.elevenlabs.io/v1/convai/agents

エージェントとそのメタデータのリストを返します。

Reference: https://elevenlabs.io/docs/api-reference/agents/list

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Query parameters

- `page_size` (integer, optional, default: 30) — 返すエージェントの最大数です。100を超えることはできず、デフォルトは30です。
- `search` (string, optional, nullable) — エージェント名で検索します。
- `archived` (boolean, optional, nullable, default: false) — アーカイブ状態でエージェントをフィルター
- `show_only_owned_agents` (boolean, optional, default: false, deprecated) — trueに設定すると、エンドポイントは他者から共有されたエージェントを除外し、自分が所有するエージェントのみを含めます。非推奨：代わりにcreated_by_user_idを使用してください。
- `created_by_user_id` (string, optional, nullable) — 作成者ユーザーIDでエージェントをフィルターします。設定すると、このユーザーが作成したエージェントのみが返されます。show_only_owned_agentsより優先されます。認証済みユーザーを指定するには'@me'を使用します。
- `tags` (list of string, optional, nullable) — タグでエージェントをフィルターします。複数のタグのいずれかに一致させるには、パラメータを繰り返し指定します。
- `sort_direction` (enum, optional) — 結果の並べ替え方向
  - Allowed values: `asc`, `desc`
- `sort_by` (enum, optional, nullable) — 結果の並べ替えに使用するフィールド
  - Allowed values: `name`, `created_at`, `call_count_7d`
- `cursor` (string, optional, nullable) — 次のページを取得するために使用します。カーソルはレスポンスで返されます。

## Response

### 200

成功レスポンス。

- `agents` (list of AgentSummaryResponseModel, required) — エージェントとそのメタデータのリストです。
- `has_more` (boolean, required) — ページネーションで取得できるエージェントがさらにあるかどうか
- `next_cursor` (string, optional, nullable) — エージェントをページネーションするための次のカーソル。

## Errors

### 422 Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### AgentSummaryResponseModel

- `agent_id` (string, required) — エージェントのID
- `name` (string, required) — エージェントの名前。
- `voice_id` (string, required) — このエージェントに割り当てられた音声ID
- `tags` (list of string, required) — エージェントの分類に使用するタグ
- `created_at_unix_secs` (integer, required) — Unix秒で表したエージェントの作成時刻
- `access_info` (ResourceAccessInfo, required) — エージェントのアクセス情報。
- `last_call_time_unix_secs` (integer, optional, nullable) — 直近の通話時刻（Unix秒）です。通話が行われていない場合はnullです。
- `archived` (boolean, optional, default: false) — エージェントがアーカイブされているかどうか。

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ResourceAccessInfo

- `is_creator` (boolean, required) — リクエストを行うユーザーがエージェントの作成者かどうか
- `creator_name` (string, required) — エージェント作成者の名前
- `creator_email` (string, required) — エージェント作成者のメールアドレス
- `role` (enum, required) — リクエストを行うユーザーのロール
  - Allowed values: `admin`, `editor`, `commenter`, `viewer`
- `anonymous_access_level_override` (enum, optional, nullable) — 匿名ユーザーのアクセスレベル。Noneの場合、このリソースは公開共有されません。
  - Allowed values: `admin`, `editor`, `commenter`, `viewer`
- `access_source` (enum, optional, nullable) — リクエストしたユーザーがこのリソースにアクセスできる理由。'creator'＝呼び出し元がオーナーです。'explicit'＝呼び出し元（またはそのワークスペースグループのいずれか）が、ワークスペース全体のeveryoneグループ以外としてrole_to_group_idsに記載されています。'workspace_default'＝ワークスペース全体のeveryoneグループがrole_to_group_idsに記載されています（管理者を含む、匿名ではないすべてのワークスペースメンバーがこのリソースを閲覧できます）。'workspace_admin'＝呼び出し元がワークスペース管理者であり、管理者シートがアクセスする*唯一*の経路です。これは他の誰も閲覧できないドキュメント用に予約されています。管理者バイパスの閲覧者が明示的に共有されていないドキュメントを閲覧できる理由をUIで表示できます。
  - Allowed values: `creator`, `explicit`, `workspace_admin`, `workspace_default`

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "agents": [
    {
      "agent_id": "J3Pbu5gP6NNKBscdCdwB",
      "name": "My Agent",
      "voice_id": "UCaNsl8F6Xh4GALkVMLS",
      "tags": [
        "Customer Support",
        "Technical Help",
        "Eleven"
      ],
      "created_at_unix_secs": 1716153600,
      "access_info": {
        "is_creator": true,
        "creator_name": "John Doe",
        "creator_email": "john@example.com",
        "role": "admin"
      },
      "archived": false
    }
  ],
  "has_more": false,
  "next_cursor": "123"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/agents"

querystring = {"archived":"false","tags":"[\"Customer Support\"]"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D';
const options = {method: 'GET'};

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.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D"

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

	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.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D")

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

request = Net::HTTP::Get.new(url)

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.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/agents?archived=false&tags=%5B%22Customer+Support%22%5D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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