Invoke (sync)

Same as Invoke, except the response is "sync" (without streaming) in JSON format.

A non-streaming version of ExternalInvokeAgentGraphV1

post

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
businessIdstringOptional
clientKeystringOptional
sessionIdstringOptional
Responses
200
A successful 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: 212

{
  "businessId": "text",
  "clientKey": "text",
  "sessionId": "text",
  "inputEvents": [
    {
      "message_event": {
        "role": "USER",
        "content": {
          "text_content": {
            "text": "I want to buy my wife something festive for our christmas party?"
          }
        }
      }
    }
  ]
}
{
  "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-05T16:15:21.092Z",
          "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