
Prerequisites
- Set up a REST client, for example, Postman, Insomnia, a custom application, or any tool capable of sending HTTP requests.
Generic Endpoint Settings
Learn about the generic Endpoint settings on the following pages:- Endpoints Overview
- NLU Connectors
- Data Protection & Analytics
- Transformer Functions
- Real-Time Translation Settings
How to Set Up
Setup on the Cognigy.AI Side
1. Create a REST Endpoint
1. Create a REST Endpoint
- In the left-side menu of your Project, click Deploy > Endpoints.
- On the Endpoints page, click + New Endpoint.
- In the New Endpoint section, do the following:
- Select the REST Endpoint type.
- Specify a unique name.
- Select a Flow from the list. Save changes.
- Go to the Configuration Information section and copy the URL from the Endpoint URL field. Save changes.
Setup on the Third-Party Provider Side
1. Send a Request
1. Send a Request
Send a
POST request to the Endpoint URL.- cURL
- Postman
- Next.js
- Python
Replace
https://<your-endpoint-url> with the Endpoint URL from your Endpoint’s settings.2. Get a Response
2. Get a Response
The response contains the output text, output data, and the outputStack, which is an array of all Flow outputs. The REST Endpoint can concatenate AI Agent outputs into a single
text or data output, for example, when Say Nodes are placed sequentially in the Flow. You can use the outputStack for debugging purposes.| Parameter | Type | Description |
|---|---|---|
| userId | String | The ID of the end user. |
| sessionId | String | The ID used to track the current session and to maintain its state. Generate a new unique ID for each new session. For testing, you can use any string and change it whenever you want to start a new session. |
| text | String | The text the assigned Flow should process. |
| data | Object | The data the assigned Flow should process. |
| outputStack | Array | An array of outputs generated by the Flow, each with detailed metadata. |
| outputStack.text | String | The text of the output. |
| outputStack.data | Object | The data of the output. |
| outputStack.traceId | String | The ID used for tracing and debugging purposes. |
| outputStack.disableSensitiveLogging | Boolean | The flag indicating if logging is disabled. If the value is true, this interaction won’t be logged for privacy or compliance reasons. |
| outputStack.source | String | The message source. Always "bot" for AI Agent replies. |
1: You must provide at least one of
text or data. You can send either, or both. If both are missing or invalid, the REST Endpoint throws an error.