> 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/agent-testing

列出所有智能体响应测试，支持分页和可选的搜索筛选。

Reference: https://elevenlabs.io/docs/api-reference/tests/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

- `cursor` (string, optional, nullable) — 用于获取下一页。响应中会返回游标。
- `page_size` (integer, optional, default: 30) — 最多返回的测试数量。不能超过 100，默认为 30。
- `search` (string, optional, nullable) — 按名称筛选测试和文件夹的搜索查询。
- `parent_folder_id` (string, optional, nullable) — 按父文件夹 ID 筛选。使用 'root' 获取根文件夹中的项目。
- `types` (list of enum, optional, nullable) — 提供后，端点仅返回指定类型的测试或文件夹。
  - Allowed values: `llm`, `tool`, `simulation`, `folder`
- `include_folders` (boolean, optional, nullable, deprecated) — 已弃用。请改用 `types` 查询参数，并包含 `folder`。
- `sort_mode` (enum, optional, default: default) — 测试列表排序模式。使用 'folders_first' 将文件夹排在测试前。
  - Allowed values: `default`, `folders_first`
- `sharing_mode` (enum, optional) — 筛选测试可见性。使用 `shared_with_me` 仅返回与当前用户共享但并非由其创建的测试或文件夹。
  - Allowed values: `all`, `shared_with_me`
- `created_by_user_id` (string, optional, nullable) — 按创建者用户 ID 筛选测试和文件夹。使用 '@me' 指代已验证用户。

## Response

### 200

成功响应

- `tests` (list of UnitTestSummaryResponseModel, required)
- `has_more` (boolean, required)
- `next_cursor` (string, optional, nullable)

## Errors

### 422 Unprocessable Entity Error

验证错误。

- `detail` (list of ValidationError, optional)

## Types

### UnitTestSummaryResponseModel

- `id` (string, required) — 测试的 ID
- `name` (string, required) — 测试名称
- `created_at_unix_secs` (integer, required) — 以 Unix 秒表示的测试创建时间
- `last_updated_at_unix_secs` (integer, required) — 测试的最后更新时间，以 Unix 秒数表示
- `type` (enum, required) — 测试或实体的类型。
  - Allowed values: `llm`, `tool`, `simulation`, `folder`
- `access_info` (ResourceAccessInfo, optional, nullable) — 测试的访问信息
- `entity_type` (enum, optional, default: test) — 实体类型（测试或文件夹）
  - Allowed values: `test`, `folder`
- `folder_parent_id` (string, optional, nullable) — 父文件夹的 ID
- `folder_path` (list of AgentTestFolderPathSegmentResponseModel, optional) — 从根目录到此实体的文件夹路径段
- `children_count` (integer, optional, nullable) — 仅适用于文件夹的直接子项数量（测试和子文件夹）
- `conversation_initiation_source` (enum, optional, nullable, default: unknown) — Channel the test simulates the conversation as. Null for folders or default behavior.
  - Allowed values: `unknown`, `android_sdk`, `node_js_sdk`, `react_native_sdk`, `react_sdk`, `js_sdk`, `python_sdk`, `widget`, `sip_trunk`, `twilio`, `exotel`, `genesys`, `avaya`, `audiocodes`, `swift_sdk`, `whatsapp`, `twilio_sms`, `flutter_sdk`, `zendesk_integration`, `slack_integration`, `telegram_integration`, `intercom_integration`, `freshdesk_integration`, `salesforce_integration`, `template_preview`, `genesys_bot_connector`, `subagent_tool`

### 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' = 调用者（或其所属的某个工作区群组）列于 role_to_group_ids 中，且不包括工作区范围的所有人群组。'workspace_default' = 工作区范围的所有人群组列于 role_to_group_ids 中（所有非匿名工作区成员，包括管理员，均可查看此资源）。'workspace_admin' = 调用者是工作区管理员，且管理员席位是 *唯一* 的访问路径；此项仅用于其他人均无法查看的文档。这样 UI 可说明管理员绕过权限的查看者为何能看到未明确向其共享的文档。
  - Allowed values: `creator`, `explicit`, `workspace_admin`, `workspace_default`

### AgentTestFolderPathSegmentResponseModel

- `id` (string, required)
- `name` (string, optional, default: )

### ValidationErrorLocItems

- string
- integer

## Examples

**Response**

```json
{
  "tests": [
    {
      "id": "string",
      "name": "string",
      "created_at_unix_secs": 1,
      "last_updated_at_unix_secs": 1,
      "type": "llm",
      "access_info": {
        "is_creator": true,
        "creator_name": "John Doe",
        "creator_email": "john.doe@example.com",
        "role": "admin",
        "access_source": "creator"
      },
      "entity_type": "test",
      "folder_parent_id": "string",
      "folder_path": [
        {
          "id": "string",
          "name": ""
        }
      ],
      "children_count": 1,
      "conversation_initiation_source": "unknown"
    }
  ],
  "has_more": true,
  "next_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/agent-testing"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/agent-testing';
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/agent-testing"

	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/agent-testing")

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/agent-testing")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/agent-testing');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/agent-testing");
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/agent-testing")! 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()
```