***

title: Use action variables in inbound SIP calls
slug: use-action-variables-in-inbound-sip-calls
description: Inject action variables into inbound SIP calls so external data can enrich prompts and call behavior in real time.
---------------------

For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

## General Flow:

Action Variables allow dynamic data to be fetched and injected into prompts during a call. This is done by enriching the call context before it reaches the agent, using an external API.

![](https://files.readme.io/ae025926182835f0b606ccd01d5712ec159c2f886411020c70287d568622a12c-image.png)

## Step 1: Create Custom Action

[How to create actions](/api-reference/platform-api/actions/create-action)

Create an API-based action that fetches variables needed in your prompt.

* The API must use POST.
* Set `run_action_before_call_start`to `true`
* It must accept an `<external_id>` in the request body.
* It must return a JSON object where the keys match the variable names in your prompt.

<br />

Example: If your prompt uses a variable `name`, your API should return:

```Text Passing Variables
{
  "name": "John"
}

```

<br />

> Note: **No changes are needed for the prompts—they will work with the current variables. The only important point is to ensure that the same variable names used in the prompts are also used when returning values from the API.**

<br />

## Step 2: Attach Action

[How to attach actions](/api-reference/platform-api/actions/attach-action)

Once the action is created:

* Attach it to your agent.
* The agent will automatically invoke this action before the call starts, enriching the prompt with the fetched variables.

<br />

***