# Update Agent

PUT https://services.leadconnectorhq.com/conversation-ai/agents/{agentId}

Updates an existing AI agent's configuration. All fields in the agent configuration can be updated including name, status, actions, and behavior settings.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `conversation-ai.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `agentId` | string | Yes | Conversations AI agent id |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/conversation-ai/agents/{agentId}": {
      "put": {
        "summary": "Update Agent",
        "operationId": "updateAgent",
        "description": "Updates an existing AI agent's configuration. All fields in the agent configuration can be updated including name, status, actions, and behavior settings.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "Conversations AI agent id",
            "schema": {
              "example": "ve9EPM428h8vShlRW1KT",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmployeeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "conversation-ai.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "UpdateEmployeeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "John Doe",
            "description": "Name of the agent."
          },
          "businessName": {
            "type": "string",
            "example": "Tech Corp",
            "description": "Name of the business the agent represents."
          },
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "suggestive",
              "auto-pilot"
            ],
            "example": "auto-pilot",
            "description": "Mode of operation for the agent, required if primary is enabled."
          },
          "channels": {
            "type": "array",
            "example": [
              "SMS",
              "Live_Chat"
            ],
            "description": "Channels the agent can use.",
            "items": {
              "type": "string",
              "enum": [
                "IG",
                "FB",
                "SMS",
                "WebChat",
                "WhatsApp",
                "Live_Chat",
                "Email"
              ]
            }
          },
          "isPrimary": {
            "type": "boolean",
            "example": true,
            "description": "Indicates if this agent is a primary agent."
          },
          "waitTime": {
            "type": "number",
            "example": 30,
            "description": "Wait time before agent responds (max 5 for minutes, 300 for seconds)."
          },
          "waitTimeUnit": {
            "type": "string",
            "enum": [
              "minutes",
              "seconds"
            ],
            "example": "seconds",
            "description": "Unit for wait time - SECONDS or MINUTES"
          },
          "sleepEnabled": {
            "type": "boolean",
            "example": false,
            "description": "Indicates if sleep functionality is enabled.",
            "deprecated": true
          },
          "sleepOnManualMessage": {
            "type": "boolean",
            "example": false,
            "description": "Enable sleep when a manual outbound message is sent."
          },
          "sleepOnWorkflowMessage": {
            "type": "boolean",
            "example": false,
            "description": "Enable sleep when a workflow outbound message is sent."
          },
          "sleepTime": {
            "type": "number",
            "example": 10,
            "description": "Duration of sleep period (required if sleepEnabled is true). Set to null for indefinite sleep. (max 2880 for minutes, 172800 for seconds, 48 for hours)"
          },
          "sleepTimeUnit": {
            "type": "string",
            "enum": [
              "hours",
              "minutes",
              "seconds"
            ],
            "example": "hours",
            "description": "Unit of sleep time - HOURS, MINUTES, or SECONDS (required if sleepEnabled is true). Set to null for indefinite sleep."
          },
          "personality": {
            "type": "string",
            "example": "You re an AI assistant and you are friendly and helpful",
            "description": "Personality traits of the agent."
          },
          "goal": {
            "type": "string",
            "example": "You are an AI assistant and you are helping customers with inquiries.",
            "description": "The goal of the agent."
          },
          "instructions": {
            "type": "string",
            "example": "Provide excellent customer service.",
            "description": "Instructions for the agent."
          },
          "fullPrompt": {
            "type": "string",
            "description": "Complete agent prompt. When set and non-empty, used as the source of truth at generation time instead of personality, goal, and instructions."
          },
          "autoPilotMaxMessages": {
            "type": "number",
            "default": 75,
            "example": 75,
            "description": "Maximum number of messages in auto-pilot mode before requiring human intervention. (max: 100, min: 1)"
          },
          "knowledgeBaseIds": {
            "description": "Array of knowledge base IDs associated with this agent.",
            "example": [
              "kb_abc123",
              "kb_def456"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "respondToImages": {
            "type": "boolean",
            "example": true,
            "default": false,
            "description": "Allow agent to respond to images"
          },
          "respondToAudio": {
            "type": "boolean",
            "example": true,
            "default": false,
            "description": "Allow agent to respond to audio"
          }
        },
        "required": [
          "autoPilotMaxMessages"
        ],
        "title": "UpdateEmployeeDto"
      },
      "EmployeeResponseDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "emp_123",
            "description": "Unique identifier for the agent."
          },
          "name": {
            "type": "string",
            "example": "John Doe",
            "description": "Name of the agent."
          },
          "businessName": {
            "type": "string",
            "example": "Tech Corp",
            "description": "Name of the business the agent represents."
          },
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "suggestive",
              "auto-pilot"
            ],
            "example": "auto-pilot",
            "description": "Current operating mode of the agent."
          },
          "channels": {
            "type": "array",
            "example": [
              "SMS",
              "Live_Chat"
            ],
            "description": "Communication channels the agent operates on.",
            "items": {
              "type": "string",
              "enum": [
                "IG",
                "FB",
                "SMS",
                "WebChat",
                "WhatsApp",
                "Live_Chat",
                "Email"
              ]
            }
          },
          "waitTime": {
            "type": "number",
            "example": 30,
            "description": "Wait time before agent responds."
          },
          "waitTimeUnit": {
            "type": "string",
            "enum": [
              "minutes",
              "seconds"
            ],
            "example": "seconds",
            "description": "Unit for wait time."
          },
          "sleepEnabled": {
            "type": "boolean",
            "example": false,
            "description": "Indicates if sleep functionality is enabled.",
            "deprecated": true
          },
          "sleepOnManualMessage": {
            "type": "boolean",
            "example": false,
            "description": "Whether the bot sleeps on manual outbound messages."
          },
          "sleepOnWorkflowMessage": {
            "type": "boolean",
            "example": false,
            "description": "Whether the bot sleeps on workflow outbound messages."
          },
          "sleepTime": {
            "type": "number",
            "example": 2,
            "description": "Duration of sleep period."
          },
          "sleepTimeUnit": {
            "type": "string",
            "enum": [
              "hours",
              "minutes",
              "seconds"
            ],
            "example": "hours",
            "description": "Unit of sleep time."
          },
          "emailWaitTime": {
            "type": "number",
            "example": 1,
            "description": "Email-specific wait time (max 12 hours)."
          },
          "emailWaitTimeUnit": {
            "type": "string",
            "enum": [
              "seconds",
              "minutes",
              "hours"
            ],
            "example": "hours",
            "description": "Unit for email wait time."
          },
          "emailSettings": {
            "type": "object",
            "description": "Email channel formatting settings."
          },
          "actions": {
            "description": "List of actions associated with this agent.",
            "example": [
              {
                "id": "actionId123",
                "type": "triggerWorkflow"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "actionId123",
                  "description": "Unique identifier for the action."
                },
                "type": {
                  "type": "string",
                  "example": "triggerWorkflow",
                  "description": "type of action.",
                  "enum": [
                    "triggerWorkflow",
                    "updateContactField",
                    "appointmentBooking",
                    "stopBot",
                    "humanHandOver",
                    "advancedFollowup",
                    "transferBot",
                    "customApi"
                  ]
                }
              },
              "required": [
                "id",
                "type"
              ],
              "title": "ActionsIdDto"
            }
          },
          "isPrimary": {
            "type": "boolean",
            "example": false,
            "description": "Indicates if this agent is a primary agent."
          },
          "autoPilotMaxMessages": {
            "type": "number",
            "example": 25,
            "description": "Maximum number of messages in auto-pilot mode before requiring human intervention."
          },
          "goal": {
            "type": "string",
            "example": "Assist customers with inquiries",
            "description": "The goal of the agent."
          },
          "personality": {
            "type": "string",
            "example": "Friendly and helpful",
            "description": "Personality traits of the agent."
          },
          "instructions": {
            "type": "string",
            "example": "Provide excellent customer service",
            "description": "Instructions for the agent."
          },
          "fullPrompt": {
            "type": "string",
            "description": "Complete agent prompt when stored; when set and non-empty, used as the source of truth at generation time."
          },
          "knowledgeBaseIds": {
            "example": [
              "kb_123",
              "kb_456"
            ],
            "description": "Array of knowledge base IDs associated with this agent.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "knowledgeBaseTriggers": {
            "description": "Knowledge base trigger configurations",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "550e8400-e29b-41d4-a716-446655440000",
                  "description": "Unique trigger ID (UUID v4)"
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "all",
                    "custom"
                  ],
                  "description": "\"all\" matches every query; \"custom\" is conditional"
                },
                "knowledgeBaseIds": {
                  "description": "KB IDs assigned to this trigger (max 7 for \"all\", max 5 for \"custom\")",
                  "example": [
                    "kb_001"
                  ],
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "triggerCondition": {
                  "type": "string",
                  "description": "Free-text condition (empty string for \"all\" mode, required for \"custom\")",
                  "example": "When the customer asks about pricing or billing"
                },
                "priority": {
                  "type": "number",
                  "description": "Priority (lower number = higher priority). Custom-mode triggers must use unique values in 1-3; priority 4 is reserved for the all-mode fallback trigger.",
                  "example": 2
                }
              },
              "required": [
                "id",
                "mode",
                "knowledgeBaseIds",
                "triggerCondition",
                "priority"
              ],
              "title": "KnowledgeBaseTriggerDto"
            }
          },
          "workingHours": {
            "nullable": true,
            "description": "Working-hours schedule for this agent, or null when not configured. Manage it via the /working-hours routes.",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "example": false,
                    "description": "Master toggle for working hours."
                  },
                  "channels": {
                    "type": "array",
                    "example": [
                      "SMS",
                      "WhatsApp"
                    ],
                    "description": "Channels the gate applies to. Must be non-empty when enabled.",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SMS",
                        "Email",
                        "WhatsApp",
                        "IG",
                        "FB",
                        "WebChat",
                        "Live_Chat",
                        "TIKTOK"
                      ]
                    }
                  },
                  "timezoneMode": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "business"
                    ]
                  },
                  "schedule": {
                    "type": "object",
                    "properties": {
                      "mon": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      },
                      "tue": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      },
                      "wed": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      },
                      "thu": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      },
                      "fri": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      },
                      "sat": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      },
                      "sun": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "slots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "startHour": {
                                  "type": "number",
                                  "example": 9,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "startMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                },
                                "endHour": {
                                  "type": "number",
                                  "example": 17,
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "endMinute": {
                                  "type": "number",
                                  "example": 0,
                                  "minimum": 0,
                                  "maximum": 59
                                }
                              },
                              "required": [
                                "startHour",
                                "startMinute",
                                "endHour",
                                "endMinute"
                              ],
                              "title": "TimeSlotDto"
                            }
                          }
                        },
                        "required": [
                          "enabled",
                          "slots"
                        ],
                        "title": "DayScheduleDto"
                      }
                    },
                    "required": [
                      "mon",
                      "tue",
                      "wed",
                      "thu",
                      "fri",
                      "sat",
                      "sun"
                    ],
                    "title": "WeeklyScheduleDto"
                  },
                  "continueConversations": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "example": true
                      },
                      "inactivityTimeout": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "number",
                            "example": 15,
                            "minimum": 1,
                            "maximum": 1440,
                            "description": "5–1440 for minutes, 1–24 for hours (5 min – 24 h). Exact bound depends on `unit`."
                          },
                          "unit": {
                            "type": "string",
                            "enum": [
                              "minutes",
                              "hours"
                            ]
                          }
                        },
                        "required": [
                          "value",
                          "unit"
                        ],
                        "title": "InactivityTimeoutDto"
                      }
                    },
                    "required": [
                      "enabled",
                      "inactivityTimeout"
                    ],
                    "title": "ContinueConversationsDto"
                  },
                  "offHoursAutoReply": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "example": false
                      },
                      "message": {
                        "type": "string",
                        "example": "Thanks for reaching out! We're currently outside of business hours."
                      },
                      "sendNotification": {
                        "type": "boolean",
                        "example": false
                      },
                      "notificationConfig": {
                        "nullable": true,
                        "allOf": [
                          {
                            "type": "object",
                            "properties": {
                              "emailNotification": {
                                "type": "object",
                                "properties": {
                                  "enabled": {
                                    "type": "boolean",
                                    "example": false
                                  },
                                  "notifyAdmins": {
                                    "type": "boolean",
                                    "example": false
                                  },
                                  "notifyAllUsers": {
                                    "type": "boolean",
                                    "example": false
                                  },
                                  "notifyAssignedUser": {
                                    "type": "boolean",
                                    "example": false
                                  },
                                  "notifySpecificUsers": {
                                    "type": "boolean",
                                    "example": false
                                  },
                                  "specificUserIds": {
                                    "example": [],
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "notifyCustomEmail": {
                                    "type": "boolean",
                                    "example": false
                                  },
                                  "customEmail": {
                                    "type": "string",
                                    "example": "",
                                    "description": "Comma-separated emails. May be empty; a blank value simply yields no custom recipient."
                                  }
                                },
                                "required": [
                                  "notifyAdmins",
                                  "notifyAllUsers",
                                  "notifyAssignedUser",
                                  "notifySpecificUsers",
                                  "specificUserIds",
                                  "notifyCustomEmail",
                                  "customEmail"
                                ],
                                "title": "EmailNotificationRecipientsDto"
                              },
                              "contactTags": {
                                "example": [],
                                "maxItems": 500,
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "emailNotification",
                              "contactTags"
                            ],
                            "title": "OffHoursNotificationConfigDto"
                          }
                        ]
                      }
                    },
                    "required": [
                      "enabled",
                      "message"
                    ],
                    "title": "OffHoursAutoReplyDto"
                  },
                  "followUp": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "example": false
                      },
                      "message": {
                        "type": "string",
                        "example": "Hi {{contact.name}}, we're here now and happy to help."
                      }
                    },
                    "required": [
                      "enabled",
                      "message"
                    ],
                    "title": "WorkingHoursFollowUpMessageDto"
                  },
                  "employeeId": {
                    "type": "string",
                    "example": "wK36brxPYCOikC85FkbA",
                    "description": "AI employee id this config belongs to."
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 creation time."
                  },
                  "updatedAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO-8601 last-update time."
                  }
                },
                "required": [
                  "enabled",
                  "channels",
                  "timezoneMode",
                  "schedule",
                  "continueConversations",
                  "offHoursAutoReply",
                  "followUp",
                  "employeeId"
                ],
                "title": "WorkingHoursConfigPayloadDto"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "mode",
          "channels",
          "waitTime",
          "waitTimeUnit",
          "sleepEnabled",
          "actions",
          "isPrimary",
          "autoPilotMaxMessages"
        ],
        "title": "EmployeeResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X PUT 'https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "John Doe",
  "businessName": "Tech Corp",
  "mode": "auto-pilot",
  "channels": [
    "SMS",
    "Live_Chat"
  ],
  "isPrimary": true,
  "waitTime": 30,
  "waitTimeUnit": "seconds",
  "sleepEnabled": false,
  "sleepOnManualMessage": false,
  "sleepOnWorkflowMessage": false,
  "sleepTime": 10,
  "sleepTimeUnit": "hours",
  "personality": "You re an AI assistant and you are friendly and helpful",
  "goal": "You are an AI assistant and you are helping customers with inquiries.",
  "instructions": "Provide excellent customer service.",
  "autoPilotMaxMessages": 75,
  "knowledgeBaseIds": [
    "kb_abc123",
    "kb_def456"
  ],
  "respondToImages": true,
  "respondToAudio": true
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "name": "John Doe",
      "businessName": "Tech Corp",
      "mode": "auto-pilot",
      "channels": [
        "SMS",
        "Live_Chat"
      ],
      "isPrimary": true,
      "waitTime": 30,
      "waitTimeUnit": "seconds",
      "sleepEnabled": false,
      "sleepOnManualMessage": false,
      "sleepOnWorkflowMessage": false,
      "sleepTime": 10,
      "sleepTimeUnit": "hours",
      "personality": "You re an AI assistant and you are friendly and helpful",
      "goal": "You are an AI assistant and you are helping customers with inquiries.",
      "instructions": "Provide excellent customer service.",
      "autoPilotMaxMessages": 75,
      "knowledgeBaseIds": [
        "kb_abc123",
        "kb_def456"
      ],
      "respondToImages": true,
      "respondToAudio": true
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/conversation-ai/agents/{agentId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

payload = {
    "name": "John Doe",
    "businessName": "Tech Corp",
    "mode": "auto-pilot",
    "channels": [
        "SMS",
        "Live_Chat"
    ],
    "isPrimary": true,
    "waitTime": 30,
    "waitTimeUnit": "seconds",
    "sleepEnabled": false,
    "sleepOnManualMessage": false,
    "sleepOnWorkflowMessage": false,
    "sleepTime": 10,
    "sleepTimeUnit": "hours",
    "personality": "You re an AI assistant and you are friendly and helpful",
    "goal": "You are an AI assistant and you are helping customers with inquiries.",
    "instructions": "Provide excellent customer service.",
    "autoPilotMaxMessages": 75,
    "knowledgeBaseIds": [
        "kb_abc123",
        "kb_def456"
    ],
    "respondToImages": true,
    "respondToAudio": true
}

response = requests.put(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "name": "John Doe",
  "businessName": "Tech Corp",
  "mode": "auto-pilot",
  "channels": [
    "SMS",
    "Live_Chat"
  ],
  "isPrimary": true,
  "waitTime": 30,
  "waitTimeUnit": "seconds",
  "sleepEnabled": false,
  "sleepOnManualMessage": false,
  "sleepOnWorkflowMessage": false,
  "sleepTime": 10,
  "sleepTimeUnit": "hours",
  "personality": "You re an AI assistant and you are friendly and helpful",
  "goal": "You are an AI assistant and you are helping customers with inquiries.",
  "instructions": "Provide excellent customer service.",
  "autoPilotMaxMessages": 75,
  "knowledgeBaseIds": [
    "kb_abc123",
    "kb_def456"
  ],
  "respondToImages": true,
  "respondToAudio": true
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"name\":\"John Doe\",\"businessName\":\"Tech Corp\",\"mode\":\"auto-pilot\",\"channels\":[\"SMS\",\"Live_Chat\"],\"isPrimary\":true,\"waitTime\":30,\"waitTimeUnit\":\"seconds\",\"sleepEnabled\":false,\"sleepOnManualMessage\":false,\"sleepOnWorkflowMessage\":false,\"sleepTime\":10,\"sleepTimeUnit\":\"hours\",\"personality\":\"You re an AI assistant and you are friendly and helpful\",\"goal\":\"You are an AI assistant and you are helping customers with inquiries.\",\"instructions\":\"Provide excellent customer service.\",\"autoPilotMaxMessages\":75,\"knowledgeBaseIds\":[\"kb_abc123\",\"kb_def456\"],\"respondToImages\":true,\"respondToAudio\":true}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>"
  payload := strings.NewReader(`{
  "name": "John Doe",
  "businessName": "Tech Corp",
  "mode": "auto-pilot",
  "channels": [
    "SMS",
    "Live_Chat"
  ],
  "isPrimary": true,
  "waitTime": 30,
  "waitTimeUnit": "seconds",
  "sleepEnabled": false,
  "sleepOnManualMessage": false,
  "sleepOnWorkflowMessage": false,
  "sleepTime": 10,
  "sleepTimeUnit": "hours",
  "personality": "You re an AI assistant and you are friendly and helpful",
  "goal": "You are an AI assistant and you are helping customers with inquiries.",
  "instructions": "Provide excellent customer service.",
  "autoPilotMaxMessages": 75,
  "knowledgeBaseIds": [
    "kb_abc123",
    "kb_def456"
  ],
  "respondToImages": true,
  "respondToAudio": true
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "name": "John Doe",
  "businessName": "Tech Corp",
  "mode": "auto-pilot",
  "channels": [
    "SMS",
    "Live_Chat"
  ],
  "isPrimary": true,
  "waitTime": 30,
  "waitTimeUnit": "seconds",
  "sleepEnabled": false,
  "sleepOnManualMessage": false,
  "sleepOnWorkflowMessage": false,
  "sleepTime": 10,
  "sleepTimeUnit": "hours",
  "personality": "You re an AI assistant and you are friendly and helpful",
  "goal": "You are an AI assistant and you are helping customers with inquiries.",
  "instructions": "Provide excellent customer service.",
  "autoPilotMaxMessages": 75,
  "knowledgeBaseIds": [
    "kb_abc123",
    "kb_def456"
  ],
  "respondToImages": true,
  "respondToAudio": true
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$body = '{
  "name": "John Doe",
  "businessName": "Tech Corp",
  "mode": "auto-pilot",
  "channels": [
    "SMS",
    "Live_Chat"
  ],
  "isPrimary": true,
  "waitTime": 30,
  "waitTimeUnit": "seconds",
  "sleepEnabled": false,
  "sleepOnManualMessage": false,
  "sleepOnWorkflowMessage": false,
  "sleepTime": 10,
  "sleepTimeUnit": "hours",
  "personality": "You re an AI assistant and you are friendly and helpful",
  "goal": "You are an AI assistant and you are helping customers with inquiries.",
  "instructions": "Provide excellent customer service.",
  "autoPilotMaxMessages": 75,
  "knowledgeBaseIds": [
    "kb_abc123",
    "kb_def456"
  ],
  "respondToImages": true,
  "respondToAudio": true
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/conversation-ai/agents/<agentId>' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
