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"
}
Response
- Returns the newly created Agent.
Status Codes
200 OK
: Agent created successfully.500 Internal Server Error
: Error creating the Agent.
Throws
- An error if request validation or Agent creation fails.
Example cURL
curl --location 'https://app.ai12z.net/api/Agents' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Agent Name",
"orgName": "Organization Name",
"orgUrl": "https://organization-url.com",
"purpose": "Purpose of the Agent"
}'
PUT: Update a Agent
Description
This route is used to update an existing Agent.
Method
PUT
Request Body
Example request body:
{
"id": "Agent ID",
"name": "Updated Agent Name",
"orgName": "Updated Organization Name",
"orgUrl": "https://updated-organization-url.com",
"purpose": "Updated Purpose of the Agent"
}
Response
- Returns the updated Agent.
Status Codes
200 OK
: Agent updated successfully.500 Internal Server Error
: Error updating the Agent.
Throws
- An error if request validation or Agent update fails.
Example cURL
curl --location --request PUT 'https://app.ai12z.net/api/Agents' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "Agent ID",
"name": "Updated Agent Name",
"orgName": "Updated Organization Name",
"orgUrl": "https://updated-organization-url.com",
"purpose": "Updated Purpose of the Agent"
}'
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/Agents' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "Agent ID"
}'