Skip to main content
PUT
/
agents
/
update
/
{id}
Update a custom agent
curl --request PUT \
  --url https://api.pawa-ai.com/v1/agents/update/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "TutorAI",
  "description": "TutorAI is an AI agent designed to assist students with their studies.",
  "instruction": "Teaching students on subjects ranging from form 0ne to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to",
  "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": true,
  "message": "Agent updated 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"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
number
required

Body

application/json
name
string
required

The name of the agent

Example:

"TutorAI"

description
string
required

The description about the agent

Example:

"TutorAI is an AI agent designed to assist students with their studies."

instruction
string
required

What should the agent do

Example:

"Teaching students on subjects ranging from form 0ne to form 4. Follow questions properly and do not answer any other questions apart from what you have been tasked to"

intents
any[]
required

The list of intents, how the model should behave?

Example:
["Be gentle", "Be detailed"]
knowledgeBaseId
number

The knowledge base ID to be used by the agent

Example:

159

tools
(Custom Tools · object | Built-In Tools · object)[]

Tools to provide to the model (as a JSON string). Eg. Built-in tools includes web_search_tool

  • Custom Tools
  • Built-In Tools
Example:
[
{
"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"
}
]

Response

Agent updated successfully

success
boolean
required
Example:

true

message
string
required
Example:

"Agent updated successfully"

data
object
required
I