rest-api-client, which reduces the work of consuming the API. It is written in modern JavaScript and ships TypeScript definitions.
Cross-origin resource sharing (CORS)
The API fully supports CORS in accordance with the W3C specification. All responses include a wildcardAccess-Control-Allow-Origin header, enabling cross-domain browser requests.
Authentication
Cognigy supports the following authentication methods:API key
API key
For Cognigy installations, use an API key in the request path or HTTP headers. Keep it secure and revoke it if exposed.
BasicAuth
BasicAuth
Use a username and password for API requests related to the Management UI.
Error handling
The API uses standard HTTP status codes (400 and higher) to indicate errors. Error responses follow RFC 7807 and include a traceId that you can provide to Cognigy technical support for troubleshooting.API server
Cognigy API:- Core Resources:
https://api-trial.cognigy.ai/new/ - Simulator:
https://api-trial.cognigy.ai/testing/ - Logs:
https://api-trial.cognigy.ai/logs/
API scope
The Cognigy API is split into independently versioned services:
All services share the same authentication methods and error-handling conventions described above.
API base URL
The API Base URL is the endpoint for accessing the Cognigy OpenAPI. The table outlines the base URLs for different environments.Manage API keys
An API key is used to authenticate to the Cognigy API as a user in the system without exposing the user’s credentials. To generate an API key, read Create API Keys. To delete an API key, read Revoke API Keys.How to use the API
Cognigy API includes an OpenAPI documentation that outlines all the different API operations in detail. For example, for the Cognigy trial environment, accesshttps://api-trial.cognigy.ai/openapi, and for a NiCE CXone environment, access https://cognigy-api-<region>.nicecxone.com/openapi, such as https://cognigy-api-na1.nicecxone.com/openapi.
To call the API, send an HTTP request including one of the following:
- A query parameter
api_keywith your API key set as a value. - A header
X-API-Keywith your API key set as a value.
https://api-<cognigy-domain>.ai and your API key is <api-key>, you can open a browser tab and go to https://api-<cognigy-domain>.ai/projects?api_key=<api-key> to get a list of all the Projects assigned to you, including metadata about the resources within each Project.
This call is used by the frontend when you load the Main page.
Super API-key
Most of the APIs in Cognigy are agent-bound, meaning that a developer using our API can only request information from Projects they have access to. There are certain use-cases where, for example, all Flows within a certain Organization should be listed. For such use-cases, we have introduced a feature called the “Super API-Key” with our 4.1.4 release.Feature availability
Feature availability
This feature is only available for on-premises customers with separate Cognigy installations.This feature is, by default, disabled in all Cognigy installations. Our on-premises customers can activate this feature by setting the following environment variable to “true”:This API-key is not bound to a specific user and lives within the scope of an Organization. It can be used to manipulate all assets and objects within the system.
Super API-key and TTL
Super API-key and TTL
This API-key has a default TTL (Time to Live) of 15 minutes for security reasons. Once the key has been created, it will only be valid for 15 minutes.