Skip to main content
GET
/
api
/
v1
/
channels
/
targets
Typescript (SDK)
import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.channels.targets.list({
    page: 0,
    searchFields: [
      "agent_id",
    ],
    searchFieldValues: [
      "Some Object Name",
    ],
    startDatetime: "2023-01-01T00:00:00Z",
    endDatetime: "2024-01-01T00:00:00Z",
  });

  console.log(result);
}

run();
{
  "items": [
    {
      "agent_id": 123,
      "channel_id": 123,
      "target": "<string>",
      "target_mode": "voice",
      "id": 123,
      "channel_name": "<string>",
      "updated_at": "2023-11-07T05:31:56Z",
      "last_updated_by": "<string>",
      "fallback_target": "+19995551235",
      "is_test": false,
      "agent": {
        "name": "<string>",
        "type": "<string>",
        "prompt_id": 123,
        "custom_message_id": 123,
        "timezone": "<string>",
        "variables": {},
        "tool_headers": {
          "some-header": "some-value"
        },
        "id": 123,
        "updated_at": "2023-11-07T05:31:56Z",
        "last_updated_by": "[email protected]",
        "description": "Agent for answering questions about weather.",
        "label": "Information",
        "labels": [
          "Information",
          "Weather"
        ],
        "language_group_id": 1,
        "prompt_tool_defaults": [
          {
            "tool_name": "<string>",
            "default_values": [
              {
                "field_name": "<string>",
                "default_value": "<unknown>"
              }
            ]
          }
        ],
        "languages": [
          "<string>"
        ],
        "agent_initiated": false,
        "stt_provider": "Google STT V2 (Chirp 2)",
        "wait_sound": "No Sound",
        "prompt": {
          "name": "<string>",
          "type": "<string>",
          "llm_config": {
            "provider": "azure_openai",
            "model": "gpt-4o",
            "version": "2024-05-13",
            "api_version": "2024-06-01",
            "temperature": 1,
            "seed": 123
          },
          "id": 123,
          "last_updated": "2024-01-01T12:00:00Z",
          "description": "Prompt for a weather agent.",
          "context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
          "tools": [],
          "session_end_enabled": false,
          "session_end_tool_id": 1,
          "edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
          "last_updated_by": "[email protected]",
          "session_end_tool": {
            "name": "<string>",
            "definition": {
              "tool": {
                "function": {
                  "name": "<string>",
                  "description": "<string>",
                  "parameters": "<unknown>"
                },
                "type": "function"
              },
              "type": "endpoint",
              "endpoint": {
                "url": "<string>",
                "method": "get",
                "argument_location": "body"
              },
              "context": {
                "task": {
                  "id": "<string>",
                  "config": {},
                  "variables": [
                    {
                      "name": "<string>",
                      "value": "<unknown>",
                      "value_from": {
                        "expression": "<string>",
                        "type": "cel"
                      },
                      "type": "string",
                      "description": "<string>",
                      "title": "<string>",
                      "format": "<string>",
                      "pattern": "<string>",
                      "enum": [
                        "<string>"
                      ],
                      "examples": [
                        "<unknown>"
                      ]
                    }
                  ],
                  "metadata": {
                    "priority": 123,
                    "parent_tool_name": "<string>"
                  },
                  "tool": {
                    "name": "<string>",
                    "description": "<string>"
                  },
                  "type": "expression",
                  "version": "v1alpha",
                  "inputs": [
                    {
                      "name": "<string>",
                      "type": "string",
                      "description": "<string>",
                      "title": "<string>",
                      "format": "<string>",
                      "pattern": "<string>",
                      "enum": [
                        "<string>"
                      ],
                      "examples": [
                        "<unknown>"
                      ],
                      "required": true
                    }
                  ],
                  "expression": {
                    "expression": "<string>",
                    "type": "cel"
                  },
                  "output": "<unknown>",
                  "on": {
                    "start": [
                      {
                        "name": "<string>",
                        "value": "<unknown>",
                        "value_from": "<unknown>",
                        "if": "<unknown>",
                        "action": "set"
                      }
                    ],
                    "submit": [
                      {
                        "name": "<string>",
                        "value": "<unknown>",
                        "value_from": "<unknown>",
                        "if": "<unknown>",
                        "action": "set"
                      }
                    ]
                  }
                }
              },
              "defaults": "<unknown>",
              "static_parameters": [
                {
                  "default": "fahrenheit",
                  "description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
                  "name": "temperature_unit",
                  "required": false,
                  "type": "string"
                }
              ],
              "result": "<unknown>",
              "options": {
                "propagate_tool_result": false
              }
            },
            "service_id": 123,
            "id": 123,
            "last_updated": "2023-11-07T05:31:56Z",
            "last_updated_by": "<string>",
            "last_updated_comments": "Updated to use new API endpoint",
            "service_name": "<string>",
            "prompts_info": [
              {
                "id": 123,
                "name": "<string>"
              }
            ],
            "agents_info": [
              {
                "id": 123,
                "name": "<string>"
              }
            ]
          },
          "agent_count": 5,
          "version_number": 1,
          "tools_full": [
            {
              "name": "<string>",
              "definition": {
                "tool": {
                  "function": {
                    "name": "<string>",
                    "description": "<string>",
                    "parameters": "<unknown>"
                  },
                  "type": "function"
                },
                "type": "endpoint",
                "endpoint": {
                  "url": "<string>",
                  "method": "get",
                  "argument_location": "body"
                },
                "context": {
                  "task": {
                    "id": "<string>",
                    "config": {},
                    "variables": [
                      {
                        "name": "<string>",
                        "value": "<unknown>",
                        "value_from": {
                          "expression": "<string>",
                          "type": "cel"
                        },
                        "type": "string",
                        "description": "<string>",
                        "title": "<string>",
                        "format": "<string>",
                        "pattern": "<string>",
                        "enum": [
                          "<string>"
                        ],
                        "examples": [
                          "<unknown>"
                        ]
                      }
                    ],
                    "metadata": {
                      "priority": 123,
                      "parent_tool_name": "<string>"
                    },
                    "tool": {
                      "name": "<string>",
                      "description": "<string>"
                    },
                    "type": "expression",
                    "version": "v1alpha",
                    "inputs": [
                      {
                        "name": "<string>",
                        "type": "string",
                        "description": "<string>",
                        "title": "<string>",
                        "format": "<string>",
                        "pattern": "<string>",
                        "enum": [
                          "<string>"
                        ],
                        "examples": [
                          "<unknown>"
                        ],
                        "required": true
                      }
                    ],
                    "expression": {
                      "expression": "<string>",
                      "type": "cel"
                    },
                    "output": "<unknown>",
                    "on": {
                      "start": [
                        {
                          "name": "<string>",
                          "value": "<unknown>",
                          "value_from": "<unknown>",
                          "if": "<unknown>",
                          "action": "set"
                        }
                      ],
                      "submit": [
                        {
                          "name": "<string>",
                          "value": "<unknown>",
                          "value_from": "<unknown>",
                          "if": "<unknown>",
                          "action": "set"
                        }
                      ]
                    }
                  }
                },
                "defaults": "<unknown>",
                "static_parameters": [
                  {
                    "default": "fahrenheit",
                    "description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
                    "name": "temperature_unit",
                    "required": false,
                    "type": "string"
                  }
                ],
                "result": "<unknown>",
                "options": {
                  "propagate_tool_result": false
                }
              },
              "service_id": 123,
              "id": 123,
              "last_updated": "2023-11-07T05:31:56Z",
              "last_updated_by": "<string>",
              "last_updated_comments": "Updated to use new API endpoint",
              "service_name": "<string>",
              "prompts_info": [
                {
                  "id": 123,
                  "name": "<string>"
                }
              ],
              "agents_info": [
                {
                  "id": 123,
                  "name": "<string>"
                }
              ]
            }
          ]
        },
        "custom_message": {
          "name": "<string>",
          "text": "<string>",
          "id": 123,
          "updated_at": "2023-11-07T05:31:56Z",
          "last_updated_by": "<string>",
          "preamble": "If this is an emergency, please hang up and call 911.",
          "label": "Customer service",
          "rules": [],
          "agent_count": 1,
          "type": "greeting"
        },
        "channel_targets": [
          "<unknown>"
        ],
        "tools": [
          {
            "name": "<string>",
            "definition": {
              "tool": {
                "function": {
                  "name": "<string>",
                  "description": "<string>",
                  "parameters": "<unknown>"
                },
                "type": "function"
              },
              "type": "endpoint",
              "endpoint": {
                "url": "<string>",
                "method": "get",
                "argument_location": "body"
              },
              "context": {
                "task": {
                  "id": "<string>",
                  "config": {},
                  "variables": [
                    {
                      "name": "<string>",
                      "value": "<unknown>",
                      "value_from": {
                        "expression": "<string>",
                        "type": "cel"
                      },
                      "type": "string",
                      "description": "<string>",
                      "title": "<string>",
                      "format": "<string>",
                      "pattern": "<string>",
                      "enum": [
                        "<string>"
                      ],
                      "examples": [
                        "<unknown>"
                      ]
                    }
                  ],
                  "metadata": {
                    "priority": 123,
                    "parent_tool_name": "<string>"
                  },
                  "tool": {
                    "name": "<string>",
                    "description": "<string>"
                  },
                  "type": "expression",
                  "version": "v1alpha",
                  "inputs": [
                    {
                      "name": "<string>",
                      "type": "string",
                      "description": "<string>",
                      "title": "<string>",
                      "format": "<string>",
                      "pattern": "<string>",
                      "enum": [
                        "<string>"
                      ],
                      "examples": [
                        "<unknown>"
                      ],
                      "required": true
                    }
                  ],
                  "expression": {
                    "expression": "<string>",
                    "type": "cel"
                  },
                  "output": "<unknown>",
                  "on": {
                    "start": [
                      {
                        "name": "<string>",
                        "value": "<unknown>",
                        "value_from": {
                          "expression": "<string>",
                          "type": "cel"
                        },
                        "if": {
                          "expression": "<string>",
                          "type": "cel"
                        },
                        "action": "set"
                      }
                    ],
                    "submit": [
                      {
                        "name": "<string>",
                        "value": "<unknown>",
                        "value_from": {
                          "expression": "<string>",
                          "type": "cel"
                        },
                        "if": {
                          "expression": "<string>",
                          "type": "cel"
                        },
                        "action": "set"
                      }
                    ]
                  }
                }
              },
              "defaults": "<unknown>",
              "static_parameters": [
                {
                  "default": "fahrenheit",
                  "description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
                  "name": "temperature_unit",
                  "required": false,
                  "type": "string"
                }
              ],
              "result": "<unknown>",
              "options": {
                "propagate_tool_result": false
              }
            },
            "service_id": 123,
            "id": 123,
            "last_updated": "2023-11-07T05:31:56Z",
            "last_updated_by": "<string>",
            "last_updated_comments": "Updated to use new API endpoint",
            "service_name": "<string>",
            "prompts_info": [
              {
                "id": 123,
                "name": "<string>"
              }
            ],
            "agents_info": [
              {
                "id": 123,
                "name": "<string>"
              }
            ]
          }
        ],
        "language_group": {
          "name": "<string>",
          "language_configs": [
            {
              "language_code": "yue-HK",
              "voice_provider": "OpenAI",
              "voice_display_name": "Achernar (English)",
              "dtmf_code": 123,
              "voice_speed": 1,
              "voice_pitch": 0
            }
          ],
          "skip_current_language_in_message": true,
          "id": 123,
          "updated_at": "2023-11-07T05:31:56Z",
          "last_updated_by": "<string>",
          "description": "Languages spoken by operators at Call Center 1",
          "edit_comments": "Added Spanish support.",
          "agents_info": [
            {
              "id": 1,
              "name": "Test Agent"
            }
          ]
        }
      }
    }
  ],
  "page": 123,
  "page_size": 123,
  "total_pages": 4,
  "total_count": 100
}

Authorizations

Syllable-API-Key
string
header
required

Query Parameters

page
integer | null
default:0

The page number from which to start (0-based)

Required range: x >= 0
Example:

0

limit
integer
default:25

The maximum number of items to return

Required range: x >= 0
Example:

25

search_fields
enum<string>[]

String names of fields to search. Correspond by index to search field values

Names of channel target fields supported for filtering/sorting on full channel targets list endpoint.

Available options:
id,
channel_id,
channel_name,
agent_id,
target,
target_mode,
fallback_target,
is_test,
updated_at
Example:

"name"

search_field_values
string[]

Values of fields to search. Correspond by index to search fields. Unless field name contains "list", an individual search field value cannot be a list

Example:

"Some Object Name"

order_by
enum<string> | null

The field whose value should be used to order the results Names of channel target fields supported for filtering/sorting on full channel targets list endpoint.

Available options:
id,
channel_id,
channel_name,
agent_id,
target,
target_mode,
fallback_target,
is_test,
updated_at
Example:

"name"

order_by_direction
enum<string> | null

The direction in which to order the results The direction in which to order list results, either ascending or descending.

Available options:
asc,
desc
fields
enum<string>[] | null

The fields to include in the response

Names of channel target fields supported for filtering/sorting on full channel targets list endpoint.

Available options:
id,
channel_id,
channel_name,
agent_id,
target,
target_mode,
fallback_target,
is_test,
updated_at
start_datetime
string | null

The start datetime for filtering results

Example:

"2023-01-01T00:00:00Z"

end_datetime
string | null

The end datetime for filtering results

Example:

"2024-01-01T00:00:00Z"

Response

Successful Response

items
ChannelTargetResponse · object[]
required

List of items returned from the query

page
integer
required

The page number of the results (0-based)

Example:

0

page_size
integer
required

The number of items returned per page

Example:

25

total_pages
integer | null

The total number of pages of results given the indicated page size

Example:

4

total_count
integer | null

The total number of items returned from the query

Example:

100