Update Workflow API
Rename a workflow and update its settings, such as the execution webhook. Settings are merged, so a rename never touches the webhook and a single header can be added or removed on its own.
curl --request PATCH \
--url https://api.bolna.ai/workflows/{workflow_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Loan follow-up v2",
"settings": {
"webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": {
"X-Api-Key": "your-receiver-token"
}
}
}
}
'import requests
url = "https://api.bolna.ai/workflows/{workflow_id}"
payload = {
"name": "Loan follow-up v2",
"settings": { "webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": { "X-Api-Key": "your-receiver-token" }
} }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Loan follow-up v2',
settings: {
webhook: {
url: 'https://hooks.example.com/bolna/workflow',
headers: {'X-Api-Key': 'your-receiver-token'}
}
}
})
};
fetch('https://api.bolna.ai/workflows/{workflow_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bolna.ai/workflows/{workflow_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Loan follow-up v2',
'settings' => [
'webhook' => [
'url' => 'https://hooks.example.com/bolna/workflow',
'headers' => [
'X-Api-Key' => 'your-receiver-token'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bolna.ai/workflows/{workflow_id}"
payload := strings.NewReader("{\n \"name\": \"Loan follow-up v2\",\n \"settings\": {\n \"webhook\": {\n \"url\": \"https://hooks.example.com/bolna/workflow\",\n \"headers\": {\n \"X-Api-Key\": \"your-receiver-token\"\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.bolna.ai/workflows/{workflow_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Loan follow-up v2\",\n \"settings\": {\n \"webhook\": {\n \"url\": \"https://hooks.example.com/bolna/workflow\",\n \"headers\": {\n \"X-Api-Key\": \"your-receiver-token\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/workflows/{workflow_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Loan follow-up v2\",\n \"settings\": {\n \"webhook\": {\n \"url\": \"https://hooks.example.com/bolna/workflow\",\n \"headers\": {\n \"X-Api-Key\": \"your-receiver-token\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "active",
"latest_published_version": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settings": {
"webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": {
"X-Api-Key": "**********"
}
}
}
}{
"detail": {
"code": "revision_conflict",
"message": "<string>"
}
}{
"detail": {
"code": "revision_conflict",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique id of the workflow
Body
At least one field must be present. Fields you omit are left unchanged.
The new workflow name.
1 - 120"Loan follow-up v2"
A JSON merge patch (RFC 7396) onto the workflow's stored settings. Objects merge key by key, a
key you omit is left unchanged, and null removes one. The merged result is validated as a
whole, and unknown keys are rejected.
Show child attributes
Show child attributes
{
"webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": { "X-Api-Key": "your-receiver-token" }
}
}
Response
Workflow updated. Header values in settings are returned masked.
Unique workflow id.
Display name.
Workflow status.
active, archived Number of the newest published version, or null if nothing is published yet.
The workflow's live settings. Header values are always returned as **********.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PATCH \
--url https://api.bolna.ai/workflows/{workflow_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Loan follow-up v2",
"settings": {
"webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": {
"X-Api-Key": "your-receiver-token"
}
}
}
}
'import requests
url = "https://api.bolna.ai/workflows/{workflow_id}"
payload = {
"name": "Loan follow-up v2",
"settings": { "webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": { "X-Api-Key": "your-receiver-token" }
} }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Loan follow-up v2',
settings: {
webhook: {
url: 'https://hooks.example.com/bolna/workflow',
headers: {'X-Api-Key': 'your-receiver-token'}
}
}
})
};
fetch('https://api.bolna.ai/workflows/{workflow_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bolna.ai/workflows/{workflow_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Loan follow-up v2',
'settings' => [
'webhook' => [
'url' => 'https://hooks.example.com/bolna/workflow',
'headers' => [
'X-Api-Key' => 'your-receiver-token'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bolna.ai/workflows/{workflow_id}"
payload := strings.NewReader("{\n \"name\": \"Loan follow-up v2\",\n \"settings\": {\n \"webhook\": {\n \"url\": \"https://hooks.example.com/bolna/workflow\",\n \"headers\": {\n \"X-Api-Key\": \"your-receiver-token\"\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.bolna.ai/workflows/{workflow_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Loan follow-up v2\",\n \"settings\": {\n \"webhook\": {\n \"url\": \"https://hooks.example.com/bolna/workflow\",\n \"headers\": {\n \"X-Api-Key\": \"your-receiver-token\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/workflows/{workflow_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Loan follow-up v2\",\n \"settings\": {\n \"webhook\": {\n \"url\": \"https://hooks.example.com/bolna/workflow\",\n \"headers\": {\n \"X-Api-Key\": \"your-receiver-token\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "active",
"latest_published_version": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settings": {
"webhook": {
"url": "https://hooks.example.com/bolna/workflow",
"headers": {
"X-Api-Key": "**********"
}
}
}
}{
"detail": {
"code": "revision_conflict",
"message": "<string>"
}
}{
"detail": {
"code": "revision_conflict",
"message": "<string>"
}
}
