> For the complete documentation index, see [llms.txt](https://ask-clio.gitbook.io/ask-clio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ask-clio.gitbook.io/ask-clio/tools-and-data-plug-in-your-apis/adding-dynamic-inputs-secure-firm-defined-fields-for-ask-clio-api-calls.md).

# Adding Dynamic Inputs: Secure, Firm-Defined Fields for Ask Clio API Calls

Dynamic Inputs allow your firm to define arbitrary, secure fields that can be injected into Ask Clio tool calls at runtime.

This works similarly to passing a clearing account ID, but instead of relying on a single pre-defined identifier, Dynamic Inputs let you create any number of firm-defined inputs (e.g. internal account IDs, portfolio IDs, entitlement flags, jurisdiction codes) and pass them securely via the Ask Clio session token API.

Dynamic Inputs are:

* Passed server-to-server during session creation
* Not exposed to the LLM prompt
* Only available to tools that explicitly reference them

***

### How Dynamic Inputs Work

1. Your firm defines one or more Dynamic Input keys in the Ask Clio dashboard
2. Your backend passes values for those keys when creating a session token
3. Ask Clio makes those values available to tools during execution<br>

### Step 1

Navigate to Integrations → Dynamic Inputs in the Ask Clio dashboard.

<figure><img src="/files/Tua03uCzHJ2TANf0oUzQ" alt=""><figcaption></figcaption></figure>

### Step 2

Create a new Dynamic Input by defining a key.\
This key represents a secure identifier that exists in your own system.

Examples:

* internal\_account\_id
* portfolio\_id
* advisor\_tier
* jurisdiction\_code

> **Note on User Identity**
>
> Dynamic Inputs are intended for resource- or account-level identifiers (e.g. internal account IDs, clearing account IDs, portfolio IDs).
>
> Do **not** use Dynamic Inputs as a replacement for `user.id`. `user.id` should always represent your application’s internal user identifier (for example, a user UUID from your auth system).

> Chat history is not affected by Dynamic Inputs. Conversation history is always keyed by `user.id`.

<br>

<figure><img src="/files/sguUMry40TgRuSfUVrQm" alt=""><figcaption></figcaption></figure>

### Step 3

Set the Dynamic Input key that you will reference in your API calls.

This key:

* Maps to a value stored in your database
* Is passed explicitly during session creation
* Is never derived or inferred by Ask Clio

Ask Clio does not persist this value outside the session lifecycle.

<figure><img src="/files/4L6cYHy2Vp9nLZmQnISb" alt=""><figcaption></figcaption></figure>

### Step 4

Use your Client Signing Keys to securely pass Dynamic Input values when creating a session token.

Dynamic Inputs are included in the tools\_input object of the token request.

<figure><img src="/files/e4DTXadjY95VxSKtCUU0" alt=""><figcaption></figcaption></figure>

***

### Security & Model Access

* Dynamic Inputs are never included in the LLM prompt
* They are only accessible to tool execution
* They are passed server-to-server during session creation
* They are only returned in responses if a tool explicitly returns them<br>

This mirrors the security model used for clearing account identifiers.

***

### Example

<br>

#### Description

This endpoint generates a session token for Ask Clio by calling the token API with client-specific information.

In this example, internal\_account\_id is a firm-defined Dynamic Input passed in the tools\_input field, allowing Ask Clio tools to access client-specific data securely.

#### How It Works

* ### Fetch the client from your database (includes internal account ID)
* ### Call Ask Clio’s token endpoint with client credentials
* ### Pass Dynamic Inputs in tools\_input
* ### Receive a session token for SDK initialization

> **Important: User ID vs Dynamic Inputs**
>
> Dynamic Inputs (including clearing account identifiers such as `alpaca_account_id`) must be passed only via `tools_input`.
>
> Do not place clearing account IDs in `user.id`.
>
> The `user.id` field should always represent your application’s internal end-user identifier (e.g. your user UUID), not a brokerage or clearing account.

#### Token Request (to Ask Clio)

The Endpoint URL is <https://app.askclio.ai/api/auth/v1/client-identities/tokens>

### `{`

### &#x20; `"client_id": "3254c04e-f81f-4794-85ec-7f641ffdd1c0",`

### &#x20; `"client_secret": "[CLIO_CLIENT_SECRET]",`

### &#x20; `"user": {`

### &#x20;   `"id": "client-uuid",`

### &#x20;   `"email": "demo@roboadvisor.com"`

### &#x20; `},`

### &#x20; `"tools_input": {`

### &#x20;   `"internal_account_id": "DEMO-5555"`

### &#x20; `}`

### `}`<br>

#### Response

### `{`

### &#x20; `"success": true,`

### &#x20; `"token": "395d9ec11ae980837b284939efd...",`

### &#x20; `"expires_at": "2026-01-24T16:58:51.331982Z",`

### &#x20; `"client": {`

### &#x20;   `"id": "11111111-2222-3333-4444-555555555555",`

### &#x20;   `"name": "John Doe",`

### &#x20;   `"email": "demo@roboadvisor.com",`

### &#x20;   `"account_number": "DEMO-5555"`

### &#x20; `}`

### `}`

<br>

###

### SDK Usage

### Pass the session token to the Ask Clio SDK using the st query parameter:

### `https://app.askclio.ai/?client_id=CLIENT_ID&st=SESSION_TOKEN`

<br>

The session token encapsulates all Dynamic Inputs for that user session and is consumed automatically by Ask Clio tools.

###

Dynamic Inputs vs Clearing Account IDs

| <h3>Feature</h3>           | <h3>Clearing Account ID</h3>         | <h3>Dynamic Inputs</h3>    |
| -------------------------- | ------------------------------------ | -------------------------- |
| <h3>Defined by</h3>        | <h3>Ask Clio / Clearing Partner</h3> | <h3>Your firm</h3>         |
| <h3>Number of fields</h3>  | <h3>Fixed</h3>                       | <h3>Unlimited</h3>         |
| <h3>Required by tools</h3> | <h3>Yes (clearing tools)</h3>        | <h3>Optional</h3>          |
| <h3>Passed via</h3>        | <h3>Session token API</h3>           | <h3>Session token API</h3> |
| <h3>Exposed to LLM</h3>    | <h3>No</h3>                          | <h3>No</h3>                |

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ask-clio.gitbook.io/ask-clio/tools-and-data-plug-in-your-apis/adding-dynamic-inputs-secure-firm-defined-fields-for-ask-clio-api-calls.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
