Skip to main content
GET
Get Workflow Lead Variables
Read only Returns the list of dynamic variable keys derived from the column headers of the lead files uploaded to this workflow. These keys are what you can reference inside an agent’s prompt using the {{variable_name}} template syntax. For example, if a lead file contained the columns phone_number, name, city, and product, this endpoint returns data.data.keys as ["city", "name", "product"]: phone_number is excluded because it is reserved as the dial target rather than a personalization variable. The reserved tags, notes and agent_transfer_destinations columns are excluded too.

When to use this

  • Prompt editors: populate an autocomplete or “available variables” panel so the prompt author can only reference variables that actually exist on this workflow’s leads.
  • Validation pipelines: verify a prompt template before publishing an agent change. Reject the deploy if it references a {{variable_name}} that does not appear in this list.
  • Workflow audits: confirm a newly uploaded lead file produces the columns the prompt expects, especially after editing the upload schema.
The keys are the union of the dynamic variables carried by the leads currently enrolled in the workflow, sorted alphabetically. Removed leads do not contribute, and on a draft workflow each upload replaces every lead, so only the latest file counts. If a column was present in one upload and absent from another, its key still appears while any lead carries it; treat the list as “available”, not “always populated per lead”.

Path parameters

Errors

  • An unknown workflow ID is not an error: the response is 200 with an empty keys list. The same empty list is returned whenever the keys cannot be read, so this endpoint does not return 500.
  • 401 Unauthorized is returned when the API key is missing or invalid.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workflowId
string
required

Workflow ID

Example:

"workflow_abc123"

Response

Variable keys returned successfully.

success
enum<boolean>
required
Available options:
true
error
enum<boolean>
required
Available options:
false
statusCode
integer
required
Example:

200

message
string
required
Example:

"Success"

data
object
required
timestamp
string<date-time>
required