POST
/
v1
/
pathway
/
{pathway_id}
Update Pathway
curl --request POST \
  --url https://api.bland.ai/v1/pathway/{pathway_id} \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "nodes": [
    {}
  ],
  "edges": [
    {}
  ]
}'
{
  "status": "success",
  "message": "Pathway updated successfully",
  "pathway_data": {
    "pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
    "name": "Updated Demo Pathway",
    "description": "This is an updated description",
    "nodes": [
        {
            "id": "1",
            "data": {
                "name": "Start",
                "text": "Hey there, how are you doing today?",
                "isStart": true,
            },
            "type": "Default"
        },
        {
            "id": "randomnode_1710288752186",
            "data": {
                "name": "End call",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            },
            "type": "End Call"
        },
        {
            "id": "randomnode_1710288871721",
            "data": {
                "name": "New Node",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            },
            "type": "Default"
        }
    ],
    "edges": [
        {
            "id": "1",
            "source": "1",
            "target": "randomnode_1710288752186",
            "data": {
                "name": "End call",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            }
        },
        {
            "id": "2",
            "source": "1",
            "target": "randomnode_1710288871721",
            "data": {
                "name": "New Node",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            }
        }
    ]
  }
}

Headers

authorization
string
required
Your API key for authentication.

Path Parameters

pathway_id
string
required
The unique identifier of the conversational pathway you want to update.

Body

name
string
The name of the conversational pathway
description
string
A description of the pathway
nodes
object[]
Data about all the nodes in the pathway.Example of a node object:
{
  "id": "1",
  "type": "Default"
  "data": {
      "name": "Start",
      "text": "Hey there, how are you doing today?",
      "isStart": true,
  },
}
  
Update the pathway’s global prompt by adding an object to the array of nodes.
Global Prompt
{
    "globalConfig": {
        "globalPrompt": "This is a phone call. Do not use exclamation marks.\n\nConvert 24HR format timings to 12 HR format - e.g 14:00 should be written as 2 PM."
    },
    "position": {
        "x": 0,
        "y": 0
    }
}
edges
object[]
Data about all the edges in the pathway.

Response

status
string
Can be success or error.
pathway_id
string
A unique identifier for the pathway (present only if status is success).
nodes
array of objects
Data about all the nodes in the pathway.
edges
array of objects
Data about all the edges in the pathway.
{
  "status": "success",
  "message": "Pathway updated successfully",
  "pathway_data": {
    "pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1",
    "name": "Updated Demo Pathway",
    "description": "This is an updated description",
    "nodes": [
        {
            "id": "1",
            "data": {
                "name": "Start",
                "text": "Hey there, how are you doing today?",
                "isStart": true,
            },
            "type": "Default"
        },
        {
            "id": "randomnode_1710288752186",
            "data": {
                "name": "End call",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            },
            "type": "End Call"
        },
        {
            "id": "randomnode_1710288871721",
            "data": {
                "name": "New Node",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            },
            "type": "Default"
        }
    ],
    "edges": [
        {
            "id": "1",
            "source": "1",
            "target": "randomnode_1710288752186",
            "data": {
                "name": "End call",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            }
        },
        {
            "id": "2",
            "source": "1",
            "target": "randomnode_1710288871721",
            "data": {
                "name": "New Node",
                "prompt": "Click 'Add New Node' on the right to add a new node",
            }
        }
    ]
  }
}