Deprecated endpoint - use GET /agent instead.
Lists all active agents that have a published production version for the specified account. locationId is required parameter. Supports pagination using limit and offset.
GET https://services.leadconnectorhq.com/agent-studio/public-api/agentsAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | C2QujeCh8ZnC7al2InWR | |
limit | string | Yes | 20 | |
offset | string | Yes | 0 | |
source | string | No | api |
Responses
200 - Agents retrieved successfully
success(boolean, required): Success status Example:Truemessage(string, required): Response message Example:Agents retrieved successfullyagents(object[], required): List of agents with metadataagentId(string): Agent IDname(string): Agent namedescription(string): Agent descriptionlocationId(string): Account IDstatus(string): Agent status (always "active")createdAt(string): Creation timestampupdatedAt(string): Last update timestamp
pagination(object, required): Pagination metadatatotal(number): Total number of agentslimit(number): Number of agents per pageoffset(number): Starting positionhasMore(boolean): Whether more agents exist
{
"success": true,
"message": "Agents retrieved successfully",
"agents": [
{
"agentId": "p1q2r3s4t5u6v7w8x9y0z1a2",
"name": "Marketing Assistant",
"description": "AI agent specialized in marketing strategy and content creation",
"locationId": "C2QujeCh8ZnC7al2InWR",
"status": "active",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-02-20T14:45:00.000Z"
},
{
"agentId": "b3c4d5e6f7g8h9i0j1k2l3m4",
"name": "Customer Support Bot",
"description": "AI agent for handling customer inquiries and support tickets",
"locationId": "C2QujeCh8ZnC7al2InWR",
"status": "active",
"createdAt": "2024-01-10T09:15:00.000Z",
"updatedAt": "2024-02-18T16:20:00.000Z"
}
],
"pagination": {
"total": 25,
"limit": 20,
"offset": 0,
"hasMore": true
}
}400 - Bad Request - locationId is required
{}422 - Unprocessable Entity
{}500 - Internal Server Error
statusCode(number): Example:500message(string): Example:Internal Server Error
{
"statusCode": 500,
"message": "Internal Server Error"
}Example
curl -X GET 'https://services.leadconnectorhq.com/agent-studio/public-api/agents' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'const response = await fetch('https://services.leadconnectorhq.com/agent-studio/public-api/agents', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'GET',
'https://services.leadconnectorhq.com/agent-studio/public-api/agents',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/agent-studio/public-api/agents');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);