Skip to main content
PATCH
/
v1
/
workflows
/
{id}
Update Workflow
curl --request PATCH \
  --url https://api.example.com/v1/workflows/{id} \
  --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
}
'
{
  "data": {}
}

Request

Path Parameters

id
string
required
Workflow UUID.

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Idempotency-Key
string
Optional UUID for retry deduplication.

Body Parameters

All fields are optional; include only those you want to change. At least one field is required.
name
string
Updated name.
enabled
boolean
true to enable, false to disable.
condition_entity
string
Updated condition entity.
condition_field
string
Updated condition field.
condition_operator
string
Updated operator.
condition_value
string
Updated value.
action_type
string
Updated action type.
action_config
object
Updated action configuration. Replaces the existing config entirely; there is no deep-merge.
max_triggers_per_day
integer
Updated daily cap.

Response

data
object
The updated workflow record (same shape as GET /v1/workflows/{id}).
Responses include X-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}'

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

StatusCodeDescription
400validation_errorNo updatable fields provided or unsupported operator/action combo
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing write:workflows permission
404not_foundWorkflow not found
429rate_limitedRate limit exceeded