# Invoke (stream)

See [parsing-ndjson-stream](https://docs.connectly.ai/parsing-ndjson-stream "mention") for an example on how to parse the response stream.

## POST /external/v1/ai/agent\_graph/invoke

>

```json
{"openapi":"3.1.1","info":{"title":"AI Service","version":"1.0"},"tags":[{"name":"AIService"}],"servers":[{"url":"https://api.connectly.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Include x-api-key in the header.","name":"x-api-key","in":"header"}},"schemas":{"aiv1ExternalInvokeAgentGraphV1Response":{"type":"object","properties":{"response":{"$ref":"#/components/schemas/aidtoExternalInvokeAgentGraphV1Response"}}},"aidtoExternalInvokeAgentGraphV1Response":{"type":"object","properties":{"sessionId":{"type":"string"},"responseEvents":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/sales_assistant_v2ResponseEvent"}}}},"sales_assistant_v2ResponseEvent":{"type":"object","properties":{"messageEvent":{"$ref":"#/components/schemas/aisales_assistant_v2MessageEvent","title":"Messages"},"recommendationEvent":{"$ref":"#/components/schemas/sales_assistant_v2RecommendationEvent","title":"Product Recommendations - Not applicable to bots without a registered product catalog"},"chatSuggestionEvent":{"$ref":"#/components/schemas/sales_assistant_v2ChatSuggestionEvent","title":"Chat Suggestion Questions"},"agentHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2AgentHandoverEvent","title":"Agent Handover Trace"},"storefrontHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2StorefrontHandoverEvent","title":"Storefront Handover"},"orderStatusHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2OrderStatusHandoverEvent"},"locationQueryHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2LocationQueryHandoverEvent"},"onelivDoctorHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2OnelivDoctorHandoverEvent"},"leadgenHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2LeadgenHandoverEvent"},"connectlyInteractiveEvent":{"$ref":"#/components/schemas/sales_assistant_v2ConnectlyInteractiveEvent","description":"Special WA event wrapper - list messages, button replies, etc."},"resolutionSurveyEvent":{"$ref":"#/components/schemas/sales_assistant_v2ResolutionSurveyEvent","title":"Resolution survey event to collect feedback on specific intents"},"storeHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2StoreHandoverEvent","title":"Special use for store handover messages"},"blipHandoverEvent":{"$ref":"#/components/schemas/sales_assistant_v2BlipHandoverEvent","title":"Blip bot handover"},"blipCommandEvent":{"$ref":"#/components/schemas/sales_assistant_v2BlipCommandEvent","title":"Blip command event"},"sessionCloseEvent":{"$ref":"#/components/schemas/sales_assistant_v2SessionCloseEvent","title":"Connectly API: Signal Connectly API session close"},"callbackMessageTimeoutEvent":{"$ref":"#/components/schemas/sales_assistant_v2CallbackMessageTimeoutEvent"},"eventId":{"type":"string"}}},"aisales_assistant_v2MessageEvent":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/MessageEventMessageEventRole","title":"Role should be either \"USER\" or \"ASSISTANT\""},"content":{"$ref":"#/components/schemas/sales_assistant_v2Content","title":"The content of the message"},"createdAt":{"type":"string","format":"date-time","description":"These are set automatically by the system. Do not include them in the request."},"metadata":{"type":"object"}}},"MessageEventMessageEventRole":{"type":"string","enum":["MESSAGE_EVENT_ROLE_UNSPECIFIED","USER","ASSISTANT"],"default":"MESSAGE_EVENT_ROLE_UNSPECIFIED"},"sales_assistant_v2Content":{"type":"object","properties":{"textContent":{"$ref":"#/components/schemas/aisales_assistant_v2TextContent","title":"Use for text based messages"},"audioContent":{"$ref":"#/components/schemas/aisales_assistant_v2AudioContent","title":"Use for audio based messages"},"imageContent":{"$ref":"#/components/schemas/aisales_assistant_v2ImageContent","title":"Use for image based messages"},"locationContent":{"$ref":"#/components/schemas/sales_assistant_v2LocationContent","title":"Use for location based messages"}}},"aisales_assistant_v2TextContent":{"type":"object","properties":{"text":{"type":"string","title":"The message text"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/text-messages"},"aisales_assistant_v2AudioContent":{"type":"object","properties":{"url":{"type":"string","title":"URL of the audio file\nMust be of type: mp3, wav, and ogg"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/audio-messages"},"aisales_assistant_v2ImageContent":{"type":"object","properties":{"url":{"type":"string","title":"URL of the image file\nMust be of type: jpeg, png"},"caption":{"type":"string","title":"Optional string caption"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/image-messages"},"sales_assistant_v2LocationContent":{"type":"object","properties":{"latitude":{"type":"number","format":"float","title":"Latitude of the location"},"longitude":{"type":"number","format":"float","title":"Longitude of the location"},"name":{"type":"string","title":"Name of the location"},"address":{"type":"string","title":"Address of the location"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/location-messages"},"sales_assistant_v2RecommendationEvent":{"type":"object","properties":{"products":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/sales_assistant_v2SalesAssistantV2Product"},"title":"The list of recommended products"}}},"sales_assistant_v2SalesAssistantV2Product":{"type":"object","properties":{"productId":{"type":"string","title":"Connectly Product ID"},"title":{"type":"string","title":"The Product's title"},"description":{"type":"string","title":"The Product's description"},"url":{"type":"string","title":"The Product's URL"},"imageUrl":{"type":"string","title":"The Product image URL to display to the customer"},"price":{"type":"number","format":"float","title":"The Product's price"},"currency":{"type":"string","title":"The Product's currency"},"facets":{"type":"object","title":"Other product facets contained in a struct\nFor example: { \"color\": \"red\", \"size\": \"large\"}"},"metadata":{"type":"object","title":"Additional metadata fields for internal use only"}},"title":"Represents a Product returned by the Sales Assistant V2"},"sales_assistant_v2ChatSuggestionEvent":{"type":"object","properties":{"suggestedQuestions":{"type":"array","items":{"type":"string"},"title":"The list of suggested questions"}}},"sales_assistant_v2AgentHandoverEvent":{"type":"object","properties":{"triggerHandover":{"type":"boolean","title":"Flag for whether to trigger agent handover"},"reason":{"type":"string","title":"Reason for triggering agent handover"},"reasonNative":{"type":"string","title":"Reason in Native Language"}}},"sales_assistant_v2StorefrontHandoverEvent":{"type":"object","properties":{"triggerHandover":{"type":"boolean","title":"Flag for whether to trigger store front handover"},"initialSearchPhrase":{"type":"string","title":"The phrase to search to prefill Storefront. Can be empty if the customer\nhas not indicated which products they are interested in (i.e.) I want to browse"}}},"sales_assistant_v2OrderStatusHandoverEvent":{"type":"object","properties":{"triggerHandover":{"type":"boolean"}}},"sales_assistant_v2LocationQueryHandoverEvent":{"type":"object","properties":{"triggerHandover":{"type":"boolean"}}},"sales_assistant_v2OnelivDoctorHandoverEvent":{"type":"object","properties":{"triggerHandover":{"type":"boolean","title":"Flag for whether to trigger oneliv doctor handover"},"doctorSpecialty":{"type":"string","title":"The doctor specialty the customer is looking for"},"doctorName":{"type":"string","title":"The specific doctor name the customer is looking for, if any"},"requirements":{"type":"string","title":"Any additional requirements or preferences specified by the customer"}}},"sales_assistant_v2LeadgenHandoverEvent":{"type":"object","properties":{"triggerHandover":{"type":"boolean"}}},"sales_assistant_v2ConnectlyInteractiveEvent":{"type":"object","properties":{"interactive":{"$ref":"#/components/schemas/connectlyInteractive","description":"Support list messages, WA flows, button replies, etc."},"bodyText":{"type":"string"}}},"connectlyInteractive":{"type":"object","properties":{"listMessage":{"$ref":"#/components/schemas/connectlyListMessage"},"replyButtonMessage":{"$ref":"#/components/schemas/connectlyReplyButtonMessage"},"singleProductMessage":{"$ref":"#/components/schemas/connectlySingleProductMessage"},"multiProductMessage":{"$ref":"#/components/schemas/connectlyMultiProductMessage"},"customWaFlowMessage":{"$ref":"#/components/schemas/connectlyCustomWAFlowMessage"},"callToActionMessage":{"$ref":"#/components/schemas/connectlyCallToActionMessage"},"blipBotSwitchMessage":{"$ref":"#/components/schemas/connectlyBlipBotSwitchMessage"},"blipTicketActionMessage":{"$ref":"#/components/schemas/connectlyBlipTicketActionMessage"},"locationRequestMessage":{"$ref":"#/components/schemas/connectlyLocationRequestMessage"},"blipCommandMessage":{"$ref":"#/components/schemas/connectlyBlipCommandMessage"},"customWaCommerceMessage":{"$ref":"#/components/schemas/connectlyCustomWACommerceMessage"}}},"connectlyListMessage":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/connectlyMessageHeader"},"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"button":{"$ref":"#/components/schemas/connectlyMessageButton"},"sections":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/eventconnectlyListSection"}},"buttonText":{"type":"string"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-list-messages"},"connectlyMessageHeader":{"type":"object","properties":{"text":{"type":"string"},"attachment":{"$ref":"#/components/schemas/connectlyAttachment"}}},"connectlyAttachment":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/connectlyAttachmentType"},"asset":{"$ref":"#/components/schemas/connectlyAssetAttachment"}}},"connectlyAttachmentType":{"type":"string","enum":["ATTACHMENT_TYPE_UNSPECIFIED","ATTACHMENT_TYPE_IMAGE","ATTACHMENT_TYPE_VIDEO","ATTACHMENT_TYPE_AUDIO","ATTACHMENT_TYPE_FILE"],"default":"ATTACHMENT_TYPE_UNSPECIFIED"},"connectlyAssetAttachment":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"caption":{"type":"string"},"filename":{"type":"string"}}},"connectlyMessageFooter":{"type":"object","properties":{"text":{"type":"string"}}},"connectlyMessageButton":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}}},"eventconnectlyListSection":{"type":"object","properties":{"title":{"type":"string"},"rows":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/eventconnectlyListRow"}}}},"eventconnectlyListRow":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"description":{"type":"string"}}},"connectlyReplyButtonMessage":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/connectlyMessageHeader"},"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"buttons":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/connectlyMessageButton"}}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-reply-buttons-messages"},"connectlySingleProductMessage":{"type":"object","properties":{"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"actionButton":{"$ref":"#/components/schemas/connectlyMessageButton","description":"Only action_button.text is supported (id is ignored)."},"buttons":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/connectlyMessageButton"}},"catalogId":{"type":"string"},"productItem":{"$ref":"#/components/schemas/connectlyProductItem"}}},"connectlyProductItem":{"type":"object","properties":{"productRetailerId":{"type":"string"}}},"connectlyMultiProductMessage":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/connectlyMessageHeader"},"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"actionButton":{"$ref":"#/components/schemas/connectlyMessageButton","description":"Only action_button.text is supported (id is ignored)."},"buttons":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/connectlyMessageButton"}},"catalogId":{"type":"string"},"sections":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/connectlyProductSection"}}}},"connectlyProductSection":{"type":"object","properties":{"title":{"type":"string"},"productItems":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/connectlyProductItem"}}}},"connectlyCustomWAFlowMessage":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/connectlyMessageHeader"},"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"parameters":{"$ref":"#/components/schemas/CustomWAFlowMessageFlowParameters"}}},"CustomWAFlowMessageFlowParameters":{"type":"object","properties":{"flowMessageVersion":{"type":"string"},"flowToken":{"type":"string"},"flowName":{"type":"string"},"flowId":{"type":"string"},"flowCta":{"type":"string"},"flowAction":{"$ref":"#/components/schemas/CustomWAFlowMessageFlowAction"},"flowActionPayload":{"$ref":"#/components/schemas/connectlyCustomWAFlowMessageFlowActionPayload"}}},"CustomWAFlowMessageFlowAction":{"type":"string","enum":["FLOW_ACTION_UNSPECIFIED","FLOW_ACTION_NAVIGATE","FLOW_ACTION_DATA_EXCHANGE"],"default":"FLOW_ACTION_UNSPECIFIED"},"connectlyCustomWAFlowMessageFlowActionPayload":{"type":"object","properties":{"screen":{"type":"string"},"data":{"type":"object"}}},"connectlyCallToActionMessage":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/connectlyMessageHeader"},"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"actionButton":{"$ref":"#/components/schemas/connectlyMessageURLButton"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-cta-url-messages"},"connectlyMessageURLButton":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}},"connectlyBlipBotSwitchMessage":{"type":"object","properties":{"botId":{"type":"string"},"switchContext":{"type":"string","title":"this kind information need to look up session history, so we need new action"}}},"connectlyBlipTicketActionMessage":{"type":"object","properties":{"ticketId":{"type":"string","title":"channel know which channel, don't need to set blip information here"},"status":{"type":"string","title":"open or close"},"agentId":{"type":"string","description":"open ticket should be in a workflow  open?\nbecause blip customer's webhook event must based on the opened ticket.\n\nwhen open, assign to who"}}},"connectlyLocationRequestMessage":{"type":"object","title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages/location-request-messages"},"connectlyBlipCommandMessage":{"type":"object","properties":{"type":{"type":"string"},"method":{"type":"string"},"to":{"type":"string"},"uri":{"type":"string"},"resource":{}},"title":"Mostly the same as idl/events/blip/models.proto but id is from message ID"},"connectlyCustomWACommerceMessage":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/connectlyMessageHeader"},"footer":{"$ref":"#/components/schemas/connectlyMessageFooter"},"parameters":{"$ref":"#/components/schemas/CustomWACommerceMessageCommerceParameters"}}},"CustomWACommerceMessageCommerceParameters":{"type":"object","properties":{"referenceId":{"type":"string"},"type":{"type":"string","title":"e.g., \"digital-goods\""},"paymentType":{"type":"string"},"currency":{"type":"string"},"totalAmount":{"$ref":"#/components/schemas/whatsappWhatsAppOrderAmount"},"paymentSettings":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/whatsappPaymentSetting"}},"order":{"$ref":"#/components/schemas/whatsappOrder"},"action":{"$ref":"#/components/schemas/CustomWACommerceMessageCommerceAction"}}},"whatsappWhatsAppOrderAmount":{"type":"object","properties":{"value":{"type":"string","format":"int64"},"offset":{"type":"string","format":"int64"},"description":{"type":"string"}}},"whatsappPaymentSetting":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/whatsappPaymentType"},"pixDynamicCode":{"$ref":"#/components/schemas/whatsappPixDynamicCode"},"paymentLink":{"$ref":"#/components/schemas/whatsappPaymentLink"}}},"whatsappPaymentType":{"type":"string","enum":["payment_type_unspecified","payment_type_pix","payment_type_payment_link"],"default":"payment_type_unspecified"},"whatsappPixDynamicCode":{"type":"object","properties":{"code":{"type":"string"},"merchantName":{"type":"string"},"key":{"type":"string"},"keyType":{"type":"string"}}},"whatsappPaymentLink":{"type":"object","properties":{"uri":{"type":"string"}}},"whatsappOrder":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/whatsappWhatsAppOrderStatus"},"tax":{"$ref":"#/components/schemas/whatsappWhatsAppOrderAmount"},"items":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/whatsappWhatsAppOrderItem"}},"subtotal":{"$ref":"#/components/schemas/whatsappWhatsAppOrderAmount"}}},"whatsappWhatsAppOrderStatus":{"type":"string","enum":["order_status_unspecified","order_status_pending","order_status_shipped","order_status_partially_shipped","order_status_partially_processing","order_status_completed","order_status_cancelled"],"default":"order_status_unspecified"},"whatsappWhatsAppOrderItem":{"type":"object","properties":{"name":{"type":"string"},"retailerId":{"type":"string"},"amount":{"$ref":"#/components/schemas/whatsappWhatsAppOrderAmount"},"quantity":{"type":"string","format":"int64"}}},"CustomWACommerceMessageCommerceAction":{"type":"string","enum":["COMMERCE_ACTION_UNSPECIFIED","COMMERCE_ACTION_REVIEW_AND_PAY"],"default":"COMMERCE_ACTION_UNSPECIFIED"},"sales_assistant_v2ResolutionSurveyEvent":{"type":"object","properties":{"v1":{"$ref":"#/components/schemas/sales_assistant_v2ResolutionSurveyEventV1"}},"title":"Resolution survey event to collect feedback on specific intents"},"sales_assistant_v2ResolutionSurveyEventV1":{"type":"object","properties":{"intent":{"type":"string","title":"The intent that was handled"}},"title":"Resolution survey event V1 contains the handled intent"},"sales_assistant_v2StoreHandoverEvent":{"type":"object","properties":{"storeId":{"type":"string"}}},"sales_assistant_v2BlipHandoverEvent":{"type":"object","properties":{"botId":{"type":"string"},"switchContext":{"type":"string"}},"title":"Blip bot switch message, see idl/models/event/connectly/models.proto"},"sales_assistant_v2BlipCommandEvent":{"type":"object","properties":{"type":{"type":"string"},"method":{"type":"string"},"to":{"type":"string"},"uri":{"type":"string"},"resource":{}},"title":"Allows sales assistant to send arbitrary Blip commands (resource config varies per business)"},"sales_assistant_v2SessionCloseEvent":{"type":"object","title":"Connectly API: Signal Connectly API session close"},"sales_assistant_v2CallbackMessageTimeoutEvent":{"type":"object","properties":{"timeoutSeconds":{"type":"integer","format":"int32"},"callbackMessage":{"type":"string"}},"title":"When sent to the agent graph action, triggers a timed callback message triggered if the user does not respond"},"googlerpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/protobufAny"}}}},"protobufAny":{"type":"object","properties":{"@type":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."}},"additionalProperties":{},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n    // or ...\n    if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n      foo = any.unpack(Foo.getDefaultInstance());\n    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in Go\n\n     foo := &pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := &pb.Foo{}\n     if err := any.UnmarshalTo(foo); err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"},"dtoExternalInvokeAgentGraphV1Input":{"type":"object","properties":{"businessId":{"type":"string"},"clientKey":{"type":"string"},"sessionId":{"type":"string"},"agentId":{"type":"string"},"inputEvents":{"type":"array","items":{"type":"object","$ref":"#/components/schemas/sales_assistant_v2InputEvent"},"description":"The input events to pass to the customer.\nIt is important to include all input events since the last call. For example: if there is an automated welcome message, it should be included as an assistant message."}},"title":"ExternalInvokeAgentGraphV1Input","required":["businessId","clientKey","sessionId","inputEvents"]},"sales_assistant_v2InputEvent":{"type":"object","properties":{"messageEvent":{"$ref":"#/components/schemas/aisales_assistant_v2MessageEvent","title":"Message"},"buttonResponseEvent":{"$ref":"#/components/schemas/sales_assistant_v2ButtonResponseEvent"},"filledFormResponseEvent":{"$ref":"#/components/schemas/sales_assistant_v2FilledFormResponseEvent"},"storeEvent":{"$ref":"#/components/schemas/sales_assistant_v2StoreEvent","title":"Connectly API: For business to share store-specific information for a given user"},"listReplyEvent":{"$ref":"#/components/schemas/sales_assistant_v2ListReplyEvent"},"agentMessageTimeoutEvent":{"$ref":"#/components/schemas/sales_assistant_v2CallbackMessageTimeoutEvent","title":"Agent Message Timeout"},"parentEventId":{"type":"string"},"metadata":{"type":"object"}}},"sales_assistant_v2ButtonResponseEvent":{"type":"object","properties":{"text":{"type":"string"},"payload":{"type":"string"},"id":{"type":"string"},"title":{"type":"string"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-reply-buttons-messages"},"sales_assistant_v2FilledFormResponseEvent":{"type":"object","properties":{"formData":{"type":"object"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-flow-messages"},"sales_assistant_v2StoreEvent":{"type":"object","properties":{"storeId":{"type":"string","title":"ID of the store"},"name":{"type":"string","title":"Name of the store"},"cpName":{"type":"string","title":"Collection point name of store"},"city":{"type":"string","title":"City of store"},"state":{"type":"string","title":"State of store"}}},"sales_assistant_v2ListReplyEvent":{"type":"object","properties":{"id":{"type":"string","title":"ID of the selected list item"},"title":{"type":"string","title":"Title/display text of the selected list item"},"description":{"type":"string","title":"Description of the selected list item"}},"title":"WhatsApp API Docs: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-list-messages"}}},"paths":{"/external/v1/ai/agent_graph/invoke":{"post":{"operationId":"AIService_ExternalInvokeAgentGraphV1","responses":{"200":{"description":"A successful response.(streaming responses)","headers":{"X-Accel-Buffering":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/aiv1ExternalInvokeAgentGraphV1Response"},"error":{"$ref":"#/components/schemas/googlerpcStatus"}},"title":"Stream result of aiv1ExternalInvokeAgentGraphV1Response"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/googlerpcStatus"}}}}},"tags":["AIService"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dtoExternalInvokeAgentGraphV1Input"}}},"required":true}}}}}
```
