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

# Create Agent

> Create a new agent for handling specific tasks and interactions within the system for Voice AI.

## Authorization

<ParamField header="x-api-key" type="string" required>
  Your Api Key
</ParamField>

### Body

<ParamField body="name" type="string" required>
  The name of the agent to be created.
</ParamField>

<ParamField body="welcomeMessage" type="string">
  The welcome message to be delivered by the agent.
</ParamField>

<ParamField body="task" type="string" required>
  The task or purpose of the agent, stored as long text.
</ParamField>

<ParamField body="voice" type="string" required>
  The voice setting for the agent.
</ParamField>

<ParamField body="language" type="string" required>
  The language in which the agent communicates.
</ParamField>

<ParamField body="telephonyProvider" type="string" optional>
  The telephony provider used for handling calls, defaulting to "twilio".
</ParamField>

<ParamField body="callTermination" type="integer" optional>
  The duration or condition under which the call terminates, if applicable.
</ParamField>

<ParamField body="hangupMessage" type="string" optional>
  The message delivered when the agent hangs up.
</ParamField>

<ParamField body="apiTool" type="json" optional>
  The API tool configuration for the agent, if applicable.
</ParamField>

<ParamField body="knowledgeBase" type="string" optional>
  The knowledge base reference for the agent, if applicable.
</ParamField>

<ParamField body="workflow" type="string" optional>
  The workflow to run after call is ended. Here the value will be workflow id.
</ParamField>

## Response

<ResponseField name="response" type="array">
  <Expandable title="properties">
    <ResponseField name="success" type="boolean">
      Indicates if the request was successful.
    </ResponseField>

    <ResponseField name="data" type="object">
      The created agent object containing all the input fields.

      <Expandable title="properties">
        <ResponseField name="id" type="string">
          Unique identifier for the created agent.
        </ResponseField>

        <ResponseField name="name" type="string">
          The name assigned to the agent.
        </ResponseField>

        <ResponseField name="welcomeMessage" type="string">
          The message the agent speaks when a call is connected.
        </ResponseField>

        <ResponseField name="task" type="string">
          The purpose or function of the agent.
        </ResponseField>

        <ResponseField name="voice" type="string">
          The voice setting configured for the agent.
        </ResponseField>

        <ResponseField name="language" type="string">
          The language the agent uses for communication.
        </ResponseField>

        <ResponseField name="telephonyProvider" type="string">
          The provider used for handling incoming and outgoing calls.
        </ResponseField>

        <ResponseField name="callTermination" type="integer">
          The condition or duration that triggers call termination.
        </ResponseField>

        <ResponseField name="hangupMessage" type="string">
          The message played when the agent initiates a call hangup.
        </ResponseField>

        <ResponseField name="apiTool" type="json">
          Configuration details for the API tool integrated with the agent.
        </ResponseField>

        <ResponseField name="knowledgeBase" type="string">
          Reference to the knowledge base associated with the agent.
        </ResponseField>

        <ResponseField name="workflow" type="string">
          The workflow process triggered after a call is completed.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>
