> ## 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.

# Close Session

> End an active conversation session and release its resources ✌️

Call this endpoint when a conversation is complete to release the session and free associated resources. After closing, you cannot send further messages using the same `sessionId`. Start a new session with the [init endpoint](/ai/agent-graph/init-session) to begin a fresh conversation.

## Endpoint

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

## Request body

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

<ParamField body="clientKey" type="string" required>
  The unique identifier for the customer whose session you are closing.
</ParamField>

<ParamField body="sessionId" type="string" required>
  The session ID returned by the [init](/ai/agent-graph/init-session) endpoint.
</ParamField>

## Response

<ResponseField name="result.response" type="object">
  An empty object `{}` confirming the session was closed successfully.
</ResponseField>

<ResponseField name="error" type="object">
  `null` on success. Populated with `code`, `message`, and `details` if an error occurred.
</ResponseField>

## Example

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

{
  "businessId": "your-business-id",
  "clientKey": "customer-123",
  "sessionId": "b6bed81c-5fda-486d-b96c-1ff3af36219a"
}
```

```json theme={null}
{
  "result": { "response": {} },
  "error": null
}
```
