Endpoint: PUT /v2/agent/{agent_id}
This endpoint updates the configuration of an existing agent specified by its unique agent ID. This request allows modifications to the agent’s settings and details.
Parameters
The unique identifier of the agent to be updated.
Request Body Parameters
The updated ID of the environment associated with the agent.
The updated system prompt or instruction for the agent.
The updated name of the agent.
The updated description of the agent’s purpose and functionality.
curl -X PUT "https://agent.api.lyzr.app/v2/agent/{agent_id}" \
-H "accept: application/json"\
-H "Content-Type: application/json" \
-H "x-api-key: your_Lyzr_API_Key_Here" \
-d '{
"env_id": "66e1820aa64xxxxxx",
"system_prompt": "Hello, I am your updated virtual assistant.",
"name": "Updated Virtual Assistant",
"agent_description": "An updated assistant for handling queries and tasks."
}'
import requests
agent_id = "60d0fe4f531xxxxx" # Replace with the actual agent ID
agent_config = {
"env_id": "66e1820aa6xxxxxx",
"system_prompt": "Hello, I am your updated virtual assistant.",
"name": "Updated Virtual Assistant",
"agent_description": "An updated assistant for handling queries and tasks."
}
url = f"https://agent.api.lyzr.app/v2/agent/{agent_id}"
headers = {
"Content-Type": "application/json",
"x-api-key": "your_Lyzr_API_Key_Here"
}
response = requests.put(url, headers=headers, json=agent_config)
{
"message": "Agent updated successfully"
}
Response Parameters
Confirmation that the agent was updated successfully.