
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
Specific Endpoint Settings
API Key Authentication
API Key Authentication
Use this section to configure how incoming requests to this Endpoint are authenticated.
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, go to Deploy > Endpoints and 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.
- (Optional) To set up Endpoint-specific API authentication, select API Key from the Authentication Method list in the API Key Authentication section. The Endpoint API Keys section appears. Follow these steps:
- Click + Generate API Key.
- In the dialog box, enter a unique name for your API key in the Key name field and click Generate API Key.
- Click the Key field to copy the generated API key for later use in the
x-rest-endpoint-keyheader of requests to the Endpoint URL. Save the API key because you can’t retrieve it after closing the dialog. Alternatively, you can create and manage API keys for this Endpoint using the/v2.0/endpoints/{endpointId}/apikeysroutes via Cognigy API.
- Save changes and go to the Configuration Information section. Copy the URL from the Endpoint URL field.
Setup on the Third-Party Provider Side
1. Send a Request
1. Send a Request
Send a
POST request to the Endpoint URL.No Authentication
No Authentication
- cURL
- Postman
- Next.js
- Python
Replace
https://<your-endpoint-url> with the Endpoint URL from the Endpoint settings.With API Key Authentication
With API Key Authentication
- cURL
- Postman
- Next.js
- Python
Replace
https://<your-endpoint-url> with the Endpoint URL and <your-rest-endpoint-api-key> with an active API key from your Endpoint 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 you place Say Nodes sequentially in the Flow. You can use the outputStack for debugging purposes.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.