> For the complete documentation index, see [llms.txt](https://docs.systemsx.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.systemsx.co.uk/sense/api-assist-functions.md).

# API Assist - Functions

## Start a Function

<mark style="color:green;">`POST`</mark> `/v2/assist/start`

| Type   | Function                               |
| ------ | -------------------------------------- |
| button |                                        |
|        | narrow\_down                           |
|        | recommend                              |
|        | \[List in "buttons" from /assist/load] |
| ask    |                                        |
|        | ask                                    |

**Body**

<table><thead><tr><th width="236">Name</th><th>Type</th></tr></thead><tbody><tr><td><code>access_token</code></td><td>string</td></tr><tr><td><code>type</code></td><td>string</td></tr><tr><td><code>function</code></td><td>string</td></tr><tr><td><code>context[]</code></td><td>Example: <code>How hot is it in Spain?</code></td></tr><tr><td><code>context[]</code></td><td>Example: <code>2 Adults going from Spain to London</code></td></tr><tr><td><code>context[]</code></td><td>Example: <code>Client Name: John Doe</code></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "pollingUrl": "check?session=SESSIONID&type=ask&function=ask",
    "type": "ask",
    "function": "ask"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

## Check Status of Request

<mark style="color:green;">`POST`</mark> `/v2/assist/check`

Check the status of a Start Function

**Body**

| Name           | Type   | Description                |
| -------------- | ------ | -------------------------- |
| `access_token` | string |                            |
| `session`      | string | Pulled from Start Function |
| `type`         | string | Pulled from Start Function |
| `function`     | string | Pulled from Start Function |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "running": true, // Will only show when AI is still running.
  "complete" true, // Will only show when AI is complete.
  "content": "" // JSON as String. "text" for ASK and Buttons will provide multiple keys.
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}
