## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.cognigy.com/llms.txt)

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

### Update a Node

**PATCH**

`/v2.0/flows/{flowId}/chart/nodes/{nodeId}`

#### cURL

```bash
curl --request PATCH \
  --url https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/chart/nodes/{nodeId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data @- <<EOF
{
  "type": "if",
  "extension": "@cognigy/basic-nodes",
  "label": "A new Node",
  "comment": "this is a very important node",
  "commentColor": "#ff8a80",
  "isEntryPoint": false,
  "isDisabled": false,
  "config": {
    "condition": {
      "type": "rule",
      "condition": "",
      "rule": {
        "left": "1",
        "operand": "gt",
        "right": "2"
      }
    }
  },
  "localeReference": "63bd8ebb648e6e739f1bbd82",
  "analyticsLabel": "condition",
  "mock": {
    "isEnabled": false,
    "code": "console.log('Hello, world!');"
  },
  "localeId": "<string>"
}
EOF
```

#### Python

```python
import requests

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

payload = {
    "type": "if",
    "extension": "@cognigy/basic-nodes",
    "label": "A new Node",
    "comment": "this is a very important node",
    "commentColor": "#ff8a80",
    "isEntryPoint": False,
    "isDisabled": False,
    "config": { "condition": {
            "type": "rule",
            "condition": "",
            "rule": {
                "left": "1",
                "operand": "gt",
                "right": "2"
            }
        } },
    "localeReference": "63bd8ebb648e6e739f1bbd82",
    "analyticsLabel": "condition",
    "mock": {
        "isEnabled": False,
        "code": "console.log('Hello, world!');"
    },
    "localeId": "<string>"
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
```

#### JavaScript

```javascript
const options = {
  method: 'PATCH',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    type: 'if',
    extension: '@cognigy/basic-nodes',
    label: 'A new Node',
    comment: 'this is a very important node',
    commentColor: '#ff8a80',
    isEntryPoint: false,
    isDisabled: false,
    config: {
      condition: {type: 'rule', condition: '', rule: {left: '1', operand: 'gt', right: '2'}}
    },
    localeReference: '63bd8ebb648e6e739f1bbd82',
    analyticsLabel: 'condition',
    mock: {isEnabled: false, code: 'console.log("Hello, world!");'},
    localeId: '<string>'
  })
};

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

### Authorizations

* **X-API-Key**: string, header, required. Supply the API Key in the HTTP-Header.

### Headers

* **Accept**: enum&lt;string&gt;. The `Accept` header 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

* **flowId**: string, required. The unique identifier for the Flow. Required string length: `24`.
* **nodeId**: string, required. The Id of the Node. Required string length: `24`.

### Body

**application/json**

* **type**: string. Type of the Node, e.g. `"if"`.
* **extension**: string. E.g. `"@cognigy/basic-nodes"`.
* **label**: string. Replaces the default name of the Node displayed in the Flow Editor, e.g. `"A new Node"`.
* **comment**: string. Adds additional information about Nodes, e.g. `"this is a very important node"`.
* **commentColor**: string. E.g. `"#ff8a80"`.
* **isEntryPoint**: boolean. E.g. `false`.
* **isDisabled**: boolean. E.g. `false`.
* **config**: object. Example: `{ "condition": { "type": "rule", "condition": "", "rule": { "left": "1", "operand": "gt", "right": "2" } } }`.
* **localeReference**: string. E.g. `"63bd8ebb648e6e739f1bbd82"`.
* **analyticsLabel**: string. E.g. `"condition"`.
* **mock**: object. Can include attributes like `isEnabled` and `code`.
* **localeId**: string, required string length: `24`.
