Skip to main content
POST
/
external
/
v1
/
ai
/
agent_graph
/
invoke_sync
Invoke (Sync)
curl --request POST \
  --url https://api.example.com/external/v1/ai/agent_graph/invoke_sync
{
  "response.sessionId": "<string>",
  "response.responseEvents": [
    {}
  ]
}
Use this endpoint when you want the agent’s complete reply in a single JSON response rather than a streaming NDJSON body. Useful for server-to-server integrations where streaming is inconvenient. You must initialise a session before calling this endpoint.

Endpoint

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

Request body

Same as Invoke (Stream) — businessId, clientKey, sessionId, optional agentId, and inputEvents with the same supported event types.

Response

response.sessionId
string
The session ID for this conversation.
response.responseEvents
array
All agent response events returned in a single array. Each element contains exactly one event key:

Example

POST /external/v1/ai/agent_graph/invoke_sync 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": "your-session-id",
  "inputEvents": [
    {
      "messageEvent": {
        "role": "USER",
        "content": { "textContent": { "text": "What are your store hours?" } }
      }
    }
  ]
}
{
  "response": {
    "sessionId": "your-session-id",
    "responseEvents": [
      {
        "messageEvent": {
          "role": "ASSISTANT",
          "content": { "textContent": { "text": "We're open Monday–Friday, 9am–6pm." } }
        }
      }
    ]
  }
}