Update Workflow
curl --request PATCH \
--url https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"condition_entity": "<string>",
"condition_field": "<string>",
"condition_operator": "<string>",
"condition_value": "<string>",
"action_type": "<string>",
"action_config": {},
"max_triggers_per_day": 123
}
'import requests
url = "https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id}"
payload = {
"name": "<string>",
"enabled": True,
"condition_entity": "<string>",
"condition_field": "<string>",
"condition_operator": "<string>",
"condition_value": "<string>",
"action_type": "<string>",
"action_config": {},
"max_triggers_per_day": 123
}
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: '<string>',
enabled: true,
condition_entity: '<string>',
condition_field: '<string>',
condition_operator: '<string>',
condition_value: '<string>',
action_type: '<string>',
action_config: {},
max_triggers_per_day: 123
})
};
fetch('https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{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://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{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' => '<string>',
'enabled' => true,
'condition_entity' => '<string>',
'condition_field' => '<string>',
'condition_operator' => '<string>',
'condition_value' => '<string>',
'action_type' => '<string>',
'action_config' => [
],
'max_triggers_per_day' => 123
]),
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://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"condition_entity\": \"<string>\",\n \"condition_field\": \"<string>\",\n \"condition_operator\": \"<string>\",\n \"condition_value\": \"<string>\",\n \"action_type\": \"<string>\",\n \"action_config\": {},\n \"max_triggers_per_day\": 123\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://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"condition_entity\": \"<string>\",\n \"condition_field\": \"<string>\",\n \"condition_operator\": \"<string>\",\n \"condition_value\": \"<string>\",\n \"action_type\": \"<string>\",\n \"action_config\": {},\n \"max_triggers_per_day\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{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\": \"<string>\",\n \"enabled\": true,\n \"condition_entity\": \"<string>\",\n \"condition_field\": \"<string>\",\n \"condition_operator\": \"<string>\",\n \"condition_value\": \"<string>\",\n \"action_type\": \"<string>\",\n \"action_config\": {},\n \"max_triggers_per_day\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}Workflows
Update Workflow
Edit fields on an existing workflow, or enable / disable it
PATCH
/
v1
/
workflows
/
{id}
Update Workflow
curl --request PATCH \
--url https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"condition_entity": "<string>",
"condition_field": "<string>",
"condition_operator": "<string>",
"condition_value": "<string>",
"action_type": "<string>",
"action_config": {},
"max_triggers_per_day": 123
}
'import requests
url = "https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id}"
payload = {
"name": "<string>",
"enabled": True,
"condition_entity": "<string>",
"condition_field": "<string>",
"condition_operator": "<string>",
"condition_value": "<string>",
"action_type": "<string>",
"action_config": {},
"max_triggers_per_day": 123
}
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: '<string>',
enabled: true,
condition_entity: '<string>',
condition_field: '<string>',
condition_operator: '<string>',
condition_value: '<string>',
action_type: '<string>',
action_config: {},
max_triggers_per_day: 123
})
};
fetch('https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{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://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{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' => '<string>',
'enabled' => true,
'condition_entity' => '<string>',
'condition_field' => '<string>',
'condition_operator' => '<string>',
'condition_value' => '<string>',
'action_type' => '<string>',
'action_config' => [
],
'max_triggers_per_day' => 123
]),
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://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"condition_entity\": \"<string>\",\n \"condition_field\": \"<string>\",\n \"condition_operator\": \"<string>\",\n \"condition_value\": \"<string>\",\n \"action_type\": \"<string>\",\n \"action_config\": {},\n \"max_triggers_per_day\": 123\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://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"condition_entity\": \"<string>\",\n \"condition_field\": \"<string>\",\n \"condition_operator\": \"<string>\",\n \"condition_value\": \"<string>\",\n \"action_type\": \"<string>\",\n \"action_config\": {},\n \"max_triggers_per_day\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{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\": \"<string>\",\n \"enabled\": true,\n \"condition_entity\": \"<string>\",\n \"condition_field\": \"<string>\",\n \"condition_operator\": \"<string>\",\n \"condition_value\": \"<string>\",\n \"action_type\": \"<string>\",\n \"action_config\": {},\n \"max_triggers_per_day\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {}
}Request
Path Parameters
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Body Parameters
All fields are optional; include only those you want to change. At least one field is required.Response
Responses includeX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl -X PATCH \
https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/wf_01HY1 \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
import requests
API_KEY = "wbk_your_api_key_here"
wf_id = "wf_01HY1"
r = requests.patch(
f"https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/{wf_id}",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"max_triggers_per_day": 200},
)
print(r.json()["data"])
const id = 'wf_01HY1';
const res = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/workflows/${id}`,
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: false }),
}
);
const { data } = await res.json();
console.log(data);
Example Response
{
"data": {
"id": "wf_01HY1",
"name": "Notify owner on lost deals",
"enabled": false,
"condition_entity": "deal",
"condition_field": "status",
"condition_operator": "changed_to",
"condition_value": "lost",
"action_type": "send_channel_message",
"action_config": {
"channel": "slack",
"recipient": "{{deal.owner.slack_id}}",
"message": "Deal {{deal.name}} was marked lost."
},
"max_triggers_per_day": 200,
"triggers_today": 3,
"last_triggered_at": "2026-04-17T09:31:00Z",
"auto_disabled_reason": null,
"created_at": "2026-03-01T08:00:00Z",
"updated_at": "2026-04-17T11:10:00Z"
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | No updatable fields provided or unsupported operator/action combo |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing write:workflows permission |
| 404 | not_found | Workflow not found |
| 429 | rate_limited | Rate limit exceeded |