Create an Intent - 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}
/intents
Try it
Create an Intent
cURL
curl --request POST \
--url https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "OrderFood",
"description": "Intent to order food",
"condition": "<string>",
"rules": [\
"<string>"\
],
"isRejectIntent": true,
"isDisabled": true,
"tags": [\
"<string>"\
],
"confirmationSentences": [\
"<string>"\
],
"disambiguationSentence": "<string>",
"data": {},
"localeReference": "<string>",
"childFeatures": false,
"parentIntentId": "<string>",
"analyticsLabel": "<string>"
}
'
import requests
url = "https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents"
payload = {
"name": "OrderFood",
"description": "Intent to order food",
"condition": "<string>",
"rules": ["<string>"],
"isRejectIntent": True,
"isDisabled": True,
"tags": ["<string>"],
"confirmationSentences": ["<string>"],
"disambiguationSentence": "<string>",
"data": {},
"localeReference": "<string>",
"childFeatures": False,
"parentIntentId": "<string>",
"analyticsLabel": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Example Response
{
"name": "OrderFood",
"description": "Intent to order food",
"condition": "<string>",
"rules": ["<string>"],
"isRejectIntent": true,
"isDisabled": true,
"tags": ["<string>"],
"confirmationSentences": ["<string>"],
"disambiguationSentence": "<string>",
"data": {},
"localeReference": "<string>",
"childFeatures": false,
"parentIntentId": "<string>",
"analyticsLabel": "<string>",
"_id": "<string>",
"createdAt": 1694518620,
"lastChanged": 1694518620,
"createdBy": "<string>",
"lastChangedBy": "<string>"
}
Error Responses
{
"type": "Bad Request",
"title": "Bad Request Error",
"status": 400,
"detail": "Validation failed. Missing payload.",
"instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
"code": 1000,
"traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f",
"details": {}
}