# HighLevel API v3: workflows

> The workflows service of HighLevel API version v3 (11 endpoints). Compact reference generated from the OpenAPI specs: every endpoint lists what is needed to call it.

- Base URL: https://services.leadconnectorhq.com
- Send the header `Version: v3` on every request.
- Send `Authorization: Bearer <token>` unless the endpoint says "Auth: none".
- Index of this version: https://marketplace.gohighlevel.com/docs/llms/v3/llms.txt

## How to read an endpoint

- `name*` is required. `type[]` is an array of that type. `map<string, T>` is an object with arbitrary keys.
- Nested fields are indented under their parent. Fields of array items and map values are listed directly under the array or map field.
- `option N` lines are oneOf/anyOf alternatives: send exactly one of them.
- Parentheses hold format, enum values (`a | b`), nullable, default, limits and an example (`e.g.`).
- "Response" is the success response; "Errors" lists the other status codes.

## Auth legend

- OAuth access token: issued through the OAuth 2.0 authorization-code flow for an app, either for a Sub-Account (location) or for an Agency (company).
- Private Integration Token (PIT): a static token created in the Sub-Account or Agency settings with a chosen set of scopes; send it the same way as an access token.
- "OAuth access token only": a Private Integration Token is rejected for that endpoint.
- Sub-Account token vs Agency token: the token must have been issued for the account level the endpoint names.
- Scopes: the token must carry every scope listed for the endpoint.

Security schemes used in this version:
- Agency-Access = Agency token: OAuth access token or Private Integration Token
- Agency-Access-Only = Agency token: OAuth access token only (Private Integration Tokens are not accepted)
- Location-Access = Sub-Account token: OAuth access token or Private Integration Token
- Location-Access-Only = Sub-Account token: OAuth access token only (Private Integration Tokens are not accepted)
- bearer = Sub-Account token: OAuth access token or Private Integration Token

## Common error responses

Response 400 (Bad Request) application/json:
- statusCode number
- message string

Response 401 (Unauthorized) application/json:
- statusCode number
- message string
- error string

Response 403 (The token does not have access to this location) application/json:
- statusCode number - HTTP status code for invalid location access
- message string - Error message describing the location access failure

Response 404 (Not Found) application/json:
- statusCode number - HTTP status code for not found
- message string - Error message describing the not found failure
- error string - Error type identifier

Response 409 (A request with the same Idempotency-Key is still in progress; retry after a short delay): no body

Response 415 (Unsupported Media Type): no body

Response 422 (Unprocessable Entity) application/json:
- statusCode number
- message string[]
- error string

Response 429 (Rate limit exceeded) application/json:
- statusCode* number - HTTP status code
- message* string | string[] - Human-readable message, or a list of validation messages
  - option 1: string
  - option 2: string[]
- error string - HTTP reason phrase or domain code when present. Domain codes seen today: `graph_scope_invalid`. Otherwise Nest’s reason phrase.
- reason string (enum: too_many_ids | non_list_type | duplicate_graph_scope) - Present when `error` is `graph_scope_invalid`. Discriminates Search list-scope failures. Allowed: `too_many_ids`, `non_list_type`, `duplicate_graph_scope`.

Response 504 (The query ran past its time limit and was stopped. Narrow it as the message says, then try again. The same request sent again usually times out again) application/json:
- statusCode number - HTTP status code
- message string - Why the query was stopped, and how to narrow it
- error string - HTTP error name

## Service: workflows (Workflows API v3)

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Documentation for workflows API

**API Version v3**

All APIs available via `/v3` route prefix with AIP-compliant responses.

### Create Workflow
POST /workflows/
URL: https://services.leadconnectorhq.com/workflows/
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/create-workflow | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/create-workflow.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Create a workflow from a complete definition. The definition is validated in full before anything is persisted, so a rejected request creates nothing. Workflows are always created in `draft`; use Update Workflow Status to publish.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.write

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Request body (required) (application/json) CreateWorkflowDefinitionDto:
- name* string (maxLength: 500; e.g. "Welcome series") - Workflow name
- source* object - Where this definition came from
  - system* string (e.g. "my-app") - Identifier for the system authoring this definition
  - workflowId string (e.g. "wf-42") - Your own identifier for the workflow, echoed back for correlation
- triggers* object[] - Triggers that enrol contacts. May be empty — a workflow with no trigger can still be entered by another workflow or by the API — but the key must be present.
  - type* string (e.g. "contact_created") - Trigger type key
  - name string (e.g. "New contact") - Display name shown on the canvas
  - conditions object[] (e.g. []) - Trigger filters. Shape depends on `type`; use Validate Workflow Definition to check it.
  - scheduleConfig object - Schedule for scheduler-type triggers. Absent on every other trigger type. Get Workflow Definition returns it in this shape and Update Workflow Definition accepts it back.
    - stopAt number (e.g. 1767225600000) - When the schedule stops firing, as epoch milliseconds (UTC). Omit for no end date.
    - skipWeekends boolean - Skip runs that would fall on a Saturday or Sunday.
  - id string (maxLength: 200; e.g. "7c1f0d2e-3b4a-4c5d-8e9f-0a1b2c3d4e5f") - Trigger ID. Assigned when omitted. Get Workflow Definition returns it; sending it back keeps the trigger stable across updates.
  - position object - Canvas position, as the builder stores it. Echoed by Get Workflow Definition; optional on write.
    - x* number (e.g. 120) - Horizontal canvas position
    - y* number (e.g. 240) - Vertical canvas position
  - testResponse object - Sample event captured by the builder for testing the trigger. Passed through verbatim.
  - metadata object - Importer bookkeeping. Passed through verbatim.
  - workflowsTriggerType string (e.g. "INTERNAL") - Marketplace (IATF) triggers only: the trigger class the app registered. Echoed by Get Workflow Definition; send it back unchanged.
  - integrationAccountId string (e.g. "acct_01HZX3K9P2Q") - Marketplace (IATF) triggers only: the connected account the trigger listens on.
  - masterType string (e.g. "internal") - Trigger family, as the builder stores it.
  - targetActionId string (e.g. "welcome-sms") - For triggers bound to one step (a reply trigger, for example), the ID of that step.
- triggerRelation string (enum: and | or; e.g. "or") - How multiple triggers combine. Echoed by Get Workflow Definition; ignored on write — the system always stores `or`.
- actions* object[] - Steps. May be an empty array, but the key must be present.
  - id* string (maxLength: 200; e.g. "welcome-sms") - Step ID. Any non-empty string, unique within the definition — a readable id like `welcome-sms` is fine, and `edges` reference it by that name. It does not have to be a UUID; ids that are not get converted to one when the workflow is saved, so a definition read back will carry the converted ids rather than the ones sent. **Reuse ids across updates.** A step keeps contacts already mid-workflow on their current step only while it keeps its id. Sending back the ids from Get Workflow Definition is the reliable way to do that — a readable id also converts to the same value every time for a given workflow, so re-sending an authored definition is safe too.
  - type* string (e.g. "add_contact_tag") - Step type key
  - name string (e.g. "Tag as lead") - Display name shown on the canvas
  - attributes object - Step configuration. The shape depends on `type` — fetch it from Get Step Types and check it with Validate Workflow Definition.
  - position object - Canvas position, as the builder stores it. Echoed by Get Workflow Definition; optional on write.
    - x* number (e.g. 120) - Horizontal canvas position
    - y* number (e.g. 240) - Vertical canvas position
  - metadata object - Importer bookkeeping. Passed through verbatim.
  - workflowsActionType string (e.g. "INTEGRATION") - Marketplace (IATF) steps only: the action class the app registered. Echoed by Get Workflow Definition; send it back unchanged.
  - isMarketplaceAction boolean - Marketplace (IATF) steps only: marks the step as a marketplace action.
  - container string (e.g. "loop-1") - ID of the container step this step is nested in, where the builder uses one.
- edges* object[] - Connections between steps. May be empty, but the key must be present.
  - from* string (e.g. "welcome-sms") - Step ID this edge leaves from
  - to* string (e.g. "tag-as-welcomed") - Step ID this edge arrives at
  - branch string (e.g. "no") - Branch label, for steps that fan out. On an if/else it is the `id` of one of the step's declared `branches`, or `no` for the else lane.
  - goto boolean - Marks this edge as a loop back to an earlier step
- settings object - Workflow-level settings
  - allowReEntry boolean - Allow a contact to enter the workflow more than once
  - allowMultipleOpportunities boolean - Allow multiple opportunities per contact
  - stopOnResponse boolean - Stop the workflow when the contact replies
  - isConversationsMarkAsRead boolean - Mark conversations as read automatically
  - timezone string (enum: account | contact; e.g. "account") - Whose timezone drives scheduling
  - window object - Sending window
    - condition* string (e.g. "wait") - How the window is applied
    - start* string (e.g. "09:00") - Window start, 24h HH:mm
    - end string (e.g. "17:00") - Window end, 24h HH:mm
    - days string[] (e.g. [1,2,3,4,5]) - Days of week the window applies to, 0 = Sunday
  - senderAddress object - Default sender details, passed through verbatim. Recognised keys are `from_name`, `from_email` and `from_number`. Declared as a free-form object rather than a typed schema because those keys are snake_case on the wire — the workflow format uses them verbatim, and a typed schema would fail the public-spec camelCase rule while renaming them would break round-tripping.
- folderName string (e.g. "Sales") - Single-segment folder to place the workflow in. Mutually exclusive with `folderPath`.
- folderPath string[] (e.g. ["Sales","Q3"]) - Folder path, outermost first, max 10 levels. Mutually exclusive with `folderName`.
- createFolderIfMissing boolean - Create the folder if it does not exist. Requires `folderName` or `folderPath`.
- version number (e.g. 3) - The workflow's version counter, owned by the system — not a format version. Get Workflow Definition fills it in; leave it untouched and send it back on update, and a concurrent edit in the builder can never be silently overwritten. A stale value is rejected with 422. Treat it as opaque: echo it, never compute from it. It does not always advance by one (delete and restore each add 0.1, and a later save rounds up), so it is not always an integer. Omit it on create — the system assigns the starting value.

Response 201 (Workflow created) application/json:
- workflowId* string - ID of the created workflow
- status string (enum: draft | published) - Status of the new workflow. Always `draft` — creating something already live is not possible. Absent only in the rare case where the workflow was created but could not be read back.
- definition object - The created workflow, in the same shape Get Workflow Definition returns and Update Workflow Definition accepts — so an update needs no separate read. Note `version` is not 1: the create path saves several times. Absent only if the workflow was created but could not be read back.
- warnings* object[] - Non-blocking findings
  - path string - Path within the definition
  - message string - What to be aware of
  - type string - Step type the warning relates to

Errors: 400, 401, 403, 415, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 415 (Content-Type is not application/json) application/json:
- statusCode number - HTTP status code
- message string[] - What was wrong with the Content-Type header
- error string - HTTP error name
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Delete Workflow
DELETE /workflows/{workflowId}
URL: https://services.leadconnectorhq.com/workflows/{workflowId}
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/delete-workflow | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/delete-workflow.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Delete a workflow. This also ends any enrollments in progress, so contacts currently moving through the workflow stop where they are. Treat it as permanent.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.delete

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Path parameters:
- workflowId* string (e.g. "b1b0de82-3efb-4d63-83f6-13c50aef208c") - Workflow ID

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Response 200 (Workflow deleted) application/json:
- succeeded* boolean - Whether the workflow was deleted
- workflowId* string - Id of the deleted workflow

Errors: 400, 401, 403, 404, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 404 (No such workflow in this location) application/json:
- statusCode number - HTTP status code
- message string - Which workflow was not found, and in which sub-account
- error string - HTTP error name
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Get Workflow
GET /workflows/
URL: https://services.leadconnectorhq.com/workflows/
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow.md

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.readonly

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID to list workflows for

Response 200 (Successful response) application/json:
- workflows object[] - Workflows in the sub-account
  - id string - Unique identifier for the workflow
  - name string - Display name of the workflow
  - status string (enum: draft | published) - Publish state of the workflow: `draft` or `published`
  - version number - Revision counter, incremented by the platform on every save
  - createdAt string - When the workflow was created
  - updatedAt string - When the workflow was last updated
  - locationId string - Sub-account (location) the workflow belongs to

Errors: 400, 401, 422, 429 (400, 401, 422: see Common error responses)
Response 429 (Rate limit exceeded. The integration (OAuth app or private integration) went over its daily quota or its 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The request was not run. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry. The body message is `Too Many Requests`.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Get Workflow Definition
GET /workflows/{workflowId}/definition
URL: https://services.leadconnectorhq.com/workflows/{workflowId}/definition
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-definition | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-definition.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Read a workflow as a complete definition. The `definition` object is accepted verbatim by Update Workflow Definition, so it round-trips.

The definition's `version` is the workflow's own counter. Leave it as it comes back: sending it unchanged on update is what stops a concurrent edit in the builder from being silently overwritten.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.readonly

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Path parameters:
- workflowId* string (e.g. "b1b0de82-3efb-4d63-83f6-13c50aef208c") - Workflow ID

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Response 200 (Successful response) application/json:
- workflowId* string - Workflow ID
- status* string (enum: draft | published) - Whether the workflow is live. Read-only here — change it with Update Workflow Status, which is gated by the workflows.publish scope. It sits outside `definition` because the definition is sent back verbatim to Update Workflow Definition.
- definition* object - The definition, in the same shape Update Workflow Definition accepts.
- warnings* object[] - Non-blocking findings
  - path string - Path within the definition
  - message string - What to be aware of
  - type string - Step type the warning relates to

Errors: 400, 401, 403, 404, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 404 (No such workflow in this location) application/json:
- statusCode number - HTTP status code
- message string - Which workflow was not found, and in which sub-account
- error string - HTTP error name
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Get Workflow Log Statistics
GET /workflows/{workflowId}/logs/aggregate
URL: https://services.leadconnectorhq.com/workflows/{workflowId}/logs/aggregate
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-log-statistics | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-log-statistics.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Count the log records of one workflow, grouped by one or more dimensions. It answers how many: enrollments, completions, failures per step, why contacts left, and trends over time. To answer who, use Get Workflow Logs.

**Before you call it.** Get `workflowId` from Search Workflows. Never pass a workflow name.

**Grouping.** Each row holds one value for every dimension in `groupBy`, plus `count`. Grouping by `week`, `day` or `hour` adds `bucket`, the start of each interval in `timezone`. `startDate` and `endDate` always stay UTC. Rows are sorted by the grouped values in ascending order (`status`, then `type`, `stepId`, `removedReason` and `bucket`), not by count.

**Finding filter values.** Group by a dimension to see which values this workflow has, then filter on them. For example, `groupBy=removedReason` lists the reasons present, and those values work in `removedReasons`.

**Steps.** Rows grouped by `stepId` also carry `stepName`, the name of that step on its most recent log record in the date range. `stepId` matches `actions[].id` in Get Workflow Definition. A step count includes the `remove_from_workflow` record written when a contact leaves the workflow at that step, so group by `stepId` and `type` together to count how often the step itself ran.

**Common questions.**
- Enrollments: `statuses=added_to_workflow`
- Completions: `removedReasons=end_of_workflow`. Divide by enrollments for a completion rate
- Failures per step: `statuses=error,failed,failed_retry_limit_reached&groupBy=stepId`
- Why contacts left: `types=remove_from_workflow&groupBy=removedReason`
- Stopped because the contact replied: `removedReasons=contact_reply_stop_response`
- Goal reached: `types=workflow_goal&statuses=success`
- Enrollment trend: `statuses=added_to_workflow&groupBy=week` (or `day`)
- Change over time: call twice with back-to-back windows of equal length and compare

Completions in a window can include contacts who enrolled before it, so a completion rate can exceed 100%. With fewer than about 30 enrollments, rates swing widely. Zero is a real answer. A `workflowId` that does not exist in the sub-account returns 404.

**Limits.** The range defaults to the last 30 days and must not exceed 30 days. Logs are available for the last 60 days. A grouping that produces more rows than `limit` is refused with 422 rather than truncated, because a truncated count reports wrong totals.

**Compatibility.** New optional fields and new values of `status`, `type` and `removedReason` can appear at any time. Ignore fields you do not know, and treat an unknown value as other.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.logs

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Path parameters:
- workflowId* string (e.g. "a7321e66-8b68-4c10-afc7-4cc9744f17af") - Workflow ID. Get it from Search Workflows. Never pass a workflow name

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID. It must be the sub-account the token belongs to, otherwise the request is refused with 403
- startDate string (e.g. "2026-06-01") - Start of the range, ISO 8601: a plain date (start of that day, UTC) or a full timestamp. Send it together with endDate. Defaults to 30 days ago. Logs are available for the last 60 days, so it cannot be earlier than that
- endDate string (e.g. "2026-06-30") - End of the range, ISO 8601. A plain date includes the whole day. At most 30 days after startDate. Defaults to now
- groupBy string[] (enum: status | type | stepId | removedReason | week | day | hour; e.g. ["type","status"]) - Dimensions to group the counts by. Repeat the parameter or send a comma-separated list. `status` is the step outcome, `type` the step type, `stepId` the step, `removedReason` why the contact left the workflow, and `week`, `day` or `hour` a time bucket (one at most). Defaults to `status`
- statuses string[] (e.g. ["error","failed"]) - Count only these step outcomes. Values: `added_to_workflow` (the contact entered the workflow), `success` (the step ran), `error` and `failed` (the step did not complete), `failed_retry_limit_reached` (the step gave up after its retries), `retry` (the step will run again), `skipped` (the step did not run, for example because of DND, a time window or missing data), `waiting` (the contact is waiting at the step), `wait_finished` (a wait ended), `finished` (the contact left the workflow, see removedReason), `paused_due_to_draft_mode` (the workflow was unpublished while the contact was in it), `contact_merged` (the contact was merged into another contact), `drip_queued` (the contact is waiting in a drip step for its batch), `drip_resume` (the batch was released and the contact moved on), `processing` (the step has started and has not finished yet), and `winner_declared` (an A/B test step picked its winning path; the record has no contact). New values can appear. Group by `status` first to see the values this workflow has
- types string[] (e.g. ["email"]) - Count only these step types: a step `type` key, as listed by Get Step Types or in `actions[].type` of Get Workflow Definition. Unlike Get Workflow Logs, `if_else` and `drip` match only those exact keys here. New values can appear. Group by `type` first to see the types this workflow has
- removedReasons string[] (e.g. ["end_of_workflow"]) - Count only records removed for these reasons. Values: `end_of_workflow` (the contact reached the end), `contact_deleted` (the contact was deleted), `deleted_workflow` (the workflow was deleted), `record_deleted` (the record was deleted), `goal_action` (a goal step removed the contact), `contact_reply_stop_response` (the contact replied and the workflow stops on reply), `contact_merge` (the contact was merged), `appointment-change`, `invoice-change` and `service-booking-change` (the appointment, invoice or booking changed and the workflow restarted for the contact), `attendee-change` (the Events attendee or their event changed, and the run for that attendee ended), `rental-booking-change` (the rental booking that started the workflow was deleted or cancelled), `wait_step_window_in_past` (a wait step time window pointed to a time in the past, so the contact left), and `missing-data` (the step the contact was on was deleted from the workflow). Values are exact, including the ones with hyphens. New values can appear. Group by `removedReason` first to see the values this workflow has
- timezone string (e.g. "America/New_York") - IANA timezone for the week, day and hour buckets. It does not move startDate and endDate, which stay UTC. Defaults to UTC
- limit number (e.g. 1000) - Maximum number of grouped rows. A grouping that produces more is refused with 422 rather than truncated. Default 1000, maximum 5000

Response 200 (Successful response) application/json:
- count* number - Number of rows in this response
- statistics* object[] - The grouped counts
  - status string - Step outcome. Present when grouping by status. New values can appear
  - type string - Step type. Present when grouping by type. New values can appear
  - stepId string - Step ID. Present when grouping by stepId. Matches `actions[].id` in Get Workflow Definition. Usually a UUID. For an if/else step with `"version": 2` it is the branch that was taken, as in Get Workflow Logs. Enrollment rows use `added_to_workflow` or `add_to_workflow`, and removals with no current step (for example after the contact was deleted) have an empty string. The count includes the `remove_from_workflow` record written when a contact leaves the workflow at this step. Add `type` to groupBy to count them apart
  - stepName string - Name of the step on its most recent log record in the date range. Present when grouping by stepId
  - removedReason string (nullable) - Why the contact left the workflow. Present when grouping by removedReason. Null when no removal reason is recorded, which includes every record that is not a removal. Values: `end_of_workflow` (the contact reached the end), `contact_deleted` (the contact was deleted), `deleted_workflow` (the workflow was deleted), `record_deleted` (the record was deleted), `goal_action` (a goal step removed the contact), `contact_reply_stop_response` (the contact replied and the workflow stops on reply), `contact_merge` (the contact was merged), `appointment-change`, `invoice-change` and `service-booking-change` (the appointment, invoice or booking changed and the workflow restarted for the contact), `attendee-change` (the Events attendee or their event changed, and the run for that attendee ended), `rental-booking-change` (the rental booking that started the workflow was deleted or cancelled), `wait_step_window_in_past` (a wait step time window pointed to a time in the past, so the contact left), and `missing-data` (the step the contact was on was deleted from the workflow). New values can appear
  - bucket string - Start of the time bucket in the requested timezone: `YYYY-MM-DD` for week (weeks start on Monday), `YYYY-MM-DD HH:mm:ss` for day and hour. Present when grouping by week, day or hour
  - count* number - Number of log records in this group

Errors: 401, 403, 404, 422, 429, 504 (401, 504: see Common error responses)
Response 403 (The token does not have access to this sub-account (locationId), or the workflow API is not enabled for it or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`, not a token or scope problem)) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 404 (No such workflow in this location) application/json:
- statusCode number - HTTP status code
- message string - Which workflow was not found, and in which sub-account
- error string - HTTP error name
Response 422 (The request is not valid. `message` lists what to fix) application/json:
- statusCode number
- message string[]
- error string
Response 429 (Rate limit exceeded. Every public token has a daily quota and a short burst limit. Wait for `X-RateLimit-Interval-Milliseconds`, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Get Workflow Logs
GET /workflows/{workflowId}/logs
URL: https://services.leadconnectorhq.com/workflows/{workflowId}/logs
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-logs | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-logs.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

List the step-by-step execution history of one workflow, newest first. Each record is one step of one run for one contact or record, with its outcome and timing. It answers who and what: who entered, what happened to a contact, which steps failed and for whom. To answer how many, use Get Workflow Log Statistics.

**Before you call it.** Get `workflowId` from Search Workflows. Never pass a workflow name. To see what each step is, call Get Workflow Definition: its `actions[].id` matches `stepId` here.

**Step details.** `meta` says how the contact entered, why a step was skipped or failed, what a step did, whether a wait timed out, and why the contact left. A key is left out when it does not apply. Only the keys documented under `meta` are returned. New keys may be added later (see Compatibility).

**Paging.** The response holds `logs`, their `count`, and `nextCursor`. The first call (`action=first`, the default) returns the newest page. For the next (older) page, send `action=next` with `referenceId` and `referenceCreatedAt` from `nextCursor`, unchanged, and keep the same filters and dates. `nextCursor` is null when there are no more records. A cursor that does not match returns 422. A page holds at most 100 records, 15 by default.

**Dates.** Send `startDate` and `endDate` together (ISO 8601, UTC, at most 30 days apart). Without them, the last 30 days are returned. Logs are available for the last 60 days.

**Common questions.**
- Who entered the workflow: `statuses=added_to_workflow`
- Which steps failed, and for whom: `statuses=error,failed,failed_retry_limit_reached`
- What happened to one contact: `contactId=<contact ID>`
- Every step of one run: `executionId=<workflowStatusId of any record from that run>`

An empty `logs` list is a real answer: nothing matched in that window. A `workflowId` that does not exist in the sub-account, or is a folder, returns 404.

**Compatibility.** New optional fields, including new `meta` keys, and new values of `status`, `type` and `recordType` can appear at any time. Ignore fields you do not know, and treat an unknown value as other.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.logs

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Path parameters:
- workflowId* string (e.g. "a7321e66-8b68-4c10-afc7-4cc9744f17af") - Workflow ID. Get it from Search Workflows. Never pass a workflow name

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID. It must be the sub-account the token belongs to, otherwise the request is refused with 403
- limit number (e.g. 20) - Records per page, 1 to 100. Default 15
- action string (enum: first | next; default: first) - `first` returns the newest page, which can also start with steps that are still running. `next` returns the next (older) page, starting at the record in `nextCursor`, and requires `referenceId` and `referenceCreatedAt`. Defaults to `first`
- referenceId string (e.g. "0123456789abcdef01234567") - `nextCursor.referenceId` from the previous response. Required with `next`
- referenceCreatedAt string (e.g. "2026-09-25T10:00:00.000Z") - `nextCursor.referenceCreatedAt` from the previous response, sent unchanged. Required with `next`
- types string[] (e.g. ["email"]) - Only steps of this type: a step `type` key, as listed by Get Step Types or in `actions[].type` of Get Workflow Definition, for example `email`. One type per call on this route. `drip` also matches `drip_queued` and `drip_resume`, and `if_else` also matches `condition`. New values can appear
- statuses string[] (e.g. ["error","failed"]) - Only steps with these outcomes (the `status` field). Repeat the parameter or send a comma-separated list. Values: `added_to_workflow` (the contact entered the workflow), `success` (the step ran), `error` and `failed` (the step did not complete), `failed_retry_limit_reached` (the step gave up after its retries), `retry` (the step will run again), `skipped` (the step did not run, for example because of DND, a time window or missing data), `waiting` (the contact is waiting at the step), `wait_finished` (a wait ended), `finished` (the contact left the workflow, see removedReason), `paused_due_to_draft_mode` (the workflow was unpublished while the contact was in it), `contact_merged` (the contact was merged into another contact), `drip_queued` (the contact is waiting in a drip step for its batch), `drip_resume` (the batch was released and the contact moved on), `processing` (the step has started and has not finished yet), and `winner_declared` (an A/B test step picked its winning path; the record has no contact). For every kind of failure, send `error`, `failed` and `failed_retry_limit_reached`. New values can appear
- startDate string (e.g. "2026-06-01") - Start of the range, ISO 8601: a plain date (start of that day, UTC) or a full timestamp. Send it together with endDate. Defaults to 30 days ago. Logs are available for the last 60 days, so it cannot be earlier than that
- endDate string (e.g. "2026-06-30") - End of the range, ISO 8601. A plain date includes the whole day. At most 30 days after startDate. Defaults to now
- contactId string (e.g. "exampleContactId0001") - Only logs for this contact. Use the `contactId` of a record
- executionId string (e.g. "01ARZ3NDEKTSV4RRFFQ69G5FAV") - Only the steps of one execution: one run of the workflow for one contact or record. Use the `workflowStatusId` of any record from that run
- recordId string (e.g. "exampleRecordId00001") - Only logs for one record, in workflows that run on records (opportunities, custom objects and so on) instead of contacts. Use the `recordId` of a record. Send it with recordType
- recordType string (e.g. "opportunity") - Object type of recordId. Use the `recordType` of the same record. Values: `contact`, `opportunity`, `task`, `business`, `inbound_webhook`, or `custom_objects.<object key>` for a custom object, for example `custom_objects.cars`. New values can appear

Response 200 (Successful response) application/json:
- count* number - Number of records in this response
- nextCursor* object (nullable) - Where the next (older) page starts: send `action=next` with these values and the same filters and dates. Null when there are no more records
  - referenceId* string - Send as `referenceId`
  - referenceCreatedAt* string - Send as `referenceCreatedAt`, unchanged
- logs* object[] - The records, newest first
  - id* string - ID of this log record
  - locationId* string - Sub-account (location) that owns the workflow
  - workflowId* string - Workflow that produced this record
  - contactId string - Contact the step ran for. Empty string when the step did not run for a contact
  - workflowStatusId string - Execution ID. Every step of one run shares it. Send it as `executionId` to read that run only
  - stepId string (nullable) - Step ID. Matches `actions[].id` in Get Workflow Definition. Group by it in Get Workflow Log Statistics. On if/else steps where `attributes.version` is 2, it is the ID of the branch that was taken, not the if/else step's ID, and `stepName` is that branch's name. To find the branch in Get Workflow Definition, match `stepName` to the if/else step's `attributes.branches[].name`, or to `attributes.noneBranchName` when no branch matched. Can be null
  - stepName string - Step name as shown in the builder when the step ran. On if/else steps where `attributes.version` is 2, it is the name of the branch that was taken
  - type* string - Step type key, the same key Get Step Types and Get Workflow Definition use, with these exceptions: if/else steps are logged as `condition`, wait steps as `wait_time`, `wait_reply` and similar, and drip steps as `drip`, `drip_queued` or `drip_resume`. Some records are not steps, for example `added_to_workflow` when a contact enters and `remove_from_workflow` when a contact leaves. Send it in `types` to filter. New values can appear
  - status* string - Outcome of the step: `added_to_workflow` (the contact entered the workflow), `success` (the step ran), `error` and `failed` (the step did not complete), `failed_retry_limit_reached` (the step gave up after its retries), `retry` (the step will run again), `skipped` (the step did not run, for example because of DND, a time window or missing data), `waiting` (the contact is waiting at the step), `wait_finished` (a wait ended), `finished` (the contact left the workflow, see removedReason), `paused_due_to_draft_mode` (the workflow was unpublished while the contact was in it), `contact_merged` (the contact was merged into another contact), `drip_queued` (the contact is waiting in a drip step for its batch), `drip_resume` (the batch was released and the contact moved on), `processing` (the step has started and has not finished yet), and `winner_declared` (an A/B test step picked its winning path; the record has no contact). New values can appear
  - recordId string (nullable) - Record the step ran for, in workflows that run on records. Null otherwise
  - recordType string (nullable) - Object type of recordId: `contact`, `opportunity`, `task`, `business`, `inbound_webhook`, or `custom_objects.<object key>` for a custom object, for example `custom_objects.cars`. New values can appear
  - recordPrimaryProperty string (nullable) - Display name of the record
  - contactName string (nullable) - Contact name when the step ran
  - contactEmail string (nullable) - Contact email when the step ran
  - meta* object - Step details. Which keys appear depends on the step type and outcome, and a key is left out when it does not apply. Only the keys documented here are returned. New keys may be added later
    - addedSource object - How the contact entered the workflow and what added it. Present when the contact entered
      - source string - How the contact entered the workflow, for example `trigger`, `bulk_action` or `workflow`. New values can appear
      - sourceName string - Name of what added the contact, for example the trigger name
      - id string - ID of what added the contact. For `trigger` it is the trigger ID (`triggers[].id` in Get Workflow Definition), for `bulk_action` the bulk action ID, for `workflow` the ID of the workflow that added the contact
    - skippedFor object - Present on skipped steps. Holds why the step was skipped
      - msg string - Why the step was skipped
    - msg string - Information about the step. On most failed steps, the error text
    - data object - The step's result
      - msg string - What the step did. On some failed steps, such as webhooks, the error text
    - waitMeta object - Wait steps: how the wait ended
      - isTimedOut boolean - True when a wait step ended because it timed out
    - removedFrom object - Present when the contact left the workflow. Holds why it left
      - type string - Why the contact left the workflow, for example `end_of_workflow`, `contact_reply_stop_response` or `goal_action`. The same values as `removedReason` in Get Workflow Log Statistics. Can be empty. New values can appear
  - createdAt* string - When the step was logged

Errors: 401, 403, 404, 422, 429, 504 (401, 504: see Common error responses)
Response 403 (The token does not have access to this sub-account (locationId), or the workflow API is not enabled for it or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`, not a token or scope problem)) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 404 (No such workflow in this location) application/json:
- statusCode number - HTTP status code
- message string - Which workflow was not found, and in which sub-account
- error string - HTTP error name
Response 422 (The request is not valid. `message` lists what to fix) application/json:
- statusCode number
- message string[]
- error string
Response 429 (Rate limit exceeded. Every public token has a daily quota and a short burst limit. Wait for `X-RateLimit-Interval-Milliseconds`, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Get Step Types
GET /workflows/step-types
URL: https://services.leadconnectorhq.com/workflows/step-types
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-step-types | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/get-workflow-step-types.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Browse or fetch the action and trigger schemas available to a sub-account, so a definition can be built against real field names before saving.

Every response is paged and every entry carries its full field schema, including the `assetReferences` that say which fields must hold IDs of assets that already exist. Default page size is 20.

Narrow with `types`, which matches on the step type **key** and matches partially — `email` returns `send_email` as well as `email`. Use `query` instead to match names and descriptions too. Page with `limit` and `skip`.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.readonly

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to
- types string (e.g. "email,add_contact_tag") - Comma-separated step type filters (max 50 terms). Each term matches any step type whose **key** contains it, so `email` returns `send_email` as well as `email`, and an exact key still matches itself. Matching looks only at the type key — not the name or description — so a step merely described as emailing something will not appear. A term matching nothing is reported in `notFound`. Results are paged like any other request.
- kind string (enum: action | trigger; e.g. "action") - Restrict results to actions or triggers
- query string (e.g. "tag") - Free-text match over type, name and description — broader than `types`, which matches the type key only. Ignored when `types` is supplied.
- limit number (default: 20) - Page size. Kept small by default because every entry carries its full field schema.
- skip number (default: 0) - Number of results to skip before the page starts

Response 200 (Successful response) application/json:
- locationId* string - Sub-account the catalog was scoped to
- total* number - Total matching step types before paging
- count* number - Number returned in this response
- skip* number - The `skip` this page started at — echoed back so a caller paging through can tell which slice it received without tracking the request.
- stepTypes* object[] - The step types
  - kind* string - Whether this is an action or a trigger
  - type* string - Type key to use in the definition
  - name* string - Display name
  - description string - What the step does
  - category string - Grouping shown in the builder
  - provider string - Whether the step is native or from a marketplace app
  - fields object[] - Configurable fields. Returned in detail mode only.
    - field* string - Attribute name inside `attributes`
    - fieldType* string - Value type
    - required* boolean - Whether the step will not save without it
    - requiredEnforcement string (enum: builder-and-ir | builder-only) - Where a `required: true` obligation is actually enforced. Present only when it is `builder-only`, meaning the builder makes the omission unreachable but validation here does NOT reject it — the value is generated client-side and may belong in `__customInputFields__` rather than under this field name. A successful validate or save is not evidence the field was present. Ordinary fields are unannotated.
    - itemsType string - Element type when `fieldType` is `array`
    - title string - Human label
    - helpText string - Guidance shown next to the field
    - options string[] - Allowed values, when constrained
    - assetType string - Set when this field must hold the ID of an existing asset of this type
    - hasDynamicOptions boolean - True when valid values must be looked up rather than hard-coded
  - assetReferences object[] - Assets this step references. Returned in detail mode only.
    - path* string - Where the ID lives in the definition
    - assetType* string - Asset type the ID must refer to
  - triggerFilters object - Triggers only. `definitions` is the filter catalogue: one entry per configurable filter, with its `field`, `label`, `fieldType`, `required`, allowed `operators` and `valueSource`. `filtersComplete: false` means that list is partial — do not treat it as exhaustive. For marketplace triggers `feedNormalization: "incomplete"` means the same thing: `definitions` is a lower bound, because the app declared filters this projection could not normalize. `incompleteFields` names filters with no derivable operators, which cannot be authored.
- notFound* object[] - `types` terms that matched no step type key
  - type* string - A `types` term that matched no step type key. Terms match partially, so this means nothing contained it — not that an exact key is missing.
- warnings* object[] - Non-blocking findings
  - path string - Path within the definition
  - message string - What to be aware of
  - type string - Step type the warning relates to

Errors: 400, 401, 403, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Search Workflows
POST /workflows/search
URL: https://services.leadconnectorhq.com/workflows/search
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/search-workflows | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/search-workflows.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Find workflows in a sub-account by name, status, folder or timestamp. Returns summaries only — pass an ID to Get Workflow Definition for the full definition.

Filters are combined with AND. Page with `offset` for the first few pages and switch to the `searchAfter` cursor for deeper paging; sending both is rejected.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.readonly

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Request body (required) (application/json) WorkflowSearchDto:
- filters object[] - Filters, combined with AND. Max 20. Omit to match every workflow in the sub-account. To fetch a known set of workflows, filter `workflowId` with `in`. The sub-account scope still applies, so an id from another sub-account simply matches nothing.
  - field* string (enum: workflowId | name | status | type | customObjectType | folderId | updatedBy | createdAt | updatedAt; e.g. "name") - Field to filter on
  - operator* string (enum: eq | not_eq | in | contains | not_contains | gt | gte | lt | lte; e.g. "contains") - Comparison to apply. `eq`, `not_eq`, `in`, `contains` and `not_contains` are text-only; `gt`/`gte`/`lt`/`lte` are date-only. A mismatch is rejected with 422. To match a single instant on a date field, send `gte` and `lte` with the same value.
  - value* string | string[] (e.g. "onboarding") - Value to compare against. An array is required for `in` and rejected for every other operator. Dates are ISO-8601.
    - option 1: string
    - option 2: string[]
- sort object[] - Sort order. Defaults to most recently updated first.
  - field* string (enum: workflowId | name | status | type | customObjectType | folderId | updatedBy | createdAt | updatedAt; e.g. "updatedAt") - Field to sort on
  - direction* string (enum: asc | desc; e.g. "desc") - Sort direction
- limit number (default: 20) - Page size
- offset number (e.g. 0) - Result offset. Cannot be combined with `searchAfter`. Deep paging is expensive — prefer `searchAfter` past the first few pages.
- searchAfter string[] (e.g. ["1735689600000"]) - Cursor from a previous response, for stable paging through a large result set. Send it back verbatim; do not construct one.

Response 200 (Successful response) application/json:
- total* number - Total matches, ignoring paging
- count* number - Number returned in this response
- offset number - The offset this page started at — echoed back so a caller paging through can tell which slice it received without tracking the request. 0 when no `offset` was sent. Absent when the page was fetched with `searchAfter`, where a numeric position is not known.
- workflows* object[] - The matching workflows
  - id* string - Workflow ID
  - name string - Workflow name
  - description string (nullable) - Workflow description. Always null today — no write path persists a description, so this is reserved rather than populated. Not filterable or sortable for the same reason.
  - status string - Publish status
  - folderId string (nullable) - Folder the workflow sits in, null at the root
  - workflowType string - Workflow type. Set only by some builder-created workflows; workflows created through this API never carry one. Not filterable or sortable.
  - createdBy string (nullable) - User who created the workflow. Absent today — the search indexer records only `updatedBy`. Not filterable or sortable for the same reason.
  - updatedBy string - User who last updated the workflow
  - createdAt string - Creation time
  - updatedAt string - Last update time
- searchAfter string[] - Cursor to pass as `searchAfter` for the next page. Absent on the last page.

Errors: 400, 401, 403, 415, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 415 (Content-Type is not application/json) application/json:
- statusCode number - HTTP status code
- message string[] - What was wrong with the Content-Type header
- error string - HTTP error name
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Update Workflow Definition
PUT /workflows/{workflowId}/definition
URL: https://services.leadconnectorhq.com/workflows/{workflowId}/definition
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/update-workflow-definition | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/update-workflow-definition.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Replace a workflow definition in full. **This is a complete overwrite** — any step absent from the request is deleted, so always read the current definition first and send it back modified — the definition carries its own `version`, so sending back what you read keeps you protected against overwriting a concurrent edit. A stale `version` is rejected with 422 and nothing is written.

**Draft only.** A published workflow is rejected with 409: the overwrite would replace steps under contacts currently moving through it. Set the workflow to draft with Update Workflow Status, update it, then publish it again.

**Order matters.** Changing status advances the `version`, so read the definition *after* setting the workflow to draft: draft → read → update → publish. Reading first and drafting second leaves you holding a stale `version`.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.write

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Path parameters:
- workflowId* string (e.g. "b1b0de82-3efb-4d63-83f6-13c50aef208c") - Workflow ID

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Request body (required) (application/json) UpdateWorkflowDefinitionDto:
- name* string (maxLength: 500; e.g. "Welcome series") - Workflow name
- source* object - Where this definition came from
  - system* string (e.g. "my-app") - Identifier for the system authoring this definition
  - workflowId string (e.g. "wf-42") - Your own identifier for the workflow, echoed back for correlation
- triggers* object[] - Triggers that enrol contacts. May be empty — a workflow with no trigger can still be entered by another workflow or by the API — but the key must be present.
  - type* string (e.g. "contact_created") - Trigger type key
  - name string (e.g. "New contact") - Display name shown on the canvas
  - conditions object[] (e.g. []) - Trigger filters. Shape depends on `type`; use Validate Workflow Definition to check it.
  - scheduleConfig object - Schedule for scheduler-type triggers. Absent on every other trigger type. Get Workflow Definition returns it in this shape and Update Workflow Definition accepts it back.
    - stopAt number (e.g. 1767225600000) - When the schedule stops firing, as epoch milliseconds (UTC). Omit for no end date.
    - skipWeekends boolean - Skip runs that would fall on a Saturday or Sunday.
  - id string (maxLength: 200; e.g. "7c1f0d2e-3b4a-4c5d-8e9f-0a1b2c3d4e5f") - Trigger ID. Assigned when omitted. Get Workflow Definition returns it; sending it back keeps the trigger stable across updates.
  - position object - Canvas position, as the builder stores it. Echoed by Get Workflow Definition; optional on write.
    - x* number (e.g. 120) - Horizontal canvas position
    - y* number (e.g. 240) - Vertical canvas position
  - testResponse object - Sample event captured by the builder for testing the trigger. Passed through verbatim.
  - metadata object - Importer bookkeeping. Passed through verbatim.
  - workflowsTriggerType string (e.g. "INTERNAL") - Marketplace (IATF) triggers only: the trigger class the app registered. Echoed by Get Workflow Definition; send it back unchanged.
  - integrationAccountId string (e.g. "acct_01HZX3K9P2Q") - Marketplace (IATF) triggers only: the connected account the trigger listens on.
  - masterType string (e.g. "internal") - Trigger family, as the builder stores it.
  - targetActionId string (e.g. "welcome-sms") - For triggers bound to one step (a reply trigger, for example), the ID of that step.
- triggerRelation string (enum: and | or; e.g. "or") - How multiple triggers combine. Echoed by Get Workflow Definition; ignored on write — the system always stores `or`.
- actions* object[] - Steps. May be an empty array, but the key must be present.
  - id* string (maxLength: 200; e.g. "welcome-sms") - Step ID. Any non-empty string, unique within the definition — a readable id like `welcome-sms` is fine, and `edges` reference it by that name. It does not have to be a UUID; ids that are not get converted to one when the workflow is saved, so a definition read back will carry the converted ids rather than the ones sent. **Reuse ids across updates.** A step keeps contacts already mid-workflow on their current step only while it keeps its id. Sending back the ids from Get Workflow Definition is the reliable way to do that — a readable id also converts to the same value every time for a given workflow, so re-sending an authored definition is safe too.
  - type* string (e.g. "add_contact_tag") - Step type key
  - name string (e.g. "Tag as lead") - Display name shown on the canvas
  - attributes object - Step configuration. The shape depends on `type` — fetch it from Get Step Types and check it with Validate Workflow Definition.
  - position object - Canvas position, as the builder stores it. Echoed by Get Workflow Definition; optional on write.
    - x* number (e.g. 120) - Horizontal canvas position
    - y* number (e.g. 240) - Vertical canvas position
  - metadata object - Importer bookkeeping. Passed through verbatim.
  - workflowsActionType string (e.g. "INTEGRATION") - Marketplace (IATF) steps only: the action class the app registered. Echoed by Get Workflow Definition; send it back unchanged.
  - isMarketplaceAction boolean - Marketplace (IATF) steps only: marks the step as a marketplace action.
  - container string (e.g. "loop-1") - ID of the container step this step is nested in, where the builder uses one.
- edges* object[] - Connections between steps. May be empty, but the key must be present.
  - from* string (e.g. "welcome-sms") - Step ID this edge leaves from
  - to* string (e.g. "tag-as-welcomed") - Step ID this edge arrives at
  - branch string (e.g. "no") - Branch label, for steps that fan out. On an if/else it is the `id` of one of the step's declared `branches`, or `no` for the else lane.
  - goto boolean - Marks this edge as a loop back to an earlier step
- settings object - Workflow-level settings
  - allowReEntry boolean - Allow a contact to enter the workflow more than once
  - allowMultipleOpportunities boolean - Allow multiple opportunities per contact
  - stopOnResponse boolean - Stop the workflow when the contact replies
  - isConversationsMarkAsRead boolean - Mark conversations as read automatically
  - timezone string (enum: account | contact; e.g. "account") - Whose timezone drives scheduling
  - window object - Sending window
    - condition* string (e.g. "wait") - How the window is applied
    - start* string (e.g. "09:00") - Window start, 24h HH:mm
    - end string (e.g. "17:00") - Window end, 24h HH:mm
    - days string[] (e.g. [1,2,3,4,5]) - Days of week the window applies to, 0 = Sunday
  - senderAddress object - Default sender details, passed through verbatim. Recognised keys are `from_name`, `from_email` and `from_number`. Declared as a free-form object rather than a typed schema because those keys are snake_case on the wire — the workflow format uses them verbatim, and a typed schema would fail the public-spec camelCase rule while renaming them would break round-tripping.
- folderName string (e.g. "Sales") - Single-segment folder to place the workflow in. Mutually exclusive with `folderPath`.
- folderPath string[] (e.g. ["Sales","Q3"]) - Folder path, outermost first, max 10 levels. Mutually exclusive with `folderName`.
- createFolderIfMissing boolean - Create the folder if it does not exist. Requires `folderName` or `folderPath`.
- version* number (e.g. 3) - The workflow's version counter, owned by the system — not a format version. Get Workflow Definition fills it in; leave it untouched and send it back on update, and a concurrent edit in the builder can never be silently overwritten. A stale value is rejected with 422. Treat it as opaque: echo it, never compute from it. It does not always advance by one (delete and restore each add 0.1, and a later save rounds up), so it is not always an integer. Required on update: send back the value you read. An update without it is rejected with 422 before anything is written.

Response 200 (Workflow updated) application/json:
- workflowId* string - Workflow ID
- status string (enum: draft | published) - Whether the workflow is live. Read-only here — change it with Update Workflow Status, which is gated by the workflows.publish scope. Absent only in the rare case where the update succeeded but the workflow could not be read back.
- definition object - The updated workflow, in the same shape Get Workflow Definition returns and this endpoint accepts — so a follow-up edit needs no separate read. Note `version` has advanced: an update increments the counter, and sending a stale one is rejected with 422. Absent only if the update succeeded but the workflow could not be read back.
- warnings* object[] - Non-blocking findings
  - path string - Path within the definition
  - message string - What to be aware of
  - type string - Step type the warning relates to

Errors: 400, 401, 403, 404, 409, 415, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 404 (No such workflow in this location) application/json:
- statusCode number - HTTP status code
- message string - Which workflow was not found, and in which sub-account
- error string - HTTP error name
Response 409 (The workflow is published (set it to draft first), or was deleted while the update was in flight) application/json:
- statusCode number - HTTP status code
- message string - Why the request conflicts with the current state of the workflow
- error string - HTTP error name
Response 415 (Content-Type is not application/json) application/json:
- statusCode number - HTTP status code
- message string[] - What was wrong with the Content-Type header
- error string - HTTP error name
Response 422 (The definition was rejected, or `version` is stale — re-read the definition and retry) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Update Workflow Status
PUT /workflows/{workflowId}/status
URL: https://services.leadconnectorhq.com/workflows/{workflowId}/status
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/update-workflow-status | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/update-workflow-status.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Publish a workflow or send it back to draft. Publishing validates the definition in full and activates the triggers; a definition that fails validation is rejected with 422 and the workflow stays as it was. Locked and scheduled-paused workflows cannot change status and return 409.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.publish

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Path parameters:
- workflowId* string (e.g. "b1b0de82-3efb-4d63-83f6-13c50aef208c") - Workflow ID

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Request body (required) (application/json) UpdateWorkflowStatusDto:
- status* string (enum: published | draft; e.g. "published") - Target status. Publishing validates the full definition first and activates the triggers; a definition that fails validation is rejected with 422 and the workflow stays in draft.

Response 200 (Status changed) application/json:
- workflowId* string - Workflow ID
- status* string (enum: published | draft) - The status the workflow now has

Errors: 400, 401, 403, 404, 409, 415, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 404 (No such workflow in this location) application/json:
- statusCode number - HTTP status code
- message string - Which workflow was not found, and in which sub-account
- error string - HTTP error name
Response 409 (The workflow is locked or scheduled-paused) application/json:
- statusCode number - HTTP status code
- message string - Why the request conflicts with the current state of the workflow
- error string - HTTP error name
Response 415 (Content-Type is not application/json) application/json:
- statusCode number - HTTP status code
- message string[] - What was wrong with the Content-Type header
- error string - HTTP error name
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.

### Validate Workflow Definition
POST /workflows/definition/validate
URL: https://services.leadconnectorhq.com/workflows/definition/validate
Docs: https://marketplace.gohighlevel.com/docs/ghl/workflows/validate-workflow-definition | Markdown: https://marketplace.gohighlevel.com/docs/ghl/workflows/validate-workflow-definition.md

**Limited availability.** The workflow API is currently enabled for selected sub-accounts only; any other sub-account receives 403 `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`.

Run the full save pipeline against a definition and report what a real save would do. Nothing is persisted. Returns 200 with `valid: false` when the definition is rejected — a 4xx here means the request itself was malformed.

Auth: Sub-Account token: OAuth access token or Private Integration Token. Scopes: workflows.write

Headers:
- Authorization: Bearer <token> (required)
- Version: v3 (required)

Query parameters:
- locationId* string (e.g. "ve9EPM428h8vShlRW1KT") - Sub-account (location) ID the workflow belongs to

Request body (required) (application/json) ValidateWorkflowDefinitionDto:
- name* string (maxLength: 500; e.g. "Welcome series") - Workflow name
- source* object - Where this definition came from
  - system* string (e.g. "my-app") - Identifier for the system authoring this definition
  - workflowId string (e.g. "wf-42") - Your own identifier for the workflow, echoed back for correlation
- triggers* object[] - Triggers that enrol contacts. May be empty — a workflow with no trigger can still be entered by another workflow or by the API — but the key must be present.
  - type* string (e.g. "contact_created") - Trigger type key
  - name string (e.g. "New contact") - Display name shown on the canvas
  - conditions object[] (e.g. []) - Trigger filters. Shape depends on `type`; use Validate Workflow Definition to check it.
  - scheduleConfig object - Schedule for scheduler-type triggers. Absent on every other trigger type. Get Workflow Definition returns it in this shape and Update Workflow Definition accepts it back.
    - stopAt number (e.g. 1767225600000) - When the schedule stops firing, as epoch milliseconds (UTC). Omit for no end date.
    - skipWeekends boolean - Skip runs that would fall on a Saturday or Sunday.
  - id string (maxLength: 200; e.g. "7c1f0d2e-3b4a-4c5d-8e9f-0a1b2c3d4e5f") - Trigger ID. Assigned when omitted. Get Workflow Definition returns it; sending it back keeps the trigger stable across updates.
  - position object - Canvas position, as the builder stores it. Echoed by Get Workflow Definition; optional on write.
    - x* number (e.g. 120) - Horizontal canvas position
    - y* number (e.g. 240) - Vertical canvas position
  - testResponse object - Sample event captured by the builder for testing the trigger. Passed through verbatim.
  - metadata object - Importer bookkeeping. Passed through verbatim.
  - workflowsTriggerType string (e.g. "INTERNAL") - Marketplace (IATF) triggers only: the trigger class the app registered. Echoed by Get Workflow Definition; send it back unchanged.
  - integrationAccountId string (e.g. "acct_01HZX3K9P2Q") - Marketplace (IATF) triggers only: the connected account the trigger listens on.
  - masterType string (e.g. "internal") - Trigger family, as the builder stores it.
  - targetActionId string (e.g. "welcome-sms") - For triggers bound to one step (a reply trigger, for example), the ID of that step.
- triggerRelation string (enum: and | or; e.g. "or") - How multiple triggers combine. Echoed by Get Workflow Definition; ignored on write — the system always stores `or`.
- actions* object[] - Steps. May be an empty array, but the key must be present.
  - id* string (maxLength: 200; e.g. "welcome-sms") - Step ID. Any non-empty string, unique within the definition — a readable id like `welcome-sms` is fine, and `edges` reference it by that name. It does not have to be a UUID; ids that are not get converted to one when the workflow is saved, so a definition read back will carry the converted ids rather than the ones sent. **Reuse ids across updates.** A step keeps contacts already mid-workflow on their current step only while it keeps its id. Sending back the ids from Get Workflow Definition is the reliable way to do that — a readable id also converts to the same value every time for a given workflow, so re-sending an authored definition is safe too.
  - type* string (e.g. "add_contact_tag") - Step type key
  - name string (e.g. "Tag as lead") - Display name shown on the canvas
  - attributes object - Step configuration. The shape depends on `type` — fetch it from Get Step Types and check it with Validate Workflow Definition.
  - position object - Canvas position, as the builder stores it. Echoed by Get Workflow Definition; optional on write.
    - x* number (e.g. 120) - Horizontal canvas position
    - y* number (e.g. 240) - Vertical canvas position
  - metadata object - Importer bookkeeping. Passed through verbatim.
  - workflowsActionType string (e.g. "INTEGRATION") - Marketplace (IATF) steps only: the action class the app registered. Echoed by Get Workflow Definition; send it back unchanged.
  - isMarketplaceAction boolean - Marketplace (IATF) steps only: marks the step as a marketplace action.
  - container string (e.g. "loop-1") - ID of the container step this step is nested in, where the builder uses one.
- edges* object[] - Connections between steps. May be empty, but the key must be present.
  - from* string (e.g. "welcome-sms") - Step ID this edge leaves from
  - to* string (e.g. "tag-as-welcomed") - Step ID this edge arrives at
  - branch string (e.g. "no") - Branch label, for steps that fan out. On an if/else it is the `id` of one of the step's declared `branches`, or `no` for the else lane.
  - goto boolean - Marks this edge as a loop back to an earlier step
- settings object - Workflow-level settings
  - allowReEntry boolean - Allow a contact to enter the workflow more than once
  - allowMultipleOpportunities boolean - Allow multiple opportunities per contact
  - stopOnResponse boolean - Stop the workflow when the contact replies
  - isConversationsMarkAsRead boolean - Mark conversations as read automatically
  - timezone string (enum: account | contact; e.g. "account") - Whose timezone drives scheduling
  - window object - Sending window
    - condition* string (e.g. "wait") - How the window is applied
    - start* string (e.g. "09:00") - Window start, 24h HH:mm
    - end string (e.g. "17:00") - Window end, 24h HH:mm
    - days string[] (e.g. [1,2,3,4,5]) - Days of week the window applies to, 0 = Sunday
  - senderAddress object - Default sender details, passed through verbatim. Recognised keys are `from_name`, `from_email` and `from_number`. Declared as a free-form object rather than a typed schema because those keys are snake_case on the wire — the workflow format uses them verbatim, and a typed schema would fail the public-spec camelCase rule while renaming them would break round-tripping.
- folderName string (e.g. "Sales") - Single-segment folder to place the workflow in. Mutually exclusive with `folderPath`.
- folderPath string[] (e.g. ["Sales","Q3"]) - Folder path, outermost first, max 10 levels. Mutually exclusive with `folderName`.
- createFolderIfMissing boolean - Create the folder if it does not exist. Requires `folderName` or `folderPath`.
- version number (e.g. 3) - The workflow's version counter, owned by the system — not a format version. Get Workflow Definition fills it in; leave it untouched and send it back on update, and a concurrent edit in the builder can never be silently overwritten. A stale value is rejected with 422. Treat it as opaque: echo it, never compute from it. It does not always advance by one (delete and restore each add 0.1, and a later save rounds up), so it is not always an integer. Optional here: a create-shaped definition has no counter yet.
- workflowId string (e.g. "b1b0de82-3efb-4d63-83f6-13c50aef208c") - Validate as an update of this workflow rather than as a create. 404 if it does not exist.

Response 200 (Validation result) application/json:
- valid* boolean - Whether this exact body would save right now. `false` is still a 200.
- errors* object[] - Blocking findings
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
- warnings* object[] - Non-blocking findings
  - path string - Path within the definition
  - message string - What to be aware of
  - type string - Step type the warning relates to

Errors: 400, 401, 403, 415, 422, 429 (400, 401: see Common error responses)
Response 403 (The workflow API is not enabled for this sub-account or its agency (code `WORKFLOW_API_NOT_ENABLED_FOR_LOCATION`). Not a token or scope failure.) application/json:
- statusCode number - HTTP status code
- error string - HTTP error name
- code string - Stable code to branch on. Only ever this value for an enrolment refusal.
- message string - Why the request was refused
Response 415 (Content-Type is not application/json) application/json:
- statusCode number - HTTP status code
- message string[] - What was wrong with the Content-Type header
- error string - HTTP error name
Response 422 (Unprocessable Entity) application/json:
- statusCode number - HTTP status code
- message string[] - Validation errors describing why the request could not be processed
- error string - HTTP error name
- errors object[] - Per-finding detail. This is what tells you which step is wrong.
  - code string - Stable error code you can branch on
  - message string - Human-readable explanation
  - path string - Path within the definition
  - stage string - Which validation phase produced this
  - context object - Which step or asset the finding relates to
Response 429 (Rate limit exceeded. Two limits apply, and either can refuse a request. The integration (OAuth app or private integration) has a daily quota and a 10-second burst limit for this sub-account, reported in the `X-RateLimit-*` headers; for private integrations the daily quota is shared by every private integration token of the sub-account. The sub-account also has its own budget per 10-second window, shared by every token used for it, with reads (get step types, get definition, search) and writes (validate, create, update, change status, delete) counted separately. No header reports the sub-account budget, so a 429 while `X-RateLimit-Remaining` and `X-RateLimit-Daily-Remaining` are both above 0 means that budget is spent. `Retry-After` is not sent: if `X-RateLimit-Daily-Remaining` is 0, wait `X-RateLimit-Daily-Reset` milliseconds; otherwise wait 10 seconds, then retry.) application/json:
- statusCode number - HTTP status code
- message string - `Too Many Requests` when the integration's quota is spent, `Too Many Requests !` when the sub-account budget is spent. Branch on the status code, not this text.
