Add a New Locale to a Node - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

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

Add a New Locale to a Node

Endpoint

POST /v2.0/flows/{flowId}/chart/nodes/{nodeId}/addlocalization

Example cURL Request

curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/chart/nodes/{nodeId}/addlocalization \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '\n{
  "localeId": "<string>",
  "inhertFromLocaleId": "<string>",
  "nodeTranslationSettings": {
    "from": "<string>",
    "to": "<string>"
  }
}\n'

Example Python Code

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/chart/nodes/{nodeId}/addlocalization"

payload = {
    "localeId": "<string>",
    "inhertFromLocaleId": "<string>",
    "nodeTranslationSettings": {
        "from": "<string>",
        "to": "<string>"
    }
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)

Example JavaScript Code

const options = {
  method: 'POST',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    localeId: '<string>',
    inhertFromLocaleId: '<string>',
    nodeTranslationSettings: {from: '<string>', to: '<string>'}
  })
};

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

Possible Responses

400 - Bad Request

{
  "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": {}
}

401 - Unauthorized

{
  "type": "Unauthorized",
  "title": "Unauthorized Error",
  "status": 401,
  "detail": "<string>",
  "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
  "code": 401,
  "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f",
  "details": {}
}

Authorizations

Parameter Type Location Required Description
X-API-Key string header Yes Supply the API Key in the HTTP-Header

Headers

Name Type Description
Accept enum Specifies the media type that the client expects in the response. Available options: application/json, application/hal+json, application/xml, text/xml, text/csv. The default value is application/json.

Path Parameters

Parameter Type Required Description
flowId string Yes The unique identifier for the Flow. Required string length: 24
nodeId string Yes The Id of the Node. Required string length: 24

Body Structure

Property Type Description
localeId string The locale identifier
inhertFromLocaleId string The locale identifier to inherit from
nodeTranslationSettings object Contains translation settings
nodeTranslationSettings.from string The original language
nodeTranslationSettings.to string The target language

Response Example

200 - Success

Successfully added localization for node.