> ## Documentation Index
> Fetch the complete documentation index at: https://api.scalysis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare chat

> List the variables to fill before chatting with an agent.

Step 1 of [Chat with an agent](https://api.scalysis.com/guides/chat-with-an-agent.md). Tells you if the agent can chat and which variables to send. Free, no chat is started.

## Path

**id** `number` *required*

Agent ID from [List agents](https://api.scalysis.com/api-reference/agents/list.md).

```bash cURL theme={null}
curl https://app.scalysis.com/api/v1/agent-scripts/2207/chat/prepare \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json 200 theme={null}
{
  "success": true,
  "script_id": 2207,
  "script_name": "COD Confirmation",
  "chat_ready": true,
  "variables": [
    { "name": "agent_name", "required": true },
    { "name": "brand_name", "required": true },
    { "name": "customer_name", "required": true }
  ]
}
```

```json 404 theme={null}
{ "success": false, "error": "Script not found" }
```

## Response

**chat\_ready** `boolean`

`true` if you can start a chat. If `false`, open the agent in the dashboard, save it, and try again.

**variables** `array`

Every variable the agent uses. Send a value for each one in [Start chat](https://api.scalysis.com/api-reference/agent-chat/start.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.