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

# Init Session

> Start a new conversation session with a Connectly AI agent and receive a sessionId for subsequent calls 🎙️

Call this endpoint before sending any messages to a Connectly AI agent. It creates a new conversation session scoped to a specific customer and returns a `sessionId` you must pass to every subsequent invoke and close request.

## Endpoint

```json theme={null}
POST https://api.connectly.ai/external/v1/ai/agent_graph/init
```

## Request body

<ParamField body="businessId" type="string" required>
  Your Connectly business identifier.
</ParamField>

<ParamField body="clientKey" type="string" required>
  A unique identifier for the customer starting the conversation. Use a stable ID from your own system (e.g. a customer ID or phone number) so you can correlate sessions with users.
</ParamField>

## Response

<ResponseField name="response.sessionId" type="string">
  The unique identifier for this conversation session. Save this value — you must include it in all subsequent invoke and close calls for this conversation. Sessions are isolated; events from one session never affect another.
</ResponseField>

<Note>
  Store the `sessionId` immediately after calling this endpoint. Without it you cannot send messages or close the session.
</Note>

## Example

```http theme={null}
POST /external/v1/ai/agent_graph/init HTTP/1.1
Host: api.connectly.ai
x-api-key: YOUR_API_KEY
Content-Type: application/json

{ "businessId": "your-business-id", "clientKey": "customer-123" }
```

```json theme={null}
{
  "response": {
    "sessionId": "b6bed81c-5fda-486d-b96c-1ff3af36219a"
  }
}
```
