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."
         }'
{
    "message": "Agent updated successfully"
}

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

agent_id
string
required

The unique identifier of the agent to be updated.

Request Body Parameters

env_id
string
required

The updated ID of the environment associated with the agent.

system_prompt
string
required

The updated system prompt or instruction for the agent.

name
string
required

The updated name of the agent.

agent_description
string
required

The updated description of the agent’s purpose and functionality.

Curl
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."
         }'
Python
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

message
dict

Confirmation that the agent was updated successfully.