# AI Actions

> Manage your AI Agent's AI Actions via the API.

## AI Actions

AI Actions extend your AI Agent's capabilities beyond answering questions from the Knowledge Base. They let you define **triggered behaviors** — things the AI should do when it detects specific situations in a conversation.

**What AI Actions do:**
- **HTTP Request Actions** — Call external APIs when triggered. For example, check order status in your backend, create a support ticket, or look up account information — all during the conversation.
- **Remote MCP Actions** — Connect to Model Context Protocol servers for advanced tool integrations (e.g., Shopify product lookups, custom database queries).

**Typical use cases:**
- Look up real-time information (order status, account details, inventory) from your backend systems during conversations
- Create tickets, update CRM records, or trigger workflows in external systems based on conversation context
- Provide personalized recommendations by querying your product catalog

Each action has a `name`, `description` (which tells the AI when to trigger it), and a type-specific configuration. Actions can be enabled/disabled individually via the API. Actions are created and fully configured in the [Quickchat Dashboard](https://app.quickchat.ai/) — the API provides list, update (enable/disable), and delete operations.

### List All AI Actions

**Scope: read_all**

`GET https://app.quickchat.ai/v1/api/ai_actions`

**Shell**

```shell
curl https://app.quickchat.ai/v1/api/ai_actions \
  -H 'Authorization: Bearer <API_TOKEN>'
```

**Python**

```python
import requests

response = requests.get(
    url="https://app.quickchat.ai/v1/api/ai_actions",
    headers={"Authorization": "Bearer <API_TOKEN>"},
)
data = response.json()
```

**Response** `200 OK`

```json
[
  {
    "id": 1,
    "name": "Check Order Status",
    "description": "Look up order status when customer asks about their order.",
    "is_active": true,
    "type": "http_request",
    "icon": null,
    "icon_color": null,
    "is_valid": true
  }
]
```

| Field | Description |
|-------|-------------|
| `id` <br/> integer | AI Action identifier |
| `name` <br/> string | Display name |
| `description` <br/> string | When the action triggers |
| `is_active` <br/> boolean | Whether enabled |
| `type` <br/> string | `"http_request"`, `"remote_mcp"`, or `"shopify_remote_mcp"` |
| `icon` <br/> string or null | Icon identifier |
| `icon_color` <br/> string or null | Icon color |
| `is_valid` <br/> boolean | Whether properly configured |

### Update AI Action

**Scope: write_all**

`PATCH https://app.quickchat.ai/v1/api/ai_actions/{action_id}`

**Request Body**

| Parameter | Description |
|-----------|-------------|
| `is_active` <br/> boolean | Enable/disable the action |
| `icon` <br/> string | Icon identifier (max 200 chars) |
| `icon_color` <br/> string | Icon color (max 50 chars) |

**Shell**

```shell
curl -X PATCH https://app.quickchat.ai/v1/api/ai_actions/1 \
  -H 'Authorization: Bearer <API_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"is_active": false}'
```

**Python**

```python
import requests

response = requests.patch(
    url="https://app.quickchat.ai/v1/api/ai_actions/1",
    headers={"Authorization": "Bearer <API_TOKEN>"},
    json={"is_active": False},
)
data = response.json()
```

**Response** `200 OK` — Returns the updated AI Action snapshot.

### Delete AI Action

**Scope: write_all**

`DELETE https://app.quickchat.ai/v1/api/ai_actions/{action_id}`

**Shell**

```shell
curl -X DELETE https://app.quickchat.ai/v1/api/ai_actions/1 \
  -H 'Authorization: Bearer <API_TOKEN>'
```

**Python**

```python
import requests

response = requests.delete(
    url="https://app.quickchat.ai/v1/api/ai_actions/1",
    headers={"Authorization": "Bearer <API_TOKEN>"},
)
```

**Response** `204 No Content`

---
