Agent Management API Documentation
GET: Retrieve Agents
Description
This route is used to retrieve a list of Agents with pagination and optional search capabilities.
Method
GET
Query Parameters
sort(string): The field by which to sort the Agents.page(number): The page number of the results.limit(number): The number of items per page.searchTerm(string): Optional search term to filter Agents.
Response
- Returns a JSON response with the list of Agents or an error message.
Status Codes
200 OK: Agents retrieved successfully.500 Internal Server Error: Error listing Agents.
Throws
- An error if request validation or Agent retrieval fails.
Example cURL
curl --location 'https://app.ai12z.net/api/Agents' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--data-urlencode 'sort=name' \
--data-urlencode 'page=1' \
--data-urlencode 'limit=10'
GET: Retrieve Agent by ID
Description
This route is used to retrieve details of a specific Agent by its ID.
Method
GET
URL Parameters
id(string): The ID of the Agent to retrieve.
Response
- Returns a JSON response with Agent details such as
id,name,image, andcmsConnectors.
Status Codes
200 OK: Agent retrieved successfully.500 Internal Server Error: Error retrieving the Agent.
Throws
- An error if the Agent is not found or any other error occurs.
Example cURL
curl --location 'https://app.ai12z.net/api/Agents/{id}' \
--header 'Authorization: Bearer <YOUR_KEY>'
POST: Create a Agent
Description
This route is used to create a new Agent.
Method
POST
Request Body
Example request body:
{
"name": "Agent Name",
"orgName": "Organization Name",
"orgUrl": "https://organization-url.com",
"purpose": "Purpose of the Agent"
}