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

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

Request body

businessId
string
required
Your Connectly business identifier.
clientKey
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.

Response

response.sessionId
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.
Store the sessionId immediately after calling this endpoint. Without it you cannot send messages or close the session.

Example

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" }
{
  "response": {
    "sessionId": "b6bed81c-5fda-486d-b96c-1ff3af36219a"
  }
}