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

# Create an Agent

> Creates a new AI agent for the location. The agent will be created with the specified configuration including name, role, actions, and behavior settings.



## OpenAPI

````yaml /api-reference/conversation-ai/openapi.json post /conversation-ai/agents
openapi: 3.0.0
info:
  title: Conversation AI API
  description: Documentation for AI Employees API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: AI-Employees
    description: Documentation for AI Employees API
  - name: Actions
    description: Documentation for AI Employees API
  - name: Agents
    description: Documentation for AI Employees API
  - name: Generations
    description: Documentation for AI Employees API
paths:
  /conversation-ai/agents:
    post:
      tags:
        - Agents
      summary: Create an Agent
      description: >-
        Creates a new AI agent for the location. The agent will be created with
        the specified configuration including name, role, actions, and behavior
        settings.
      operationId: create-agent
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmployeeDto'
      responses:
        '201':
          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:
  schemas:
    CreateEmployeeDto:
      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
          default: 'off'
          description: Mode of operation - OFF, SUGGESTIVE, or AUTO_PILOT
        channels:
          type: array
          example:
            - SMS
            - Live_Chat
            - WhatsApp
          description: Communication channels the agent can operate on
          items:
            type: string
            enum:
              - IG
              - FB
              - SMS
              - WebChat
              - WhatsApp
              - Live_Chat
        isPrimary:
          type: boolean
          example: true
          default: false
          description: Indicates if this agent is a primary agent.
        waitTime:
          type: number
          example: 2
          default: 2
          description: Wait time before agent responds (max 5 for minutes, 300 for seconds)
        waitTimeUnit:
          type: string
          enum:
            - minutes
            - seconds
          example: seconds
          default: seconds
          description: Unit for wait time - SECONDS or MINUTES
        sleepEnabled:
          type: boolean
          example: false
          default: false
          description: Indicates if sleep functionality is enabled.
        sleepTime:
          type: number
          example: 2
          default: 2
          description: >-
            Duration of sleep period (required if sleepEnabled is true). (max
            2880 for minutes, 172800 for seconds, 48 for hours)
        sleepTimeUnit:
          type: string
          enum:
            - hours
            - minutes
            - seconds
          example: hours
          default: hours
          description: >-
            Unit of sleep time - HOURS, MINUTES, or SECONDS (required if
            sleepEnabled is true)
        personality:
          type: string
          example: Friendly and helpful
          description: Personality traits of the agent.
        goal:
          type: string
          example: Assist customers with inquiries.
          description: The goal of the agent.
        instructions:
          type: string
          example: Provide  customer service.
          description: Instructions for the agent.
        autoPilotMaxMessages:
          type: number
          example: 25
          default: 25
          description: >-
            Maximum number of messages in auto-pilot mode before requiring human
            intervention. (max: 25, min: 1)
        knowledgeBaseIds:
          description: Array of knowledge base IDs associated with this agent.
          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:
        - name
        - personality
        - goal
        - instructions
    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
        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.
        sleepTime:
          type: number
          example: 2
          description: Duration of sleep period.
        sleepTimeUnit:
          type: string
          enum:
            - hours
            - minutes
            - seconds
          example: hours
          description: Unit of sleep time.
        actions:
          description: List of actions associated with this agent.
          type: array
          items:
            $ref: '#/components/schemas/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.
        knowledgeBaseIds:
          example:
            - kb_123
            - kb_456
          description: Array of knowledge base IDs associated with this agent.
          type: array
          items:
            type: string
      required:
        - id
        - name
        - mode
        - channels
        - waitTime
        - waitTimeUnit
        - sleepEnabled
        - actions
        - isPrimary
        - autoPilotMaxMessages
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          example:
            - Unprocessable Entity
          type: array
          items:
            type: string
        error:
          type: string
          example: Unprocessable Entity
    ActionsIdDto:
      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
      required:
        - id
        - type
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access Token or Private Integration Token

````