Agents API Documentation
GET: Retrieve Agents
Description
This route is used to retrieve a list of agents for a specific project 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 agents retrieval fails.
Example cURL
curl --location 'https://app.ai12z.net/api/projects/{projectId}/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 agents 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
,key
,value
andnataResponse
.
Status Codes
200 OK
: Agents retrieved successfully.500 Internal Server Error
:Error retrieving the agents.
Throws
- An error if the agents is not found or any other error occurs.
Example cURL
curl --location 'https://app.ai12z.net/api/projects/{projectId}/agents' \
--header 'Authorization: Bearer <YOUR_KEY>'
DELETE: Delete a Agent
Description
This route is used to delete an existing agent.
Method
DELETE
Request Body
Example request body:
{
"id": "Agent ID"
}
Response
- Returns a confirmation message indicating successful deletion.
Status Codes
200 OK
: Agent deleted successfully.500 Internal Server Error
: Error deleting the Agent.
Throws
- An error if request validation or agent deletion fails.
Example cURL
curl --location --request DELETE 'https://app.ai12z.net/api/projects/{projectId}/agents' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "Agent ID"
}'