Skip to main content
POST
/
external
/
v1
/
ai
/
agent_graph
/
close
Close Session
curl --request POST \
  --url https://api.example.com/external/v1/ai/agent_graph/close \
  --header 'Content-Type: application/json' \
  --data '
{
  "businessId": "<string>",
  "clientKey": "<string>",
  "sessionId": "<string>"
}
'
{
  "result.response": {},
  "error": {}
}
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 to begin a fresh conversation.

Endpoint

POST https://api.connectly.ai/external/v1/ai/agent_graph/close

Request body

businessId
string
required
Your Connectly business identifier.
clientKey
string
required
The unique identifier for the customer whose session you are closing.
sessionId
string
required
The session ID returned by the init endpoint.

Response

result.response
object
An empty object {} confirming the session was closed successfully.
error
object
null on success. Populated with code, message, and details if an error occurred.

Example

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"
}
{
  "result": { "response": {} },
  "error": null
}