Skip to main content
GET
/
ai
/
assistants
/
tests
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const assistantTest of client.ai.assistants.tests.list()) {
  console.log(assistantTest.test_id);
}
{
  "meta": {
    "total_pages": 123,
    "total_results": 123,
    "page_number": 123,
    "page_size": 123
  },
  "data": [
    {
      "test_id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Customer Support Bot Test",
      "telnyx_conversation_channel": "web_chat",
      "rubric": [
        {
          "criteria": "Responds within 30 seconds",
          "name": "Response Time"
        }
      ],
      "created_at": "2024-01-15T09:00:00Z",
      "description": "<string>",
      "destination": "<string>",
      "max_duration_seconds": 123,
      "test_suite": "<string>",
      "instructions": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

test_suite
string

Filter tests by test suite name

telnyx_conversation_channel
string

Filter tests by communication channel (e.g., 'web_chat', 'sms')

destination
string

Filter tests by destination (phone number, webhook URL, etc.)

page[number]
integer
page[size]
integer

Response

Returns paginated test list with metadata for navigation and filtering

Paginated list of assistant tests with metadata.

Returns a subset of tests based on pagination parameters along with metadata for implementing pagination controls in the UI.

meta
Meta · object
required

Pagination metadata including total counts and current page info.

data
AssistantTestResponse · object[]
required

Array of assistant test objects for the current page.