Retrieve all custom agents
curl --request GET \
--url https://api.pawa-ai.com/v1/agents/view \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pawa-ai.com/v1/agents/view"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pawa-ai.com/v1/agents/view', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pawa-ai.com/v1/agents/view",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pawa-ai.com/v1/agents/view"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pawa-ai.com/v1/agents/view")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pawa-ai.com/v1/agents/view")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Agents retrieved successfully",
"data": [
{
"id": 0,
"agentReferenceId": "67cf5354-89f0-8001-b038-b2645377b214",
"name": "TutorAI",
"description": "TutorAI is an AI agent designed to assist students with their studies.",
"instruction": "Teaching students on subjects ranging from form one to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to",
"status": "ACTIVE",
"createdAt": "2021-09-01T00:00:00.000Z",
"updatedAt": "2021-09-01T00:00:00.000Z",
"intents": [
"Be gentle",
"Be detailed"
],
"knowledgeBaseId": 159,
"tools": [
{
"type": "function",
"function": {
"name": "convert_usd_to_tsh",
"description": "Converts an amount in USD to Tanzanian Shillings.",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"amount_usd": {
"description": "Amount in USD",
"type": "number"
}
},
"required": [
"amount_usd"
],
"additionalProperties": false
}
}
},
{
"type": "pawa_tool",
"pawa_tool": "web_search_tool"
}
]
}
]
}{
"success": false,
"message": "Invalid input provided"
}{
"success": false,
"message": "Unauthorized access"
}{
"success": false,
"message": "You do not have permission to access this resource"
}{
"success": false,
"message": "Resource does not exist"
}{
"success": false,
"message": "Rate limit exceeded. Please try again later."
}{
"success": false,
"message": "Internal server error"
}Agents
Get All Agents
This endpoint used to retrieve all custom agents created in the Pawa AI Platform.
GET
/
agents
/
view
Retrieve all custom agents
curl --request GET \
--url https://api.pawa-ai.com/v1/agents/view \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pawa-ai.com/v1/agents/view"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pawa-ai.com/v1/agents/view', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pawa-ai.com/v1/agents/view",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pawa-ai.com/v1/agents/view"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pawa-ai.com/v1/agents/view")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pawa-ai.com/v1/agents/view")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Agents retrieved successfully",
"data": [
{
"id": 0,
"agentReferenceId": "67cf5354-89f0-8001-b038-b2645377b214",
"name": "TutorAI",
"description": "TutorAI is an AI agent designed to assist students with their studies.",
"instruction": "Teaching students on subjects ranging from form one to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to",
"status": "ACTIVE",
"createdAt": "2021-09-01T00:00:00.000Z",
"updatedAt": "2021-09-01T00:00:00.000Z",
"intents": [
"Be gentle",
"Be detailed"
],
"knowledgeBaseId": 159,
"tools": [
{
"type": "function",
"function": {
"name": "convert_usd_to_tsh",
"description": "Converts an amount in USD to Tanzanian Shillings.",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"amount_usd": {
"description": "Amount in USD",
"type": "number"
}
},
"required": [
"amount_usd"
],
"additionalProperties": false
}
}
},
{
"type": "pawa_tool",
"pawa_tool": "web_search_tool"
}
]
}
]
}{
"success": false,
"message": "Invalid input provided"
}{
"success": false,
"message": "Unauthorized access"
}{
"success": false,
"message": "You do not have permission to access this resource"
}{
"success": false,
"message": "Resource does not exist"
}{
"success": false,
"message": "Rate limit exceeded. Please try again later."
}{
"success": false,
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
⌘I