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

# Create Mid-call Action

> Create a new Mid-call Action for AI assistant integration

This endpoint allows you to create a new Mid-call Action that can be used by your AI assistants to interact with external APIs during calls.

### Body Parameters

The public API creates HTTP Mid-call Actions. Automation Platform Mid-call Actions (which generate a linked flow) are created from the dashboard. Mid-call Action values support dynamic variables — use `{param}` for AI-extracted parameters in the URL, and `{{variable}}` (e.g. `{{customer_phone}}`) in the URL, header values, and static field values.

<ParamField body="name" type="string" required>
  Mid-call Action name — letters, numbers and underscores, starting with a letter or underscore (max 64 characters, e.g. `get_weather`, `book_appointment`)
</ParamField>

<ParamField body="description" type="string" required>
  Detailed explanation of when and how the AI should use this Mid-call Action (max 255 characters)
</ParamField>

<ParamField body="endpoint" type="string" required>
  Valid URL of the API endpoint to call (max 2048 characters)
</ParamField>

<ParamField body="method" type="string" required>
  HTTP method: `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`
</ParamField>

<ParamField body="body_format" type="string" optional>
  How the request body is encoded for write methods (POST/PUT/PATCH): `json` (default) or `form` (`application/x-www-form-urlencoded`)
</ParamField>

<ParamField body="timeout" type="integer" optional>
  Request timeout in seconds (1-30, default: 10)
</ParamField>

<ParamField body="headers" type="array" optional>
  HTTP headers to send with the request

  <Expandable title="headers properties">
    <ParamField body="name" type="string" required>
      Header name
    </ParamField>

    <ParamField body="value" type="string" required>
      Header value (max 2048 chars; supports `{{variable}}` substitution)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="static_fields" type="array" optional>
  Fixed key/value pairs always sent with the request (the AI never changes them)

  <Expandable title="static_fields properties">
    <ParamField body="key" type="string" required>
      Field key (max 64 chars)
    </ParamField>

    <ParamField body="value" type="string" optional>
      Field value (max 2048 chars; supports `{{variable}}` substitution)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="schema" type="array" optional>
  Parameters that the AI will extract from conversation and send to the endpoint

  <Expandable title="schema properties">
    <ParamField body="name" type="string" required>
      Parameter name (1-64 chars, must start with a letter or underscore, can contain letters, numbers and underscores)
    </ParamField>

    <ParamField body="type" type="string" required>
      Parameter type: `string`, `number`, `float`, or `boolean`
    </ParamField>

    <ParamField body="description" type="string" required>
      Description to help AI understand how to extract this parameter (3-255 chars)
    </ParamField>

    <ParamField body="required" type="boolean" optional>
      Whether the AI must collect this parameter. Optional parameters are only sent when a value was collected. Defaults to `false`.
    </ParamField>
  </Expandable>
</ParamField>

### Response Fields

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<ResponseField name="data" type="object">
  The created Mid-call Action object

  <Expandable title="data properties">
    <ResponseField name="id" type="integer">
      The unique identifier of the Mid-call Action
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the Mid-call Action
    </ResponseField>

    <ResponseField name="description" type="string">
      Mid-call Action description
    </ResponseField>

    <ResponseField name="type" type="string">
      Mid-call Action type: `http` or `automation`
    </ResponseField>

    <ResponseField name="endpoint" type="string">
      API endpoint URL
    </ResponseField>

    <ResponseField name="method" type="string">
      HTTP method
    </ResponseField>

    <ResponseField name="body_format" type="string">
      Request body encoding: `json` or `form`
    </ResponseField>

    <ResponseField name="timeout" type="integer">
      Request timeout in seconds
    </ResponseField>

    <ResponseField name="headers" type="array">
      HTTP headers
    </ResponseField>

    <ResponseField name="static_fields" type="array">
      Fixed key/value pairs always sent with the request
    </ResponseField>

    <ResponseField name="schema" type="array">
      Parameter schema
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "message": "Tool created successfully",
    "data": {
      "id": 1,
      "name": "send_notification",
      "description": "Use this tool to send a notification to the customer. Call this when customer requests updates.",
      "type": "http",
      "endpoint": "https://api.yourcompany.com/notifications/send",
      "method": "POST",
      "body_format": "json",
      "timeout": 15,
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "static_fields": [
        {
          "key": "caller",
          "value": "{{customer_phone}}"
        }
      ],
      "schema": [
        {
          "name": "message",
          "type": "string",
          "description": "The notification message to send",
          "required": true
        },
        {
          "name": "send_sms",
          "type": "boolean",
          "description": "Whether to also send SMS notification",
          "required": false
        }
      ],
      "created_at": "2025-10-10T12:00:00.000000Z",
      "updated_at": "2025-10-10T12:00:00.000000Z"
    }
  }
  ```

  ```json 422 Validation Error theme={null}
  {
    "message": "The name field format is invalid.",
    "errors": {
      "name": [
        "Tool name must contain only letters, numbers and underscores, and start with a letter or underscore."
      ]
    }
  }
  ```

  ```json 422 Plan Limit Reached theme={null}
  {
    "message": "You have reached your plan limit of 5 mid call tools. Please upgrade your plan to create more tools."
  }
  ```
</ResponseExample>

### Attaching Mid-call Actions to Assistants

After creating a Mid-call Action, attach it to an assistant to use it during calls. Manage assignments through the Assistant API:

* **[Create Assistant](/en/api-reference/assistants/create)** — Use the `tool_ids` parameter to attach Mid-call Actions when creating an assistant
* **[Update Assistant](/en/api-reference/assistants/update)** — Use the `tool_ids` parameter to add, remove, or replace Mid-call Actions on an existing assistant

<Tip>
  Need a whole toolset instead of building HTTP actions one by one? Connect an external **MCP server** — tools are discovered automatically. See [MCP Servers](/en/platform/mcp-servers).
</Tip>
