Cognigy

What is COGNIGY.AI

COGNIGY.AI is the Conversational AI Platform focused on the needs of large enterprises to develop, deploy and run Conversational AI’s on any conversational channel.

Given the arising need of voice interfaces as the most natural way of communicating with brands, Cognigy was founded in 2016 by Sascha Poggemann and Phil Heltewig. Our mission: to enable all devices and applications to intelligently communicate with their users via naturally spoken or written dialogue.

Get Started
Suggest Edits

Getting started with the Cognigy API

 

The Cognigy API is RESTful. Our API has predictable, resource-oriented URLs. We use HTTP response codes to indicate API errors. You authenticate with our API via API Key in your path or HTTP header. Please never expose your API key and keep it safe and secure. With cross-origin resource sharing supported you can interact securely with our API from a client-side web application. JSON is returned by all API responses, including errors.

 
Suggest Edits

Authentication

 

You authenticate with your Cognigy user profile by including your secret key in API requests.

You may either include it

  1. As a path parameter in your URL
    GET /something?api_key=abcdef12345

  2. In your request header
    GET /something HTTP/1.1
    X-API-Key: abcdef12345

You can manage API keys and privileges in the Access control panel.

Keep API Keys safe and secure

API Keys are like your password. Please never expose your API keys. Follow best practices and never commit them to your git repository, for example.

All API requests must be sent encrypted over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

 

Conventional HTTP status codes indicate the success or failure of an API request.

2xx

Codes in the 2xx range indicate success.

4xx

Codes in the 4xx range indicate an error given the provided request data. 400 Errors indicate bad requests because of a syntax error, for example. 401 Errors indicate Authentication failures. 404 Errors mean the requested resource could not be found, e.g. a requested object does not exist.

5xx

Codes in the 5xx range indicate an internal error on the Cognigy server.

 
Suggest Edits

Lexicons & Keyphrases

 

Lexicon, Keyphrase, Tag and Synonym objects allow you to create and edit Lexicons & Keyphrases . You can import an entire Lexicon or create and modify its Keyphrases with associated Slot Tags and Synonyms using the API.

 
Suggest Edits

Get all Lexicons

Get all Lexicon resources metadata in a project.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/projects/projectId/lexicons

Path Params

projectId
string
required

Project ID

 
curl --request GET \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/projects/projectId/lexicons");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id": "5b0da5d9c00402000fb4726b",
    "name": "English Lexicon",
    "type": "lexicon",
    "createdAt": 1527621049,
    "lastChanged": 1528204971,
    "createdBy": "user@example.com",
    "lastChangedBy": "user@example.com"
  },
  {
    "_id": "5b16915d61e0a4000f177a35",
    "name": "My New Lexicon",
    "type": "lexicon",
    "createdAt": 1528205661,
    "lastChanged": 1528209331,
    "createdBy": "user@example.com",
    "lastChangedBy": "user@example.com"
  }
]
 
Suggest Edits

Create a new Lexicon

create a new Lexicon resource in a project.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects/projectId/lexicons

Path Params

projectId
string
required

Project ID

Body Params

Example body: {"name":"New Lexicon"}

name
string
required
 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons
var request = require("request");

var options = { method: 'POST',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects/projectId/lexicons");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Get a Lexicon

Get a single Lexicon resource in a project.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

 
curl --request GET \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "_id": "5b0da2feeb345a000f51dfa3",
  "name": "Establishments",
  "language": "en-EN",
  "tag": "user",
  "values": [
    {
      "keyphrase": "Restaurants",
      "_id": "5a9d9a7d82992c000a6b34c8",
      "synonyms": [
        "Food service"
      ],
      "tags": [
        "Consumer Services",
        "Product"
      ]
    },
    {
      "keyphrase": "Bars",
      "_id": "5a9d9a7d82992c000a6b34c9",
      "synonyms": [
        "Pub"
      ],
      "tags": [
        "Consumer Services",
        "Product"
      ]
    }
  ],
  "createdAt": 1527620350,
  "lastChanged": 1527620350,
  "createdBy": "user@example.com",
  "lastChangedBy": "user@example.com",
  "__v": 1
}
 
Suggest Edits

Update a Lexicon

Update a Lexicon resource in a project. Currently you can only rename a Lexicon.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

Body Params

Example body: {"name":"New Lexicon"}

name
string
required
 
curl --request PUT \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Delete a Lexicon

Delete a Lexicon resource in a project.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Import a Lexicon

Import a Lexicon resource. Currently you can import csv formatted data.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/import

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

Body Params

Example body: {"type":"csv","data":"New Keyphrase,\"Tag #1,Tag #2\",\"Synonym #1,Synonym #2\"\n"}

type
string
required

The format type

data
string
required

Stringified CSV. A line is comma-separated with fields keyphrase|tags|synonyms. Quotes in the csv are escaped with backslash: \". Lines are separated with newline \n delimiter.

 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/import
var request = require("request");

var options = { method: 'POST',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/import' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/import")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/import");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/import"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Export a Lexicon

Export a Lexicon resource. Currently you can export only csv formatted data.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/export

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

Query Params

type
string
 
curl --request GET \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/export
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/export' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/export");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/export"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Create a Keyphrase

Create a new Keyphrase

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

Body Params

Example body: {"name": "New Keyphrase"}

name
string
required

The new Keyphrase literal

 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases
var request = require("request");

var options = { method: 'POST',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Delete Keyphrases

Delete all or several Keyphrases in a single batch operation.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

Query Params

names
string

If not provided all Keyphrases will be deleted. Provide a string of comma delimited Keyphrases to delete: New2 Keyphrase,New Keyphrase

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Update a Keyphrase

Update an existing Keyphrase. You may only rename an existing Keyphrase.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

Body Params

Example body: {"name": "Renamed Keyphrase"}

name
string
required

The new Keyphrase literal

 
curl --request PUT \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Delete a Keyphrase

Delete a single Keyphrase.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Update Keyphrase Data

Update a Keyphrase's data object.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/data

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

Body Params

Example body: {"data": { "keys": "values" } }

data
 
curl --request PUT \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/data
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/data' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/data")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/data");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/data"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Create a Slot Tag

A Slot Tag object defines the Slot Tag of a Keyphrase in a Lexicon. It is currently a simple object defined by its name.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

Body Params

name
string
required
 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags
var request = require("request");

var options = { method: 'POST',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "name": "My New Tag"
}
 
Suggest Edits

Delete a Slot Tag

A Slot Tag object defines the Slot Tag of a Keyphrase in a Lexicon. It is currently a simple object defined by its name.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags/tag

Path Params

tag
string
required

The literal Slot Tag to delete

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags/tag
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags/tag' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags/tag")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags/tag");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/tags/tag"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Create a Synonym

Create a Synonym for a Keyphrase.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms

Path Params

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

Body Params

name
string
 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms
var request = require("request");

var options = { method: 'POST',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "name": "My New Synonym"
}
 
Suggest Edits

Delete Synonym

Delete a Synonym belonging to a Keyphrase.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms/synonym

Path Params

synonym
string
required

Literal Synonym to delete.

projectId
string
required

Project ID

lexiconId
string
required

Lexicon ID

keyphrase
string
required

The literal keyphrase

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms/synonym
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms/synonym' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms/synonym")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms/synonym");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/lexicons/lexiconId/keyphrases/keyphrase/synonyms/synonym"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
 

Project objects allow you to create and edit Projects. It encompasses Project settings and configurations as well as all resources attached to the Project.

 
Suggest Edits

Get Projects

Get available Projects.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/projects
 
curl --request GET \
  --url https://api-demo.cognigy.ai/projects
var request = require("request");

var options = { method: 'GET', url: 'https://api-demo.cognigy.ai/projects' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/projects");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id": "5af59e546ded9400179810ca",
    "name": "Sample Project",
    "color": "green",
    "settingsId": "5af59e545f389b0017a636df",
    "organisation": "5a54e9d01118bdf3a1962100",
    "resources": [
      {
        "_id": "5af59e731245240011b02216",
        "name": "My Flow",
        "type": "flow",
        "parentId": "6e9b229c7a964060589785598b77550880bb90d0d029805cb4b068d211bb9b029710e35a473930ba8a0016659d48ff4be91e76cdda55bea4d6e90da8be391a16",
        "createdAt": 1526046323,
        "lastChanged": 1526467985,
        "createdBy": "user@example.com",
        "lastChangedBy": "user@example.com",
        "properties": {
          "language": "en-US"
        }
      },
      {
        "_id": "5af96073213ddf0019f455fd",
        "name": "My Form",
        "type": "form",
        "createdAt": 1526292601,
        "lastChanged": 1526292601,
        "createdBy": "user@example.com",
        "lastChangedBy": "user@example.com"
      }
    ],
    "createdAt": 1526046292,
    "lastChanged": 1526467985,
    "createdBy": "user@example.com",
    "lastChangedBy": "user@example.com",
    "__v": 0
  }
]
 
Suggest Edits

Create a Project

Create a new Project.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects

Body Params

name
string

The Project name

color
string

The badge color of your Project for easy recognition.

 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects
var request = require("request");

var options = { method: 'POST', url: 'https://api-demo.cognigy.ai/projects' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Get a Project

Get an existing Project configuration object.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/projects/projectId

Path Params

projectId
string
required

Project ID

 
curl --request GET \
  --url https://api-demo.cognigy.ai/projects/projectId
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/projects/projectId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/projects/projectId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "_id": "5af59e546ded9400179810ca",
  "name": "Sample Project",
  "color": "green",
  "settingsId": "5af59e545f389b0017a636df",
  "organisation": "5a54e9d01118bdf3a1962100",
  "resources": [
    {
      "_id": "5af59e731245240011b02216",
      "name": "My Flow",
      "type": "flow",
      "parentId": "6e9b229c7a964060589785598b77550880bb90d0d029805cb4b068d211bb9b029710e35a473930ba8a0016659d48ff4be91e76cdda55bea4d6e90da8be391a16",
      "createdAt": 1526046323,
      "lastChanged": 1526467985,
      "createdBy": "user@example.com",
      "lastChangedBy": "user@example.com",
      "properties": {
        "language": "en-US"
      }
    },
    {
      "_id": "5af96073213ddf0019f455fd",
      "name": "My Form",
      "type": "form",
      "createdAt": 1526292601,
      "lastChanged": 1526292601,
      "createdBy": "user@example.com",
      "lastChangedBy": "user@example.com"
    }
  ],
  "createdAt": 1526046292,
  "lastChanged": 1526467985,
  "createdBy": "user@example.com",
  "lastChangedBy": "user@example.com",
  "__v": 0
}
 
Suggest Edits

Update a Project

Update an existing Project.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/projects/projectId

Path Params

projectId
string
required

Project ID

Body Params

name
string
 
curl --request PUT \
  --url https://api-demo.cognigy.ai/projects/projectId
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api-demo.cognigy.ai/projects/projectId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/projects/projectId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Endpoints

 

Endpoint objects define the configuration of Cognigy Endpoints. All Endpoint types have a number of settings in common such as the flowParentId of the Flow it is attached to, whether the Endpoint is enabled or active and analytics related settings.

You can also learn more about using Endpoints in our How-To Create an Endpoint section.

Looking to interact with an Endpoint?

The Endpoints API is meant for managing Endpoints to, e.g., enable or disable Endpoints.

Go to the Endpoint API documentation to learn about or the Endpoint API.

 
Suggest Edits

Create an Endpoint

Create a new Endpoint.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
posthttps://api-demo.cognigy.ai/projects/projectId/endpoints

Path Params

projectId
string
required

Project ID

Body Params

name
string
properties
 
curl --request POST \
  --url https://api-demo.cognigy.ai/projects/projectId/endpoints
var request = require("request");

var options = { method: 'POST',
  url: 'https://api-demo.cognigy.ai/projects/projectId/endpoints' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/endpoints")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-demo.cognigy.ai/projects/projectId/endpoints");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/endpoints"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Get an Endpoint

Get an Endpoint.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId

Path Params

projectId
string
required

Project ID

endpointId
string
required

Endpoint ID

 
curl --request GET \
  --url https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Update an Endpoint

Update an existing Endpoint.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId

Path Params

projectId
string
required

Project ID

endpointId
string
required

Endpoint ID

Body Params

Example: {"active":true,"flowParentId":"67c...","version":0,"useAnalytics":false,"useContactProfiles": false,"useDashbotAnalytics":true,"chatbaseApikey":"x3f...","dashbotApikey":"6ds5..."}

active
boolean
flowParentId
string
version
int32
useAnalytics
boolean
useContactProfiles
boolean
useDashbotAnalytics
boolean
chatbaseApikey
string
dashbotApikey
string
 
curl --request PUT \
  --url https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Delete an Endpoint

Delete an existing Endpoint.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId

Path Params

projectId
string
required

Project ID

endpointId
string
required

Endpoint ID

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/projects/projectId/endpoints/endpointId"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
 

Contact objects allow you to read and modify Contact Profiles. You can also modify the profile schema here via the API.

 
Suggest Edits

Get a Contact

Get a single Contact object.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/contact/contactId

Path Params

contactId
string
required

Contact ID

 
curl --request GET \
  --url https://api-demo.cognigy.ai/contact/contactId
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/contact/contactId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/contact/contactId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/contact/contactId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/contact/contactId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "contactIds": [
    "5b2cc5a0cb59f944173a2078"
  ],
  "profile": {
    "goals": [],
    "prevent_data_collection": false,
    "accepted_gdpr": false
  }
}
 
Suggest Edits

Update a Contact profile

Update a Contact profile object.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/contact/contactId

Path Params

contactId
string
required

Contact ID

Body Params

Example: {"profile":{"prevent_data_collection":false},"forceReplace":false}

profile
object

Contact profile conforming to defined schema.

 
forceReplace
boolean

Force overwrite of contact data in case of conflicts.

 
curl --request PUT \
  --url https://api-demo.cognigy.ai/contact/contactId
var request = require("request");

var options = { method: 'PUT',
  url: 'https://api-demo.cognigy.ai/contact/contactId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/contact/contactId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/contact/contactId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/contact/contactId"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Deactivate a Contact

Deactivates the Contact.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
deletehttps://api-demo.cognigy.ai/contact/contactId

Path Params

contactId
string
required

Contact ID

 
curl --request DELETE \
  --url https://api-demo.cognigy.ai/contact/contactId
var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api-demo.cognigy.ai/contact/contactId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/contact/contactId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api-demo.cognigy.ai/contact/contactId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/contact/contactId"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Export Contact's data

Export all data stored on the Cognigy platform for a single Contact.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/contact/export/contactId

Path Params

contactId
string
required

Contact ID

 
curl --request GET \
  --url https://api-demo.cognigy.ai/contact/export/contactId
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/contact/export/contactId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/contact/export/contactId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/contact/export/contactId");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/contact/export/contactId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "contactIds": [
    "5b2cc5a0cb59f900173a2078"
  ],
  "profile": {
    "goals": [],
    "prevent_data_collection": false,
    "accepted_gdpr": false
  },
  "conversations": []
}
 
Suggest Edits

Get all Contacts

Get a all Contacts. Select active profiles. Note profiles become inactive through contact mergers, for example, and the concept is distinct from data collection is active or not.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/contacts

Query Params

active
boolean
required

Set to true to query all active Contacts.

 
curl --request GET \
  --url 'https://api-demo.cognigy.ai/contacts?active=active'
var request = require("request");

var options = { method: 'GET',
  url: 'https://api-demo.cognigy.ai/contacts',
  qs: { active: 'active' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/contacts?active=active")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/contacts?active=active");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/contacts"

querystring = {"active":"active"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "_id": "5b2a1693e84ffd3317d94b81",
    "contactIds": [
      "userd4b58775c8@cognigy.com"
    ],
    "organisation": "5b2a11e091b9c331b6f1a28",
    "lastUpdated": "2018-06-22T09:59:16.206Z",
    "active": true,
    "__v": 7,
    "profile": {
      "prevent_data_collection": true,
      "accepted_gdpr": false
    }
  },
  {
    "_id": "5b2cc5a0cb59f900173a2078",
    "contactIds": [
      "d.seisser@cognigy.com"
    ],
    "organisation": "5b2a11e091b9c4001b6f1a28",
    "lastUpdated": "2018-06-22T09:47:12.279Z",
    "active": true,
    "__v": 0,
    "profile": {
      "prevent_data_collection": false,
      "accepted_gdpr": false
    }
  }
]
 
Suggest Edits

Get the Contact profile schema

Get the Contact profile schema definition.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
gethttps://api-demo.cognigy.ai/schema
 
curl --request GET \
  --url https://api-demo.cognigy.ai/schema
var request = require("request");

var options = { method: 'GET', url: 'https://api-demo.cognigy.ai/schema' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/schema")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api-demo.cognigy.ai/schema");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/schema"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "schema": {
    "firstname": "string",
    "lastname": "string",
    "email": "string",
    "gender": "string",
    "age": "number",
    "birthday": "string",
    "location": "string",
    "profilepic": "string",
    "prevent_data_collection": "boolean",
    "accepted_gdpr": "boolean",
    "goals": "object",
    "test": "string"
  },
  "details": [
    {
      "field": "myField",
      "internal": "myfield",
      "type": "string"
    }
  ]
}
 
Suggest Edits

Set the Contact profile schema

Get the Contact profile schema definition.

 

Header Auth

Query Auth

 Authentication is required for this endpoint.
puthttps://api-demo.cognigy.ai/schema

Body Params

Example: {"schema":[{"field":"My Field","internal":"my_field","type":"string"}]}

 
curl --request PUT \
  --url https://api-demo.cognigy.ai/schema
var request = require("request");

var options = { method: 'PUT', url: 'https://api-demo.cognigy.ai/schema' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api-demo.cognigy.ai/schema")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api-demo.cognigy.ai/schema");

xhr.send(data);
import requests

url = "https://api-demo.cognigy.ai/schema"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Getting started with the Endpoint API

 

The Cognigy REST, Webhook and Socket Endpoint APIs are described below.

Before using this API you should learn about the concept of Endpoints first!

Authentication

Currently, Endpoints do not require authentication. You can, of course, implement restrictions within your Flow using the passed userId or data objects in the request.

Errors

We use HTTP response codes to indicate API errors. JSON is returned by all API responses, including errors.

 

Learn more about REST Endpoints in our How-To Deploy a REST Endpoint guide!

 
Suggest Edits

Get Endpoint Information

Retrieves Endpoint definition. See Endpoints for more information.

 
gethttps://endpoint-demo.cognigy.ai/endpointToken

Path Params

endpointToken
string
required

The Endpoint token. You find the URL at the top of your Endpoint resource in the UI.

 
curl --request GET \
  --url https://endpoint-demo.cognigy.ai/endpointToken
var request = require("request");

var options = { method: 'GET',
  url: 'https://endpoint-demo.cognigy.ai/endpointToken' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://endpoint-demo.cognigy.ai/endpointToken")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://endpoint-demo.cognigy.ai/endpointToken");

xhr.send(data);
import requests

url = "https://endpoint-demo.cognigy.ai/endpointToken"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Send Text or Data to an Endpoint

Talk to your flow! Requests must have a userId which corresponds to a Contact Profile. You can supply text and/or data objects in your request. The response will similarly consist of a JSON object with text and data. See Endpoints for more information on the Endpoint concept.

 
posthttps://endpoint-demo.cognigy.ai/endpointToken

Path Params

endpointToken
string
required

The Endpoint token. You find the URL at the top of your Endpoint resource in the UI.

Body Params

Example body: {"userId": "443481190ebf88610e9768093dafdc163652505b", "text": "Hello", "data": {"myKey": "myValue"} }

userId
string
required
text
string
data
 
curl --request POST \
  --url https://endpoint-demo.cognigy.ai/endpointToken
var request = require("request");

var options = { method: 'POST',
  url: 'https://endpoint-demo.cognigy.ai/endpointToken' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://endpoint-demo.cognigy.ai/endpointToken")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://endpoint-demo.cognigy.ai/endpointToken");

xhr.send(data);
import requests

url = "https://endpoint-demo.cognigy.ai/endpointToken"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{"text": "Hello World!", "data": {"outKey": "outValue"} }
 
 

Learn more about Webhook Endpoints in our How-To Deploy a Webhook Endpoint guide!

 
Suggest Edits

Get Endpoint Information

Retrieves Endpoint definition. See Endpoints for more information.

 
gethttps://endpoint-demo.cognigy.ai/webhookToken/

Path Params

webhookToken
string
required

The Endpoint token. You find the URL at the top of your Endpoint resource in the UI.

 
curl --request GET \
  --url https://endpoint-demo.cognigy.ai/webhookToken/
var request = require("request");

var options = { method: 'GET',
  url: 'https://endpoint-demo.cognigy.ai/webhookToken/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://endpoint-demo.cognigy.ai/webhookToken/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://endpoint-demo.cognigy.ai/webhookToken/");

xhr.send(data);
import requests

url = "https://endpoint-demo.cognigy.ai/webhookToken/"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Send Text or Data to an Endpoint

Talk to your flow! Requests must have a userId which corresponds to a Contact Profile. You can supply text and/or data objects in your request. The response will similarly consist of a JSON object containing the userId and an object AIOutput that contains text string and data object. See Endpoints for more information on the Endpoint concept.

 
posthttps://endpoint-demo.cognigy.ai/webhookToken/

Path Params

webhookToken
string
required

The Endpoint token. You find the URL at the top of your Endpoint resource in the UI.

Body Params

Example body: {"userId": "443481190ebf88610e9768093dafdc163652505b", "text": "Hello", "data": {"myKey": "myValue"} }

userId
string
required
text
string
data
 
curl --request POST \
  --url https://endpoint-demo.cognigy.ai/webhookToken/
var request = require("request");

var options = { method: 'POST',
  url: 'https://endpoint-demo.cognigy.ai/webhookToken/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://endpoint-demo.cognigy.ai/webhookToken/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://endpoint-demo.cognigy.ai/webhookToken/");

xhr.send(data);
import requests

url = "https://endpoint-demo.cognigy.ai/webhookToken/"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

 
Suggest Edits

Socket

A Websocket Endpoint

 

You can learn more about Socket Endpoints in our Deploy a Socket Endpoint guide!

Requirements
Endpoint URL
URL Token of the Endpoint

Connect via Websocket Endpoint URL and the URL Token . Enter the URL Token as a URL parameter to the Endpoint URL:

https://{Endpoint URL}?UrlToken={URL Token}

Sending Messages


Messages are sent by using the processInput event with a payload of the following format:

{
  "URLToken":"urlToken",
  "sessionId":"sessionId",
  "userId":"userId",
  "text":"Example text",
  "data":{
    "key":"value"
  }
}

The userId which corresponds to a
Contact Profile is required. You can optionally supply text and/or
data objects in your request.

Receiving Messages


Messages can be received by listening to the output event. The reponses have the following format:

{
  "type":"output",
  "data":
  {
    "text":"responseText",
    "data":
    {
      "key":"value"
    }
  }
}

That's it. You should be all set up to use the Socket Endpoint you've created with a Flow of your choice.