Invoke (non-stream)
Same as Invoke, except the response is "sync" (without streaming) in JSON format.
This endpoint sends a prompt to the AI assistant agent graph and returns a single aggregated response containing all the assistant’s messages and actions.
Authorizations
Body
businessIdstringRequired
clientKeystringRequired
sessionIdstringRequired
Responses
200
A successful response.
application/json
default
An unexpected error response.
application/json
post
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
Accept: */*
Content-Length: 1062
{
"businessId": "text",
"clientKey": "text",
"sessionId": "text",
"inputEvents": [
{
"messageEvent": {
"role": "USER",
"content": {
"textContent": {
"text": "Ola"
}
}
}
},
{
"messageEvent": {
"role": "USER",
"content": {
"audioContent": {
"url": "https://cdn.connectly.ai/2f07/2f079bfa-8e1b-4b42-94ac-d20115cc9ebb"
}
}
}
},
{
"messageEvent": {
"role": "USER",
"content": {
"imageContent": {
"url": "https://example.com/logo.png",
"caption": "Sample logo"
}
}
}
},
{
"messageEvent": {
"role": "USER",
"content": {
"locationContent": {
"latitude": "25.41914",
"longitude": "-49.26545",
"name": "Curitiba",
"address": "Rua Comendador Fontana, 324–338 Alto da Gloria Curitiba - PR 80030-070 Brazil"
}
}
}
},
{
"buttonResponseEvent": {
"id": "button-id",
"title": "Button Title"
}
},
{
"listReplyEvent": {
"id": "list-item-id",
"title": "Option Title",
"description": "Option Description"
}
},
{
"filledFormResponseEvent": {
"formData": {
"name": "João Silva",
"email": "[email protected]",
"phone": "+55 11 99999-9999",
"message": "Interested in your products"
}
}
},
{
"storeEvent": {
"storeId": "22473",
"name": "Store Name",
"cpName": "CP Name",
"city": "City",
"state": "State"
}
}
]
}
{
"response": {
"sessionId": "text",
"responseEvents": [
{
"messageEvent": {
"role": "MESSAGE_EVENT_ROLE_UNSPECIFIED",
"content": {
"textContent": {
"text": "text"
},
"audioContent": {
"url": "text"
},
"imageContent": {
"url": "text",
"caption": "text"
},
"locationContent": {
"latitude": 1,
"longitude": 1,
"name": "text",
"address": "text"
}
},
"createdAt": "2025-07-08T18:46:44.464Z",
"metadata": {}
},
"recommendationEvent": {
"products": [
{
"productId": "text",
"title": "text",
"description": "text",
"url": "text",
"imageUrl": "text",
"price": 1,
"currency": "text",
"facets": {},
"metadata": {}
}
]
},
"chatSuggestionEvent": {
"suggestedQuestions": [
"text"
]
},
"agentHandoverEvent": {
"triggerHandover": true,
"reason": "text",
"reasonNative": "text"
},
"storefrontHandoverEvent": {
"triggerHandover": true,
"initialSearchPhrase": "text"
},
"orderStatusHandoverEvent": {
"triggerHandover": true
},
"locationQueryHandoverEvent": {
"triggerHandover": true
},
"onelivDoctorHandoverEvent": {
"triggerHandover": true,
"doctorSpecialty": "text",
"doctorName": "text",
"requirements": "text"
},
"leadgenHandoverEvent": {
"triggerHandover": true
},
"connectlyInteractiveEvent": {
"interactive": {
"listMessage": {
"header": {
"text": "text",
"attachment": {
"type": "ATTACHMENT_TYPE_UNSPECIFIED",
"asset": {
"id": "text",
"url": "text",
"caption": "text",
"filename": "text"
}
}
},
"footer": {
"text": "text"
},
"button": {
"id": "text",
"text": "text"
},
"sections": [
{
"title": "text",
"rows": [
{
"id": "text",
"text": "text",
"description": "text"
}
]
}
],
"buttonText": "text"
},
"replyButtonMessage": {
"header": {
"text": "text",
"attachment": {
"type": "ATTACHMENT_TYPE_UNSPECIFIED",
"asset": {
"id": "text",
"url": "text",
"caption": "text",
"filename": "text"
}
}
},
"footer": {
"text": "text"
},
"buttons": [
{
"id": "text",
"text": "text"
}
]
},
"singleProductMessage": {
"footer": {
"text": "text"
},
"actionButton": {
"id": "text",
"text": "text"
},
"buttons": [
{
"id": "text",
"text": "text"
}
],
"catalogId": "text",
"productItem": {
"productRetailerId": "text"
}
},
"multiProductMessage": {
"header": {
"text": "text",
"attachment": {
"type": "ATTACHMENT_TYPE_UNSPECIFIED",
"asset": {
"id": "text",
"url": "text",
"caption": "text",
"filename": "text"
}
}
},
"footer": {
"text": "text"
},
"actionButton": {
"id": "text",
"text": "text"
},
"buttons": [
{
"id": "text",
"text": "text"
}
],
"catalogId": "text",
"sections": [
{
"title": "text",
"productItems": [
{
"productRetailerId": "text"
}
]
}
]
},
"customWaFlowMessage": {
"header": {
"text": "text",
"attachment": {
"type": "ATTACHMENT_TYPE_UNSPECIFIED",
"asset": {
"id": "text",
"url": "text",
"caption": "text",
"filename": "text"
}
}
},
"footer": {
"text": "text"
},
"parameters": {
"flowMessageVersion": "text",
"flowToken": "text",
"flowName": "text",
"flowId": "text",
"flowCta": "text",
"flowAction": "FLOW_ACTION_UNSPECIFIED",
"flowActionPayload": {
"screen": "text",
"data": {}
}
}
},
"callToActionMessage": {
"header": {
"text": "text",
"attachment": {
"type": "ATTACHMENT_TYPE_UNSPECIFIED",
"asset": {
"id": "text",
"url": "text",
"caption": "text",
"filename": "text"
}
}
},
"footer": {
"text": "text"
},
"actionButton": {
"text": "text",
"url": "text"
}
},
"blipBotSwitchMessage": {
"botId": "text",
"switchContext": "text"
},
"blipTicketActionMessage": {
"ticketId": "text",
"status": "text",
"agentId": "text"
},
"locationRequestMessage": {},
"blipCommandMessage": {
"type": "text",
"method": "text",
"to": "text",
"uri": "text",
"resource": null
}
},
"bodyText": "text"
},
"resolutionSurveyEvent": {
"v1": {
"intent": "text"
}
},
"storeHandoverEvent": {
"storeId": "text"
},
"blipHandoverEvent": {
"botId": "text",
"switchContext": "text"
},
"blipCommandEvent": {
"type": "text",
"method": "text",
"to": "text",
"uri": "text",
"resource": null
},
"sessionCloseEvent": {},
"eventId": "text"
}
]
}
}
Last updated