> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nugen.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Agent Endpoint

> Update agent configuration settings.


This endpoint allows partial updates to an agent's configuration. You can update any combination of settings including name, description, model, temperature, instructions, and demonstrations. Only the fields provided in the request body will be updated.


**Path Parameters:**

- `agent_id`: Unique identifier of the agent to update


**Request Body:**

The request accepts a partial update with any of the following optional fields:

- `agent_name`: New name for the agent
- `agent_description`: Updated description of the agent's purpose
- `model`: Base model to use (must be from available models list)
- `temperature`: Sampling temperature (0.0 to 2.0)
- `max_tokens`: Maximum tokens in response
- `instructions`: System instructions for the agent
- `demonstrations`: Example conversations for few-shot learning


**Returns:**

- `data`: Updated agent object with all current configuration


**Raises:**

- `404`: If agent not found or doesn't belong to user
- `400`: If invalid model specified or validation fails


**Example Request:**

```json
PATCH /api/v3/agents/agent-123
Headers: {"Authorization": "Bearer <api_key>"}
Body: {
  "agent_name": "updated_support_bot",
  "agent_description": "Enhanced customer support assistant",
  "temperature": 0.7,
  "instructions": "You are a helpful customer support agent. Always be polite and professional."
}
```


**Example Response:**

```json
{
  "data": {
    "id": "agent-123",
    "name": "updated_support_bot",
    "description": "Enhanced customer support assistant",
    "base_model": "nugen-flash-instruct",
    "base_model_name": "Nugen Flash Instruct",
    "created_date": "2024-01-15T10:30:00Z",
    "status": "ACTIVE",
    "creator": "user@example.com",
    "endpoint": "https://api.nugen.in/api/v3/agents/run-agents/updated_support_bot/run",
    "usage_count": 42,
    "last_used": "2024-01-20T15:45:00Z",
    "performance_metrics": {
      "average_uncertainty": 0.0,
      "human_interventions": 0,
      "average_response_time": 0.0,
      "user_satisfaction_score": 0.0
    },
    "system_prompt": "You are a helpful customer support agent. Always be polite and professional.",
    "temperature": 0.7,
    "conversation_saving_enabled": false
  }
}
```


**Notes:**

- This is a partial update - only provide fields you want to change
- Model must be from the list of available base models or deployed aligned models
- Temperature must be between 0.0 and 2.0



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json patch /api/v3/agents/{agent_id}
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: 'Nugen Intelligence : Powering Specialized Intelligence At Scale'
  version: 25.4.20
servers: []
security: []
paths:
  /api/v3/agents/{agent_id}:
    patch:
      tags:
        - Agents
      summary: Update Agent Endpoint
      description: >-
        Update agent configuration settings.



        This endpoint allows partial updates to an agent's configuration. You
        can update any combination of settings including name, description,
        model, temperature, instructions, and demonstrations. Only the fields
        provided in the request body will be updated.



        **Path Parameters:**


        - `agent_id`: Unique identifier of the agent to update



        **Request Body:**


        The request accepts a partial update with any of the following optional
        fields:


        - `agent_name`: New name for the agent

        - `agent_description`: Updated description of the agent's purpose

        - `model`: Base model to use (must be from available models list)

        - `temperature`: Sampling temperature (0.0 to 2.0)

        - `max_tokens`: Maximum tokens in response

        - `instructions`: System instructions for the agent

        - `demonstrations`: Example conversations for few-shot learning



        **Returns:**


        - `data`: Updated agent object with all current configuration



        **Raises:**


        - `404`: If agent not found or doesn't belong to user

        - `400`: If invalid model specified or validation fails



        **Example Request:**


        ```json

        PATCH /api/v3/agents/agent-123

        Headers: {"Authorization": "Bearer <api_key>"}

        Body: {
          "agent_name": "updated_support_bot",
          "agent_description": "Enhanced customer support assistant",
          "temperature": 0.7,
          "instructions": "You are a helpful customer support agent. Always be polite and professional."
        }

        ```



        **Example Response:**


        ```json

        {
          "data": {
            "id": "agent-123",
            "name": "updated_support_bot",
            "description": "Enhanced customer support assistant",
            "base_model": "nugen-flash-instruct",
            "base_model_name": "Nugen Flash Instruct",
            "created_date": "2024-01-15T10:30:00Z",
            "status": "ACTIVE",
            "creator": "user@example.com",
            "endpoint": "https://api.nugen.in/api/v3/agents/run-agents/updated_support_bot/run",
            "usage_count": 42,
            "last_used": "2024-01-20T15:45:00Z",
            "performance_metrics": {
              "average_uncertainty": 0.0,
              "human_interventions": 0,
              "average_response_time": 0.0,
              "user_satisfaction_score": 0.0
            },
            "system_prompt": "You are a helpful customer support agent. Always be polite and professional.",
            "temperature": 0.7,
            "conversation_saving_enabled": false
          }
        }

        ```



        **Notes:**


        - This is a partial update - only provide fields you want to change

        - Model must be from the list of available base models or deployed
        aligned models

        - Temperature must be between 0.0 and 2.0
      operationId: update_agent
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRequest'
      responses:
        '200':
          description: >-
            Returns the updated details of the agent after applying the
            requested configuration changes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentUpdateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateAgentRequest:
      properties:
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
          description: Name of the agent
          example: Customer Support Agent
        agent_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Description
          description: Description of the agent
          example: An agent designed to handle customer support queries
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Base model identifier
          example: nugen-flash-instruct
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tokens
          description: Maximum number of tokens to generate in the response
          example: 1000
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
          description: Temperature for model responses (0.0-2.0)
          example: 0.7
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: System prompt for the agent
          example: You are a helpful customer support assistant.
        demonstrations:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          title: Demonstrations
          description: Training demonstrations
      type: object
      title: UpdateAgentRequest
    AgentUpdateResponse:
      properties:
        data:
          $ref: '#/components/schemas/AgentData'
      type: object
      required:
        - data
      title: AgentUpdateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentData:
      properties:
        id:
          type: string
          title: Id
          description: Unique agent identifier
          example: agent-12345
        name:
          type: string
          title: Name
          description: Agent name
          example: Customer Support Agent
        description:
          type: string
          title: Description
          description: Agent description
          example: An agent designed to handle customer support queries
        base_model:
          type: string
          title: Base Model
          description: Base model identifier
          example: nugen-flash-instruct
        base_model_name:
          type: string
          title: Base Model Name
          description: Base model display name
          example: Nugen Flash Instruct
        created_date:
          type: string
          title: Created Date
          description: Agent creation date
          example: '2024-01-15T10:30:00Z'
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: Agent status
          example: ACTIVE
        creator:
          type: string
          title: Creator
          description: Agent creator username
          example: youremail@domain.com
        endpoint:
          type: string
          title: Endpoint
          description: Agent API endpoint
          example: https://api.nugen.in/api/v3/inference/completions/agent-12345
        usage_count:
          type: integer
          title: Usage Count
          description: Number of times agent has been used
          example: 150
        last_used:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Used
          description: Last usage timestamp
          example: '2024-01-20T14:30:00Z'
        performance_metrics:
          $ref: '#/components/schemas/AgentPerformanceMetrics'
          description: Agent performance metrics
        system_prompt:
          type: string
          title: System Prompt
          description: System prompt for the agent
          example: You are a helpful customer support assistant.
        temperature:
          type: number
          title: Temperature
          description: Temperature for model responses (0.0-2.0)
          example: 0.7
        conversation_saving_enabled:
          type: boolean
          title: Conversation Saving Enabled
          description: Whether conversation saving is enabled for this agent
          default: false
          example: true
      type: object
      required:
        - id
        - name
        - description
        - base_model
        - base_model_name
        - created_date
        - status
        - creator
        - endpoint
        - usage_count
        - performance_metrics
        - system_prompt
        - temperature
      title: AgentInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
      title: AgentStatus
    AgentPerformanceMetrics:
      properties:
        average_uncertainty:
          type: number
          title: Average Uncertainty
          description: Average uncertainty across all agent responses
          example: 0.15
        human_interventions:
          type: integer
          title: Human Interventions
          description: Number of times human intervention was required
          example: 5
        average_response_time:
          type: number
          title: Average Response Time
          description: Average response time in seconds
          example: 1.2
        user_satisfaction_score:
          type: number
          title: User Satisfaction Score
          description: Average user satisfaction score from 0.0 to 1.0
          example: 0.85
      type: object
      required:
        - average_uncertainty
        - human_interventions
        - average_response_time
        - user_satisfaction_score
      title: AgentPerformanceMetrics
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````