> For the complete documentation index, see [llms.txt](https://docs.valorx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valorx.com/valorx-fusion/design-studio/tasks/dynamic-api.md).

# Dynamic API

Dynamic API brings Postman-style API configuration directly into Fusion workflows. It lets you configure API endpoints, authentication, parameters, headers, and request bodies in Design Studio, while dynamically binding values from Excel cells, named ranges, workflow Data Intakes, Maps, and API Variables.

At runtime, Fusion resolves these values using the current workbook and workflow data, sends the API request, and stores the response in Excel or an API Variable for use in subsequent tasks. This lets you integrate with external APIs and build dynamic workflows without writing custom code.

You can access it from the **Dynamic API** tab in the **Tasks** menu. By clicking the 'New Dynamic API Task' button, the Dynamic API Task screen appears as shown in the image below:

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2F2wSunhJbamDERE3axceF%2FDynamic%20API%20Access.gif?alt=media&amp;token=b6ab7072-068f-4c06-9c3f-914619bae713" alt=""><figcaption><p>Access Dynamic API Task</p></figcaption></figure>

***

## Creating a Dynamic API task

To create a new task, click **New Dynamic API Task**, then work through the following steps.

{% stepper %}
{% step %}

#### Name The Dynamic API Task.&#x20;

Give it a clear, unique name in the Task Name field at the top of the window.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FpMW7q3N9qzl4sDeGPNp2%2FAdd%20Task%20Name.gif?alt=media&amp;token=2a59cefe-2549-456e-9b0d-1580a4c65ebe" alt=""><figcaption><p>Enter Task Name</p></figcaption></figure>
{% endstep %}

{% step %}

#### Choose The Method

Choose the HTTP method: **GET**, **POST**, **PUT**, **PATCH**, or **DELETE** based on what the external system expects. Then, enter the web address (URL) of the external system.

* *For more information, see* [*Method and URL*](#method-and-url)*.*

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FHhB11dbSMcPPZmPhtuAU%2FSet%20The%20Method.gif?alt=media&amp;token=9761d8d5-0dc9-4ccb-bd1c-eeb340fec854" alt=""><figcaption><p>Choose The Method</p></figcaption></figure>
{% endstep %}

{% step %}

#### **Configure The Request Tabs.**&#x20;

Work through **Params, Authorization, Headers, Body,** and **Settings** as needed for your API.\
*For more information, see* [*Params*](#params)*,* [*Authorization*](#authorization)*,* [*Headers*](#headers)*,* [*Body*](#body)*, and* [*Settings*](#settings)*.*

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2Fxas4UrtAtt8SlqdrmfEE%2Fimage.png?alt=media&amp;token=080c6a5f-dce6-439d-818d-6e017421ff93" alt=""><figcaption><p>Request Tabs</p></figcaption></figure>
{% endstep %}

{% step %}

#### Configure The Response.&#x20;

Click **Next** to choose where the response should be saved and, optionally, which fields to keep.\
*For more information, see* [*Response Configuration*](#response-configuration)*.*

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FvXzQWeN7T3re5m5XkB7j%2Fimage.png?alt=media&amp;token=ad6ea99a-dcd1-43f2-9cac-40278564f0d6" alt=""><figcaption><p>Response Configuration</p></figcaption></figure>
{% endstep %}

{% step %}

#### Save

Once you've configured the request, click **Save**. The task appears in the Dynamic API task list and is ready to be added to a workflow.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FZvFVV7w5fzu5b4ftTkuy%2FSave%20Dynamic%20API%20Task.gif?alt=media&amp;token=e831b884-f656-43fd-b530-424482f1dc9c" alt=""><figcaption><p>Save</p></figcaption></figure>
{% endstep %}
{% endstepper %}

***

## The Task Window

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FYqztXEegfSG4vjHjaBD9%2Fimage.png?alt=media&amp;token=c1d3346d-98c2-43dc-a266-e96c3c86f1d1" alt=""><figcaption><p>Dynamic API Window</p></figcaption></figure>

<table><thead><tr><th width="119" valign="middle">Control</th><th valign="bottom">What it does</th></tr></thead><tbody><tr><td valign="middle"><strong>Variables</strong></td><td valign="bottom">Opens the API Variables panel. The number shown is how many variables your app has. See “Using API Variables”.</td></tr><tr><td valign="middle"><strong>✕ / Cancel</strong></td><td valign="bottom">Closes the task without saving. If you have unsaved changes, you’ll be asked to confirm.</td></tr><tr><td valign="middle"><strong>Next</strong></td><td valign="bottom">Checks your request and moves to the response screen.</td></tr><tr><td valign="middle"><strong>Back</strong></td><td valign="bottom">Returns from the response screen to the request tabs.</td></tr><tr><td valign="middle"><strong>Save</strong></td><td valign="bottom">Checks everything and saves the task into your app.</td></tr></tbody></table>

***

## Method and URL

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FOPEVgJCamllSwqylxNOG%2FSet%20Up%20Request%20Parameter.gif?alt=media&amp;token=8095f294-1987-4727-9230-ab5b76b608f1" alt=""><figcaption><p>Set Up Request Parameters</p></figcaption></figure>

Type the address into the URL field. As you add parameters on the **Params** tab, they appear after the URL as a live preview, so you can see the whole address at a glance.

* Pasting a full URL that already has a query string works too, Fusion splits it automatically into the address and individual Params rows.
* Don’t type a “?” yourself. Query parameters belong on the Params tab so their values can stay dynamic.
* HTTPS only. A plain “http\://” address, or one with a username/password baked in, isn’t accepted.

The address plus its query string needs to stay under 2,048 characters

### Where Values Come From

Almost every value you enter, a parameter, a header, a field in the body, a password, has a Source next to it. This decides whether the value is fixed or read fresh every time the task runs.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2Fet9VZHsYhCUsozcfsKGh%2FParams%20Fields.gif?alt=media&amp;token=3db8289c-0647-41f9-8164-571de937935d" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="124.22222900390625" valign="middle">Source</th><th width="174.4444580078125" valign="middle">You pick</th><th valign="middle">At run time</th></tr></thead><tbody><tr><td valign="middle">Constant</td><td valign="middle">Type the value in</td><td valign="middle">Sent exactly as typed, every run.</td></tr><tr><td valign="middle">Cell</td><td valign="middle">A worksheet cell</td><td valign="middle">Read live from that cell each time.</td></tr><tr><td valign="middle">Range</td><td valign="middle">A named range</td><td valign="middle">Read live, one value or several if the field allows a list.</td></tr><tr><td valign="middle">Field</td><td valign="middle">An object and one of its fields</td><td valign="middle">Read from a dataset the workflow supplies. You’ll choose which dataset when you add the task to a workflow.</td></tr><tr><td valign="middle">API Variable</td><td valign="middle">A saved variable, or one field inside it</td><td valign="middle">Read from the value stored by an earlier task or sign-in.</td></tr></tbody></table>

When you select **Field** as the source, Fusion retrieves the value from the results of a query task elsewhere in your [workflow](/valorx-fusion/design-studio/workflow-and-ux/dynamic-api.md). For example, you can use a specific field from an **Account** or **Opportunity** record. Because the query results are available only when the workflow runs, you must specify which query result the field should come from. Configure this on the [workflow](/valorx-fusion/design-studio/workflow-and-ux/dynamic-api.md) screen.

***

## Params

A grid of query parameters, one row per parameter. Add a row with the + icon; remove one with the bin icon.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2Fvsus8VDxGKhjm4AMgJYS%2FParam.gif?alt=media&amp;token=9dcd4091-bacb-456e-a242-2a197391e4af" alt=""><figcaption></figcaption></figure>

<table data-search="false"><thead><tr><th width="169" valign="bottom">Column</th><th valign="bottom">Notes</th></tr></thead><tbody><tr><td valign="bottom">Checkbox</td><td valign="bottom">Untick to leave a row out of the request without deleting it.</td></tr><tr><td valign="bottom">Key</td><td valign="bottom">The parameter name.</td></tr><tr><td valign="bottom">Source</td><td valign="bottom">Constant, Cell, Range, Field, or API Variable.</td></tr><tr><td valign="bottom">Value</td><td valign="bottom">Changes to match the source you picked.</td></tr><tr><td valign="bottom">Description</td><td valign="bottom">Your own notes. Never sent.</td></tr></tbody></table>

***

## Authorization

Choose the authorization type required by the external system. Dynamic API supports the following authorization:

* **None -** Executes the API request without authentication. Use this option when the external API does not require you to sign in or provide credentials.
* **Basic Authentication -** Authenticates using a username and password. Enter the credentials required by the external API.
* **Bearer Token -** Sends an access token with the API request. Enter the token provided by the external API.
* **API Key -** Authenticates using an API key provided by the target API. Depending on the API, the key may be sent in the request headers or as part of the URL.
* **OAuth 2.0 -** Supports token-based authorization for APIs that use OAuth 2.0. Depending on the API, you may need to sign in through a secure authentication window to authorize access.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FS6bqhwckRIlcnDI84WWj%2FSet%20Up%20Authorization.gif?alt=media&amp;token=fd9568bb-ceba-4135-b764-7c6827fd4ca8" alt=""><figcaption><p>Set Up Authorization</p></figcaption></figure>

### OAuth 2.0

OAuth is set up once as a named token and then reused across tasks. Give the token a name and choose whether it should be Persistent (saved for future sessions) or Session (cleared when Excel closes), then pick a grant type:

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2F05oO5BDKszk2YOKRzh4W%2FOAuth%202.0.png?alt=media&amp;token=d5525569-d86c-43d2-9f3b-8d7fb8e33e56" alt=""><figcaption><p>OAuth 2.0</p></figcaption></figure>

<table><thead><tr><th width="175.3333740234375" valign="middle">Grant type</th><th width="411.888916015625" valign="middle">Required fields</th><th width="158.5555419921875" valign="middle">Sign-in</th></tr></thead><tbody><tr><td valign="middle">Client Credentials</td><td valign="middle">Access Token URL, Client ID, Client Secret</td><td valign="middle">Silent</td></tr><tr><td valign="middle">Password Credentials</td><td valign="middle">Access Token URL, Client ID, Client Secret, Username, Password</td><td valign="middle">Silent</td></tr><tr><td valign="middle">Authorization Code</td><td valign="middle">Callback URL, Auth URL, Access Token URL, Client ID, Client Secret</td><td valign="middle">Browser window</td></tr><tr><td valign="middle">Authorization Code (With PKCE)</td><td valign="middle">Same as above, plus Code Challenge Method and Code Verifier</td><td valign="middle">Browser window</td></tr><tr><td valign="middle">None</td><td valign="middle">No fields, for providers that don’t need a token exchange</td><td valign="middle">—</td></tr></tbody></table>

At execution, Fusion uses an explicitly configured token first. If no token is configured, it uses the selected **Authentication** variable. If the token has expired and refresh is enabled, Fusion attempts to refresh it. If the refresh fails, Fusion acquires a new token. For **Authorization Code** and **PKCE**, this may open the sign-in window.

Once created, the token is saved as an API Variable, so other tasks in the app can reuse it instead of signing in again.

***

## Headers

A grid of request headers, in the same style as Params, but with an extra Data Type column since header values are often typed more strictly by the receiving system.

Alongside the source, you’ll also set a **Data Type** (String, Number, Boolean, Object, or Null). This is what keeps the outgoing request correctly formatted rather than treating everything as plain text.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FSmlzX0LboHZgaqk8L5QN%2FSet%20Up%20Headers.gif?alt=media&amp;token=970edfbc-82d0-4a1a-969a-9c57a67779ee" alt=""><figcaption><p>Add Headers</p></figcaption></figure>

<table data-header-hidden data-search="false"><thead><tr><th width="151.22216796875" valign="bottom"></th><th valign="bottom"></th></tr></thead><tbody><tr><td valign="bottom">Key</td><td valign="bottom">The header name.</td></tr><tr><td valign="bottom">Source</td><td valign="bottom">Constant, Cell, Range, Field, or API Variable.</td></tr><tr><td valign="bottom">Value</td><td valign="bottom">Changes to match the source you picked.</td></tr><tr><td valign="bottom">Data Type</td><td valign="bottom">String, Number, Boolean, Object, or Null.</td></tr><tr><td valign="bottom">Description</td><td valign="bottom">Your own notes. Never sent.</td></tr><tr><td valign="bottom">Checkbox</td><td valign="bottom">Untick to leave a row out of the request without deleting it.</td></tr></tbody></table>

Setting a Content-Type header here overrides the default used for a JSON body.

***

## Body

Choose how the request body is built on the left of the Body tab.

<table><thead><tr><th width="115.3333740234375" valign="middle">Mode</th><th valign="middle">What you get</th><th valign="middle">Reach for it when</th></tr></thead><tbody><tr><td valign="middle">None</td><td valign="middle">No body sent</td><td valign="middle">GET and DELETE calls</td></tr><tr><td valign="middle">Form Data</td><td valign="middle">A key/value grid, sent as multipart form data</td><td valign="middle">The API expects an HTML-form style upload</td></tr><tr><td valign="middle">URL Encoded</td><td valign="middle">A key/value grid, sent as an encoded form</td><td valign="middle">Older endpoints expecting application/x-www-form-urlencoded</td></tr><tr><td valign="middle">JSON</td><td valign="middle">A structured payload you build field by field, in either a Tree or Editor view</td><td valign="middle">Most modern APIs, this is the most flexible option</td></tr><tr><td valign="middle">Reference</td><td valign="middle">The whole payload comes from a Cell, Range, or API Variable you point at</td><td valign="middle">The JSON is already built somewhere else, like an earlier task’s response</td></tr></tbody></table>

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FbdZ1c9myGXE5ORX9oSia%2FBody%20New.gif?alt=media&amp;token=9fb8a6c7-7f7e-41b7-8565-22b22f419843" alt=""><figcaption><p>Build the Request Body</p></figcaption></figure>

### Building a JSON Body

A JSON body isn’t just typed text, it’s built as a structure of fields, each with its own name, type, and source. There are two ways to work on it:

* **Editor view** shows the same body as JSON text. It’s the fastest way to get a shape in: paste a sample request from the API’s documentation, then switch to Tree to wire individual fields up to cells or datasets.<br>

  <figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2F2gcS1E5JGaWxbatHqOou%2Fimage.png?alt=media&amp;token=43723ed2-18e4-44ac-8e24-e0107764cb52" alt=""><figcaption><p>JSON (Editor)</p></figcaption></figure>
* **Tree view** is where you set sources, types, and build repeating sections (for example, one line item per row of a dataset).<br>

  <figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FpnfnRE3t9jHpeIubk3uO%2Fimage.png?alt=media&amp;token=a11a5f06-2e09-4bb7-aed9-74e0e78ea297" alt=""><figcaption><p>JSON (Tree View)</p></figcaption></figure>

A reliable way to build a body:

1. In Editor, paste a sample request (two or three example rows if it includes a repeating list).
2. Switch to Tree and confirm the types and array settings look right.
3. Set the Source on each field that should come from your workbook.
4. Switch back to Editor for a final check, live fields show as placeholders so you can see exactly what will be sent.

### Reference mode

Skip building the body field by field and point at where the finished payload already lives:

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FTjhCUAdID6RA6H2iX1fJ%2FReference%20Mode.gif?alt=media&amp;token=dfb047a0-e1f3-4ba9-b975-31a8a4b5a9f7" alt=""><figcaption><p>Reference Mode</p></figcaption></figure>

<table><thead><tr><th width="160.111083984375" valign="bottom">Source</th><th valign="bottom">What will be sent</th></tr></thead><tbody><tr><td valign="bottom">Cell</td><td valign="bottom">The text in that one cell, read fresh each run.</td></tr><tr><td valign="bottom">Range</td><td valign="bottom">The text the named range resolves to.</td></tr><tr><td valign="bottom">API Variable</td><td valign="bottom">Whatever the variable currently holds.</td></tr></tbody></table>

The value has to be valid JSON (an object or array, not a single number or word) or the step will fail with a message telling you which cell, range, or variable to check. If your payload could be very long, use an API Variable rather than a single cell, since a worksheet cell can only hold up to 32,767 characters.

***

## Settings

Configure additional options that control how the task behaves.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2F6jxHY7QwBuZzZHVo3WKO%2FSettings%20New.gif?alt=media&amp;token=69e0212d-82d4-4202-9d21-131cab1505f1" alt=""><figcaption><p>Configure Settings</p></figcaption></figure>

<table><thead><tr><th width="163.11102294921875" valign="middle">Setting</th><th width="137" valign="middle">Options</th><th valign="middle">What it controls</th></tr></thead><tbody><tr><td valign="middle">Type mismatch handling for referenced values</td><td valign="middle">Runtime Error / Use Null</td><td valign="middle">What happens when a cell, range, or field value doesn’t match the data type you declared, fail the run, or send a blank value and carry on.</td></tr><tr><td valign="middle">Fetch access token using refresh token</td><td valign="middle">Yes / No</td><td valign="middle">Whether an expired sign-in is renewed automatically in the background before asking anyone to sign in again.</td></tr><tr><td valign="middle">Always prompt for authentication</td><td valign="middle">Yes / No</td><td valign="middle">Off by default, the task reuses a saved sign-in. Turn on to require fresh credentials every run.</td></tr><tr><td valign="middle">Maximum number of redirects</td><td valign="middle">A number</td><td valign="middle">How many redirects the request will follow before giving up.</td></tr></tbody></table>

***

## Response Configuration

Clicking Next takes you to Response Configuration, where you choose where the response should be saved.

* **Cell** - A specific worksheet cell.
* **Range** - A named range.
* **API Variable** - A saved variable, so a later task can read the answer. You can create one right here.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FbngnnEKrzVpIq4mgHyfD%2FConfigure%20Response%20v2.gif?alt=media&amp;token=2d619608-6fc8-42c4-a9c3-86dead37cce1" alt=""><figcaption><p>Response Configuration</p></figcaption></figure>

By default, the whole response is written to your chosen destination. If you only want specific fields, define a Response Schema using the same Editor/Tree approach as the request body, paste a sample response to get the shape, then trim it down to just what you need.

***

## Using API Variables

An **API Variable** is a named holder for a value that can be reused across Dynamic API tasks. You can use API Variables to store values such as authentication tokens, IDs returned by one API call and used by another, or a base URL that you want to define in one place.

API Variables belong to the app rather than to a single task, allowing multiple tasks to use the same value.

<figure><img src="https://2472585788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFqFFf4143HS0_Wagnz%2Fuploads%2FixJnvr33BXoMlixfeCrA%2FSet%20API%20Variables.gif?alt=media&amp;token=26bbbd5b-6281-475f-92d5-fc9a748bee77" alt=""><figcaption><p>Configure API Variables</p></figcaption></figure>

To configure an API Variable, click **Variables** at the top of the task editor. When creating a variable, configure the following:

* **Shape** - Determines the type of data the variable stores:
  * **Scalar** - Stores a single value, such as text, a number, or a country code.
  * **JSON** - Stores structured data, such as the response returned by an API.
* **Scope** - Determines how long the variable remains available:
  * **Persistent** - Keeps the value available across sessions.
  * **Session** - Keeps the value available only for the current session and clears it when Excel closes.
* **Populated by** - Determines how the variable gets its value:
  * **Constant** - A value that you enter manually.
  * **Response** - Data returned by an API call.

A variable that’s currently being used elsewhere in your app is protected, editing it may be limited to just its name and scope, and deleting it is blocked until it’s no longer in use.

#### Using a variable

Anywhere you see a Source, choose API Variable. Scalar variables appear as single entries; JSON variables expand so you can pick a field inside them. The picker only offers variables that fit the field you’re filling.

#### Filling a variable

Values arrive two ways: you typed them in as a Constant, or a run wrote them via a task’s Response Configuration. A value written by one task is visible to the next task in the same run.

#### Scope and lifetime

<table><thead><tr><th width="115.3333740234375" valign="middle">Scope</th><th valign="middle">Lives for</th><th valign="middle">Choose it when</th></tr></thead><tbody><tr><td valign="middle">Persistent</td><td valign="middle">Across Excel restarts, encrypted on your own machine.</td><td valign="middle">You don’t want to sign in every morning.</td></tr><tr><td valign="middle">Session</td><td valign="middle">Only while Excel is open, never written to disk.</td><td valign="middle">Your organization’s policy forbids credentials at rest.</td></tr></tbody></table>

***

## What’s Next?

After creating and saving your Dynamic API Task, **Designers must configure the task in the Workflow** to make it executable at runtime.

👉 Go to Workflow Configuration *(*[*Dynamic API*](/valorx-fusion/design-studio/workflow-and-ux/dynamic-api.md)*)*

> 💡 Tasks that are not added to a workflow will not run in the app.
