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

# Create Agent

> Creates a new agent.



## OpenAPI

````yaml post /agents
openapi: 3.0.3
info:
  title: Vogent - OpenAPI 3.0
  description: Test Description
  version: 1.0.11
servers:
  - url: https://api.vogent.ai/api
security:
  - bearerAuth: []
paths:
  /agents:
    post:
      summary: Create Agent
      description: Creates a new agent.
      operationId: createAgent
      requestBody:
        description: Create a new agent
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
components:
  schemas:
    CreateAgentInput:
      type: object
      properties:
        name:
          type: string
          description: The name of the agent.
          nullable: false
        defaultVoiceId:
          type: string
          description: The ID of the voice to use.
          nullable: false
        defaultVersionedPrompt:
          $ref: '#/components/schemas/CreateVersionedPromptInput'
          nullable: false
          description: The default versioned prompt to use for this agent.
        defaultExtractor:
          $ref: '#/components/schemas/CreateCallAgentExtractorInput'
          nullable: true
          description: The default extractor to use for this agent.
        inboundWebhookResponse:
          type: boolean
          nullable: false
        inboundWebhookUrl:
          type: string
          nullable: false
        maxDurationSeconds:
          type: integer
          nullable: false
          default: 10800
          description: The maximum duration of the call in seconds.
        timeoutMessage:
          type: string
          nullable: true
          description: >-
            An optional message to play via TTS before hanging up when the call
            reaches its max duration timeout.
        timeoutBehaviorConfiguration:
          $ref: '#/components/schemas/TimeoutBehaviorConfiguration'
          nullable: true
          description: >-
            Configuration for the behavior when a call reaches its max duration
            timeout.
        openingLine:
          type: object
          properties:
            lineType:
              $ref: '#/components/schemas/OpeningLineType'
              nullable: false
              description: An indication of when the opening line should be used.
            content:
              type: string
              nullable: false
              description: The content of the opening line.
          required:
            - lineType
            - content
          nullable: true
          description: >-
            Details about the Agent's opening line. If unspecified, or null no
            opening line will be created.
        voiceVolumeLevel:
          type: integer
          nullable: true
          default: -100
          description: >-
            A value, generally between -300 and 300, indicating the volume level
            to use for the voice. The default is -100.
        backgroundNoiseType:
          type: string
          enum:
            - noise
            - office
            - silence
          default: office
          description: The background audio that's used by the agent.
        linkedFunctionDefinitionIds:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            type: string
          description: >-
            The function definitions that should be available to this agent
            (deprecated, use linkedFunctionDefinitionInputs instead)
        linkedFunctionDefinitionInputs:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/LinkedFunctionDefinition'
          description: >-
            The function definitions that should be available to this agent with
            optional lifecycle message overrides
        metadata:
          type: object
          additionalProperties: {}
          x-go-type-skip-optional-pointer: true
        transcriberParams:
          $ref: '#/components/schemas/TranscriberParams'
          x-go-type-skip-optional-pointer: true
          nullable: true
        idleMessageConfig:
          $ref: '#/components/schemas/IdleMessageConfig'
        utteranceDetectorConfig:
          $ref: '#/components/schemas/UtteranceDetectorConfig'
        endpointDetectorConfig:
          $ref: '#/components/schemas/EndpointDetectorConfig'
          nullable: true
          description: >-
            Configuration for endpoint detection to determine when a user has
            finished speaking. If not specified, will default to a semantic
            detector in the default mode.
        ivrConfiguration:
          $ref: '#/components/schemas/IVRConfiguration'
          description: >-
            The configuration for IVR detection and navigation including
            detection type, prompt, voice, and tagging settings.
          nullable: true
        language:
          type: string
          default: en
          description: The language to use for the agent.
        secondaryLanguages:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            type: string
          description: Additional languages the agent can switch to during a call.
        enableChangeLanguage:
          type: boolean
          description: >-
            Whether the agent can use the change_language tool to switch
            languages during a call.
        fillEmptyStringVariables:
          type: boolean
          nullable: true
          description: >-
            If true, variables that are not specified will be filled with empty
            strings instead of being left as template placeholders.
        silenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: >-
            Configuration for automatically hanging up the call after a period
            of silence.
        ivrSilenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: >-
            Configuration for automatically hanging up the call after a period
            of silence while in IVR mode.
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: An optional configuration for the voice being used.
      required:
        - name
        - defaultVoiceId
        - defaultVersionedPrompt
    Agent:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
        transcriberParams:
          $ref: '#/components/schemas/TranscriberParams'
          x-go-type-skip-optional-pointer: true
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          x-go-type-skip-optional-pointer: true
        utteranceDetectorConfig:
          $ref: '#/components/schemas/UtteranceDetectorConfig'
        endpointDetectorConfig:
          $ref: '#/components/schemas/EndpointDetectorConfig'
          nullable: true
          description: >-
            Configuration for endpoint detection to determine when a user has
            finished speaking.
        ivrConfiguration:
          $ref: '#/components/schemas/IVRConfiguration'
          description: >-
            The configuration for IVR detection and navigation including
            detection type, prompt, voice, and tagging settings.
          nullable: true
        idleMessageConfig:
          $ref: '#/components/schemas/IdleMessageConfig'
          nullable: true
          description: >-
            Configuration for idle messages that the agent can say when the user
            is silent.
        language:
          type: string
          description: The language to use for the agent.
        maxDurationSeconds:
          type: integer
          nullable: false
          default: 10800
          description: The maximum duration of the call in seconds.
        timeoutMessage:
          type: string
          nullable: true
          description: >-
            An optional message to play via TTS before hanging up when the call
            reaches its max duration timeout.
        timeoutBehaviorConfiguration:
          $ref: '#/components/schemas/TimeoutBehaviorConfiguration'
          nullable: true
          description: >-
            Configuration for the behavior when a call reaches its max duration
            timeout.
        defaultVoiceId:
          type: string
          description: The default voice ID to use for the agent.
        defaultVersionedPromptId:
          type: string
          description: The default versioned prompt ID to use for the agent.
        defaultExtractorId:
          type: string
          description: The default extractor ID to use for the agent.
          nullable: true
        linkedFunctionDefinitions:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/LinkedFunctionDefinition'
          description: The function definitions that should be available to this agent.
        fillEmptyStringVariables:
          type: boolean
          nullable: false
          description: >-
            If true, variables that are not specified will be filled with empty
            strings instead of being left as template placeholders.
        silenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: >-
            Configuration for automatically hanging up the call after a period
            of silence.
        ivrSilenceHangupConfiguration:
          $ref: '#/components/schemas/SilenceHangupConfiguration'
          nullable: true
          description: >-
            Configuration for automatically hanging up the call after a period
            of silence while in IVR mode.
        voiceOptionValues:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ModelOptionValue'
          description: The configuration values for the voice being used by the agent.
      required:
        - id
        - name
        - language
    CreateVersionedPromptInput:
      type: object
      properties:
        aiModelId:
          type: string
          description: The ID of the model to use.
          nullable: false
        agentType:
          $ref: '#/components/schemas/AgentType'
          description: The type of agent that this prompt represents.
        prompt:
          type: string
          nullable: true
        flowDefinition:
          $ref: '#/components/schemas/FlowDefinitionInput'
          description: >-
            For agents with agentType CUSTOM_FLOW, the flow definition that you
            want to use.
          nullable: false
        name:
          type: string
          nullable: false
        modelOptionValues:
          x-go-type-skip-optional-pointer: true
          type: array
          items:
            $ref: '#/components/schemas/ModelOptionValue'
      required:
        - aiModelId
        - agentType
        - name
    CreateCallAgentExtractorInput:
      type: object
      properties:
        name:
          type: string
          nullable: false
        extractorFieldsJsonSchema:
          type: string
          nullable: false
      required:
        - name
        - extractorFieldsJsonSchema
    TimeoutBehaviorConfiguration:
      type: object
      nullable: true
      properties:
        behavior:
          $ref: '#/components/schemas/TimeoutBehavior'
          nullable: false
          description: The timeout behavior to use.
        transferNumber:
          type: string
          nullable: true
          description: The phone number to transfer to when behavior is TRANSFER.
      required:
        - behavior
    OpeningLineType:
      type: string
      enum:
        - INBOUND_ONLY
        - INBOUND_OUTBOUND
        - NONE
    LinkedFunctionDefinition:
      type: object
      properties:
        functionDefinitionId:
          type: string
          nullable: false
          description: The ID of the function definition to link.
        lifecycleMessagesOverride:
          $ref: '#/components/schemas/FunctionLifecycleMessages'
          description: >-
            Lifecycle messages to override the defaults for this function link,
            or null to not override.
      required:
        - functionDefinitionId
    TranscriberParams:
      type: object
      properties:
        type:
          type: string
          nullable: false
          description: >-
            By default, the only supported option is deepgram. Please contact
            support if you'd like access to more options.
        keywords:
          type: array
          items:
            type: string
          description: Keywords to be used for transcription.
          x-go-type-skip-optional-pointer: true
          nullable: false
      required:
        - type
    IdleMessageConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether idle messages are enabled for this agent.
          nullable: false
        messages:
          type: array
          items:
            type: string
          description: >-
            The list of idle messages that the agent can say when the user is
            silent.
          nullable: false
          x-go-type-skip-optional-pointer: true
        idleDurationMilliseconds:
          type: integer
          description: >-
            The duration in milliseconds that the user must be silent before an
            idle message is triggered.
          nullable: false
          minimum: 5000
        maxIdleMessages:
          type: integer
          description: The maximum number of idle messages that can be said during a call.
          nullable: false
          minimum: 1
      required:
        - enabled
    UtteranceDetectorConfig:
      type: object
      properties:
        sensitivity:
          $ref: '#/components/schemas/UtteranceDetectorSensitivity'
        interruptionPlayTimeMs:
          type: integer
          description: >-
            The minimum amount of time in milliseconds that the agent will
            continue speaking after being interrupted. Defaults to 0.
          nullable: true
      required:
        - sensitivity
    EndpointDetectorConfig:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/EndpointDetectorType'
          nullable: false
          description: The type of endpoint detector to use.
        mode:
          $ref: '#/components/schemas/EndpointDetectorMode'
          nullable: true
          description: >-
            The mode for the endpoint detector (only applicable for SEMANTIC
            type).
      required:
        - type
    IVRConfiguration:
      type: object
      nullable: true
      properties:
        detectionType:
          $ref: '#/components/schemas/IvrDetectionType'
          description: The type of IVR detection to use.
          nullable: false
        versionedPromptId:
          type: string
          description: The versioned prompt ID to use for IVR detection.
          nullable: true
        aiVoiceId:
          type: string
          description: The AI voice ID to use for IVR detection.
          nullable: true
        taggingText:
          type: string
          description: The tagging text for IVR detection.
          nullable: true
      required:
        - detectionType
    SilenceHangupConfiguration:
      type: object
      nullable: true
      properties:
        type:
          $ref: '#/components/schemas/SilenceHangupType'
          nullable: false
          description: The type of silence hangup behavior.
        silenceDurationSeconds:
          type: integer
          description: The duration of silence in seconds before hanging up.
      required:
        - type
    ModelOptionValue:
      type: object
      description: >-
        A configuration value for the model. You can get a list of available
        models and their configuration values from /models. All configuration
        values, with defaults will be returned when you retrieve a versioned
        prompt.
      properties:
        optionId:
          type: string
          description: The ID of option.
          nullable: false
        value:
          type: string
          nullable: false
      required:
        - optionId
        - value
    AgentType:
      type: string
      enum:
        - STANDARD
        - CUSTOM_FLOW
    FlowDefinitionInput:
      type: object
      properties:
        nodes:
          type: array
          x-go-type-skip-optional-pointer: true
          items:
            $ref: '#/components/schemas/ApiFlowNodeInput'
          nullable: false
        globalContext:
          type: string
          nullable: true
        aiOpen:
          type: boolean
          nullable: false
          description: Deprecated, use openingLineType instead.
        openingLineType:
          $ref: '#/components/schemas/OpeningLineType'
          nullable: false
    TimeoutBehavior:
      type: string
      enum:
        - HANGUP
        - TRANSFER
      nullable: false
      description: >-
        The behavior when a call reaches its max duration timeout. HANGUP
        disconnects the call, TRANSFER forwards to a specified number.
    FunctionLifecycleMessages:
      type: object
      properties:
        started:
          type: array
          description: >-
            Messages to display when the function starts executing. One will be
            chosen at random.
          items:
            type: string
          nullable: false
      required:
        - started
    UtteranceDetectorSensitivity:
      type: string
      enum:
        - ULTRA_FAST
        - FAST
        - MEDIUM
        - SLOW
      nullable: false
    EndpointDetectorType:
      type: string
      enum:
        - SIMPLE
        - SEMANTIC
      nullable: false
    EndpointDetectorMode:
      type: string
      enum:
        - CONSERVATIVE
        - DEFAULT
        - AGGRESSIVE
      nullable: false
    IvrDetectionType:
      type: string
      enum:
        - NONE
        - STANDARD
      description: The type of IVR detection to use for the agent.
    SilenceHangupType:
      type: string
      enum:
        - DISABLED
        - FIRST_MESSAGE_ONLY
        - WHOLE_CALL
      nullable: false
      description: >-
        The type of silence hangup behavior. DISABLED means no silence hangup,
        FIRST_MESSAGE_ONLY means only hangup if no first message is received,
        WHOLE_CALL means hangup after silence at any point in the call.
    ApiFlowNodeInput:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          nullable: false
          description: >-
            One of the allowed flow node types. View the available types at
            https://docs.vogent.ai/flow.
        type:
          type: string
          nullable: false
        transitionRules:
          type: array
          items:
            $ref: '#/components/schemas/FlowTransitionRuleInput'
          nullable: false
        nodeData:
          type: object
          nullable: false
          description: >-
            The node-specific configuration. View the configurations by node
            type at https://docs.vogent.ai/flow.
      required:
        - id
        - name
        - type
        - transitionRules
        - nodeData
    FlowTransitionRuleInput:
      type: object
      properties:
        conditionType:
          $ref: '#/components/schemas/FlowTransitionRuleConditionType'
          nullable: false
        arrayConditionType:
          $ref: '#/components/schemas/ArrayConditionType'
        field:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        values:
          type: array
          items:
            type: string
          nullable: true
          x-go-type-skip-optional-pointer: true
        transitionNodeId:
          type: string
          nullable: false
      required:
        - conditionType
        - transitionNodeId
    FlowTransitionRuleConditionType:
      type: string
      enum:
        - always
        - equal
        - in
        - greater
        - less
        - language
      description: >-
        The condition used to evaluate the transition rule. If language, the
        value will be used as a natural language condition to describe when to
        execute a transition.
      nullable: false
    ArrayConditionType:
      type: string
      enum:
        - any
        - all
      description: >-
        The type of array condition to apply. 'any' means at least one element
        must match, 'all' means all elements must match.
      nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        In the form `Bearer <api_key_here>`. You can find your api key in your
        dashboard.

````