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

# Create assistant

> Create a new AI assistant with specified configuration

This endpoint allows you to create a new AI assistant with comprehensive configuration options.

## Engine Modes

The API supports three engine modes, each with different capabilities:

| Mode         | Description                          | Required Fields       |
| ------------ | ------------------------------------ | --------------------- |
| `pipeline`   | Traditional STT → LLM → TTS pipeline | `llm_model_id`        |
| `multimodal` | Real-time multimodal AI              | `multimodal_model_id` |
| `dualplex`   | Multimodal brain + custom TTS voice  | `multimodal_model_id` |

### Request Body

#### Core Required Fields

<ParamField body="name" type="string" required>
  The name of the assistant (max 255 characters)
</ParamField>

<ParamField body="voice_id" type="integer" required>
  The voice ID to use for the assistant. Use the [Get Voices](/api-reference/assistants/get-voices) endpoint with the `mode` parameter to get compatible voices for your engine mode.
</ParamField>

<ParamField body="language_id" type="integer" required>
  The language ID for the assistant. Use the [Get Languages](/api-reference/assistants/get-languages) endpoint to get available languages.
</ParamField>

<ParamField body="type" type="string" required>
  The assistant type. Options: `inbound`, `outbound`
</ParamField>

<ParamField body="mode" type="string" required>
  The engine mode. Options: `pipeline`, `multimodal`, `dualplex`
</ParamField>

<ParamField body="timezone" type="string" required>
  The timezone for the assistant (e.g., "Europe/Bucharest", "America/New\_York")
</ParamField>

<ParamField body="initial_message" type="string" required>
  The initial message the assistant will speak when the call starts (max 200 characters)
</ParamField>

<ParamField body="system_prompt" type="string" required>
  The system prompt that defines the assistant's behavior and personality
</ParamField>

#### Mode-Specific Fields

<ParamField body="llm_model_id" type="integer">
  The LLM model ID to use. **Required for `pipeline` mode.**

  Use the [Get Models](/api-reference/assistants/get-models) endpoint to get available models.
</ParamField>

<ParamField body="multimodal_model_id" type="integer">
  The multimodal model ID. **Required for `multimodal` and `dualplex` modes.**

  Use the [Get Models](/api-reference/assistants/get-models) endpoint to get available multimodal models.
</ParamField>

<ParamField body="chat_llm_fallback_id" type="integer">
  Fallback LLM model ID for tool calls in multimodal/dualplex modes. Optional.
</ParamField>

<ParamField body="turn_detection_threshold" type="number">
  Turn detection sensitivity for multimodal/dualplex modes (0-1). Default: auto
</ParamField>

#### Secondary Languages

<ParamField body="secondary_language_ids" type="integer[]">
  Array of additional language IDs the assistant can speak. The assistant will auto-detect and switch languages.

  ```json theme={null}
  "secondary_language_ids": [2, 3, 4]
  ```
</ParamField>

#### Knowledgebase Settings

<ParamField body="knowledgebase_id" type="integer">
  The knowledgebase ID to attach to this assistant
</ParamField>

<ParamField body="knowledgebase_mode" type="string">
  How to use the knowledgebase. Options:

  * `function_call` - AI calls a function to search (required for multimodal/dualplex)
  * `prompt` - Knowledge is injected into prompt (pipeline only)
</ParamField>

#### Phone Number

<ParamField body="phone_number_id" type="integer">
  The ID of a phone number to assign to the assistant. Must belong to your account.

  <Warning>
    For `inbound` assistants, the phone number cannot be a Caller ID type and cannot be already assigned to another inbound assistant.
  </Warning>
</ParamField>

#### Custom Mid-Call Tools

<ParamField body="tool_ids" type="integer[]">
  Array of custom mid-call tool IDs to attach. Each tool must belong to your account.

  ```json theme={null}
  "tool_ids": [1, 5, 12]
  ```
</ParamField>

#### Built-in Tools

<ParamField body="tools" type="array">
  Array of built-in tools to enable. Each tool has a `type` and tool-specific fields.

  <Expandable title="Tool types">
    **call\_transfer** - Transfer the call to another phone number

    * `phone_number` (required): Phone number to transfer to (e.g., "+1234567890")
    * `description`: When to transfer the call
    * `custom`: If true, AI can determine transfer number dynamically
    * `timezone`: Timezone for transfer availability

    **end\_call** - End the call programmatically

    * `description`: When the AI should end the call

    **dtmf\_input** - Send DTMF tones (keypad input)

    * `description`: When to use DTMF input (for IVR navigation)

    **calendar\_integration** - Schedule appointments via Cal.com

    * `calcom_api_key` (required): Your Cal.com API key
    * `calcom_event_slug` (required): The event type slug
    * `description`: When to offer scheduling
  </Expandable>

  ```json theme={null}
  "tools": [
    {
      "type": "call_transfer",
      "phone_number": "+1234567890",
      "description": "Transfer when customer requests human support"
    },
    {
      "type": "dtmf_input",
      "description": "Navigate IVR menus when needed"
    },
    {
      "type": "end_call",
      "description": "End call when customer confirms satisfaction"
    }
  ]
  ```
</ParamField>

#### Voice and TTS Settings

<ParamField body="tts_emotion_enabled" type="boolean" default="true">
  Whether to enable emotional text-to-speech synthesis
</ParamField>

<ParamField body="voice_stability" type="number" default="0.70">
  Voice stability setting (0-1). Higher = more consistent voice
</ParamField>

<ParamField body="voice_similarity" type="number" default="0.50">
  Voice similarity setting (0-1). Higher = closer to original voice
</ParamField>

<ParamField body="speech_speed" type="number" default="1.00">
  Speech speed multiplier (0.7-1.2)
</ParamField>

<ParamField body="llm_temperature" type="number" default="0.10">
  LLM temperature setting (0-1). Lower = more deterministic
</ParamField>

<ParamField body="synthesizer_provider_id" type="integer">
  Custom TTS provider ID. Auto-selected based on language if not provided.
</ParamField>

<ParamField body="transcriber_provider_id" type="integer">
  Custom STT provider ID. Auto-selected based on language if not provided. Pipeline mode only.
</ParamField>

#### Call Behavior Settings

<ParamField body="allow_interruptions" type="boolean" default="true">
  Whether to allow caller interruptions.

  <Warning>Cannot be disabled for `multimodal` and `dualplex` modes.</Warning>
</ParamField>

<ParamField body="fillers" type="boolean" default="false">
  Whether to use filler audio during processing (e.g., "um", "let me check").

  <Warning>Only available for `pipeline` mode.</Warning>
</ParamField>

<ParamField body="record" type="boolean" default="false">
  Whether to record the call
</ParamField>

<ParamField body="enable_noise_cancellation" type="boolean" default="true">
  Whether to enable noise cancellation
</ParamField>

<ParamField body="wait_for_customer" type="boolean" default="false">
  If true, the assistant waits for the customer to speak first
</ParamField>

#### Timing Settings

<ParamField body="max_duration" type="integer" default="600">
  Maximum call duration in seconds (20-1200)
</ParamField>

<ParamField body="max_silence_duration" type="integer" default="40">
  Maximum silence duration before re-engagement in seconds (1-360)
</ParamField>

<ParamField body="max_initial_silence_duration" type="integer">
  Maximum silence at call start before ending (1-120 seconds). Optional.
</ParamField>

<ParamField body="ringing_time" type="integer" default="30">
  Maximum ringing time before giving up (1-60 seconds)
</ParamField>

#### Re-engagement Settings

<ParamField body="reengagement_interval" type="integer" default="30">
  Re-engagement interval in seconds (7-600)
</ParamField>

<ParamField body="reengagement_prompt" type="string">
  Custom prompt for re-engagement messages (max 1000 characters)

  Example: `"Are you still there? Do you have any other questions?"`
</ParamField>

#### Voicemail Settings

<ParamField body="end_call_on_voicemail" type="boolean" default="true">
  Whether to end call when voicemail is detected
</ParamField>

<ParamField body="voice_mail_message" type="string">
  Message to leave on voicemail before hanging up (max 1000 characters)
</ParamField>

#### Endpoint Detection

<ParamField body="endpoint_type" type="string" default="vad">
  Voice activity detection type. Options: `vad`, `ai`
</ParamField>

<ParamField body="endpoint_sensitivity" type="number" default="0.5">
  Endpoint sensitivity level (0-5)
</ParamField>

<ParamField body="interrupt_sensitivity" type="number" default="0.5">
  Interrupt sensitivity level (0-5)
</ParamField>

<ParamField body="min_interrupt_words" type="integer">
  Minimum words before interruption is allowed (0-10). Set to enable.
</ParamField>

#### Ambient Sound

<ParamField body="ambient_sound" type="string">
  Background ambient sound. Options: `off`, `office`, `city`, `forest`, `crowded_room`, `cafe`, `nature`
</ParamField>

<ParamField body="ambient_sound_volume" type="number" default="0.5">
  Ambient sound volume level (0-1)
</ParamField>

#### Webhook Configuration

<ParamField body="is_webhook_active" type="boolean" default="false">
  Whether webhook notifications are enabled
</ParamField>

<ParamField body="webhook_url" type="string">
  The webhook URL for post-call notifications. **Required if `is_webhook_active` is true.**
</ParamField>

<ParamField body="send_webhook_only_on_completed" type="boolean" default="true">
  Whether to send webhooks only on completed calls (not failed/no-answer)
</ParamField>

<ParamField body="include_recording_in_webhook" type="boolean" default="true">
  Whether to include recording URL in webhook payload
</ParamField>

#### Post-Call Evaluation

<ParamField body="post_call_evaluation" type="boolean" default="true">
  Whether to enable AI post-call evaluation
</ParamField>

<ParamField body="post_call_schema" type="array">
  Schema definition for post-call data extraction

  <Expandable title="post_call_schema properties">
    <ParamField body="name" type="string" required>
      Field name (3-16 chars, lowercase, alphanumeric and underscores only)
    </ParamField>

    <ParamField body="type" type="string" required>
      Data type. Options: `string`, `number`, `bool`
    </ParamField>

    <ParamField body="description" type="string" required>
      Description of what this field represents (3-255 characters)
    </ParamField>
  </Expandable>

  ```json theme={null}
  "post_call_schema": [
    {"name": "status", "type": "bool", "description": "Was the call objective achieved"},
    {"name": "summary", "type": "string", "description": "Brief summary of the call"}
  ]
  ```
</ParamField>

#### Variables

<ParamField body="variables" type="object">
  Key-value pairs of custom variables accessible in prompts via `{{variable_name}}`

  ```json theme={null}
  "variables": {
    "company_name": "Acme Corp",
    "product": "Premium Widget",
    "support_email": "support@acme.com"
  }
  ```
</ParamField>

***

## Example Requests

### Pipeline Mode Assistant

```json theme={null}
{
  "name": "Sales Assistant",
  "voice_id": 1,
  "language_id": 1,
  "type": "outbound",
  "mode": "pipeline",
  "timezone": "Europe/Bucharest",
  "initial_message": "Hello! How can I help you today?",
  "system_prompt": "You are a professional sales assistant...",
  "llm_model_id": 2,
  "secondary_language_ids": [2, 3],
  "knowledgebase_id": 1,
  "knowledgebase_mode": "prompt",
  "fillers": true,
  "tool_ids": [1, 5],
  "tools": [
    {"type": "end_call", "description": "End call when customer is satisfied"},
    {"type": "call_transfer", "phone_number": "+1234567890", "description": "Transfer to support"}
  ],
  "reengagement_interval": 20,
  "reengagement_prompt": "Are you still there?"
}
```

### Multimodal Mode Assistant

```json theme={null}
{
  "name": "Support Bot",
  "voice_id": 41,
  "language_id": 1,
  "type": "inbound",
  "mode": "multimodal",
  "timezone": "America/New_York",
  "initial_message": "Hi! Welcome to support.",
  "system_prompt": "You are a helpful support agent...",
  "multimodal_model_id": 1,
  "chat_llm_fallback_id": 2,
  "turn_detection_threshold": 0.7,
  "knowledgebase_id": 1,
  "knowledgebase_mode": "function_call",
  "tts_emotion_enabled": false
}
```

### Dualplex Mode Assistant

```json theme={null}
{
  "name": "Premium Agent",
  "voice_id": 1,
  "language_id": 2,
  "type": "outbound",
  "mode": "dualplex",
  "timezone": "Europe/Bucharest",
  "initial_message": "Buna ziua!",
  "system_prompt": "Esti un asistent profesionist...",
  "multimodal_model_id": 4,
  "chat_llm_fallback_id": 2,
  "secondary_language_ids": [1, 3],
  "knowledgebase_id": 1,
  "knowledgebase_mode": "function_call",
  "ambient_sound": "office",
  "ambient_sound_volume": 0.3
}
```

***

## Response

<ResponseField name="message" type="string">
  Success message confirming assistant creation
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="integer">
      The unique identifier of the created assistant
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the assistant
    </ResponseField>

    <ResponseField name="status" type="string">
      The current status (`inactive` for new assistants)
    </ResponseField>

    <ResponseField name="type" type="string">
      The type (`inbound` or `outbound`)
    </ResponseField>

    <ResponseField name="mode" type="string">
      The engine mode (`pipeline`, `multimodal`, or `dualplex`)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 201 Success Response theme={null}
  {
    "message": "Assistant created successfully",
    "data": {
      "id": 789,
      "name": "Sales Assistant",
      "status": "inactive",
      "type": "outbound",
      "mode": "pipeline"
    }
  }
  ```

  ```json 422 Validation Error theme={null}
  {
    "message": "Validation failed",
    "errors": {
      "name": ["The name field is required."],
      "voice_id": ["The selected voice is not compatible with the chosen engine type."],
      "knowledgebase_mode": ["Only function_call mode is available for multimodal assistants."]
    }
  }
  ```
</ResponseExample>

***

## Notes

* All required fields must be provided for successful assistant creation
* Use the Get Voices endpoint with `mode` parameter to get compatible voices
* For multimodal/dualplex modes, `knowledgebase_mode` must be `function_call`
* For multimodal/dualplex modes, `allow_interruptions` is always enabled
* Fillers are only available in pipeline mode
* The assistant is created with `inactive` status by default
