Create a Slot Filler - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

POST

/ v2.0 / flows / {flowId} / slotfillers

Create a Slot Filler

cURL

curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/slotfillers \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "type": "age",
  "usePositiveOnly": true,
  "storeResultInContext": true,
  "contextKey": "<string>",
  "storeInContactProfile": true,
  "profileKey": "<string>",
  "storeDetailedResults": true,
  "skipIfResultInContext": true,
  "additionalValidation": "<string>",
  "resultLocation": "<string>",
  "regex": "<string>",
  "slot": "<string>"
}
'

Python

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/slotfillers"

payload = {
    "name": "<string>",
    "type": "age",
    "usePositiveOnly": True,
    "storeResultInContext": True,
    "contextKey": "<string>",
    "storeInContactProfile": True,
    "profileKey": "<string>",
    "storeDetailedResults": True,
    "skipIfResultInContext": True,
    "additionalValidation": "<string>",
    "resultLocation": "<string>",
    "regex": "<string>",
    "slot": "<string>"
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

JavaScript (Fetch)

const options = {
  method: 'POST',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: '<string>',
    type: 'age',
    usePositiveOnly: true,
    storeResultInContext: true,
    contextKey: '<string>',
    storeInContactProfile: true,
    profileKey: '<string>',
    storeDetailedResults: true,
    skipIfResultInContext: true,
    additionalValidation: '<string>',
    resultLocation: '<string>',
    regex: '<string>',
    slot: '<string>'
  })
};

fetch('https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/slotfillers', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Response

{
  "name": "<string>",
  "type": "age",
  "usePositiveOnly": true,
  "storeResultInContext": true,
  "contextKey": "<string>",
  "storeInContactProfile": true,
  "profileKey": "<string>",
  "storeDetailedResults": true,
  "skipIfResultInContext": true,
  "additionalValidation": "<string>",
  "resultLocation": "<string>",
  "regex": "<string>",
  "slot": "<string>",
  "referenceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "_id": "<string>",
  "createdAt": 1694518620,
  "lastChanged": 1694518620,
  "createdBy": "<string>",
  "lastChangedBy": "<string>"
}

Authorization

X-API-Key