Update 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.
Update an Intent
PATCH
/
v2.0
/flows
/{flowId}
/intents
/{intentId}
cURL Example
curl --request PATCH \
--url https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents/{intentId} \
--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>"
}
'```
#### Python Example
```python
import requests
url = "https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents/{intentId}"
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.patch(url, json=payload, headers=headers)
print(response.text)
JavaScript Fetch Example
const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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>'
})
};
fetch('https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents/{intentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
Required Headers
- X-API-Key: (string) - Supply the API Key in the HTTP-Header
Request Body Parameters
- name: (string) - Example: "OrderFood"
- description: (string) - Example: "Intent to order food"
- condition: (string)
- rules: (array of strings)
- isRejectIntent: (boolean)
- isDisabled: (boolean)
- tags: (array of strings)
- confirmationSentences: (array of strings)
- disambiguationSentence: (string)
- data: (object)
- localeReference: (string)
- childFeatures: (boolean)
- parentIntentId: (string)
- analyticsLabel: (string)
Response Codes
- 204: Successfully updated Intent
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": {}
}