Hog
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
GET | |
GET | |
GET | |
GET | |
GET | |
POST | |
GET | |
POST | |
GET | |
POST | |
GET | |
POST | |
POST | |
POST | |
POST | |
GET | |
GET | |
POST | |
POST |
Create hog flows invocations cancel
Cancel in-flight invocations of this workflow, by id or all at once.
Cancellation is asynchronous: runs are flagged here, then terminated by
the workflow workers, promptly for parked runs (delays and waits) and at
the next step boundary for runs mid-execution. Steps that already
executed are not undone. Canceled runs can be re-run later via rerun.
Required API key scopes
hog_flow:writePath parameters
- idstring
Request parameters
- invocation_idsarray
- allbooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /invocations /cancelExample response
Status 200
Retrieve hog flows logs
Also available via the PostHog MCP server:
workflows-logs— Get workflow logs
Required API key scopes
hog_flow:readPath parameters
- idstring
Query parameters
- afterstring
- beforestring
- instance_idstring
- levelstring
- limitintegerDefault:
50 - offsetintegerDefault:
0 - searchstring
Example request
GET /api /projects /:project_id /hog_flows /:id /logsExample response
Status 200 No response body
Retrieve hog flows metrics
Also available via the PostHog MCP server:
workflows-stats— Get workflow stats
Required API key scopes
hog_flow:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /metricsExample response
Status 200
Retrieve hog flows metrics totals
Required API key scopes
hog_flow:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /metrics /totalsExample response
Status 200
Retrieve hog flows metrics version
One published version's series. Every hog flow metric is mirrored under
hog_flow_version with the version appended to the id, which is what makes "before and
after this change" answerable at all. The unversioned read keys batch and broadcast runs on
the run instead, so it is not the sum of the versions.
Required API key scopes
hog_flow:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
- versioninteger
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /metrics /versionExample response
Status 200
Retrieve hog flows optimization
Whether PostHog may suggest changes to this workflow.
Turning it off stops new suggestions. Suggestions already made are left alone: someone still has them to resolve.
Required API key scopes
hog_flow:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /optimizationExample response
Status 200
Create hog flows optimization
Whether PostHog may suggest changes to this workflow.
Turning it off stops new suggestions. Suggestions already made are left alone: someone still has them to resolve.
Required API key scopes
hog_flow:writePath parameters
- idstring
Request parameters
- enabledboolean
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /optimizationExample response
Status 200
List all hog flows proposals
Agent-authored changes to this workflow, awaiting a human's decision.
Creating one stages nothing: a proposal only reaches the workflow's draft once a human approves it, and only reaches the live config once someone publishes that draft.
Required API key scopes
hog_flow:readPath parameters
- idstring
Query parameters
- limitinteger
- offsetinteger
- statusstringOne of:
"applied""approved""rejected""suggested"
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /proposalsExample response
Status 200
Create hog flows proposals
Agent-authored changes to this workflow, awaiting a human's decision.
Creating one stages nothing: a proposal only reaches the workflow's draft once a human approves it, and only reaches the live config once someone publishes that draft.
Required API key scopes
hog_flow_proposal:writePath parameters
- idstring
Request parameters
- titlestring
- rationalestring
- contentobject
- evidenceobject
- base_versioninteger
- step_idstring | null
- source_idstring | null
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /proposalsExample response
Status 201
Retrieve hog flows proposals
Required API key scopes
hog_flow:readPath parameters
- idstring
- proposal_idstring
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /proposals /:proposal_idExample response
Status 200
Create hog flows proposals approve
Required API key scopes
hog_flow:writePath parameters
- idstring
- proposal_idstring
Request parameters
- overwritebooleanDefault:
false - expected_draft_updated_atstring | null
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /proposals /:proposal_id /approveExample response
Status 200
Retrieve hog flows proposals outcome
What the change did: the target metric and its counter-metrics, before and after.
Both sides are read from the per-version metric series, so "before" is the version the
suggestion was written against and "after" is the version it went live as. Each number
carries its own n, and anything under the minimum sample is flagged rather than presented
as a result — a verdict off twenty sends is the loop's most embarrassing failure mode.
Comparing two windows is not a controlled experiment; that is what the A/B step is for.
Required API key scopes
hog_flow:readPath parameters
- idstring
- proposal_idstring
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /proposals /:proposal_id /outcomeExample response
Status 200
Create hog flows proposals reject
Required API key scopes
hog_flow:writePath parameters
- idstring
- proposal_idstring
Request parameters
- reasonstring
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /proposals /:proposal_id /rejectExample response
Status 200
Create hog flows publish
Required API key scopes
hog_flow:writePath parameters
- idstring
Request parameters
- confirmbooleanDefault:
false - confirm_tokenstring
- sandbox_sender_warnedboolean | null
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /publishExample response
Status 200
Create hog flows rerun
Rerun past invocations of this hog flow from their stored payloads.
Same shape and semantics as the hog function rerun endpoint —
proxies through to the CDP worker, which reads matching rows from
ClickHouse, rehydrates from invocation_globals, and re-enqueues
onto cyclotron with is_retry=1.
Because rerun replays historical event/person/group data, it requires
person:read and group:read on top of hog_flow:write.
Required API key scopes
hog_flow:writeperson:readgroup:readPath parameters
- idstring
Request parameters
- filter
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /rerunExample response
Status 200
Status 400
Create hog flows resume email
Resume email sending for a workflow PostHog paused automatically.
Self-serve on purpose. Resuming re-arms the detector rather than exempting the workflow, so a workflow that is still generating complaints or hard bounces pauses again within minutes, while a customer who has cleaned up their audience does not have to wait on support.
Required API key scopes
hog_flow:writePath parameters
- idstring
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /resume_email_sendingExample response
Status 200
List all hog flows revisions
Required API key scopes
hog_flow:readPath parameters
- idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /revisionsExample response
Status 200
Retrieve hog flows revisions
Required API key scopes
hog_flow:readPath parameters
- idstring
- versioninteger
Response
Example request
GET /api /projects /:project_id /hog_flows /:id /revisions /:versionExample response
Status 200
Create hog flows revisions restore
Required API key scopes
hog_flow:writePath parameters
- idstring
- versioninteger
Request parameters
- overwritebooleanDefault:
false - expected_draft_updated_atstring | null
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /revisions /:version /restoreExample response
Status 200
Create hog flows run
Run a workflow with a schedule or manual trigger now, once.
A schedule-triggered workflow runs outside its regular schedule. A manually triggered
workflow runs for the calling user, as the trigger button in the editor does. Other
triggers have their own entry points (batch_jobs, the public webhook URL) with
trigger-specific guardrails this endpoint doesn't replicate. Requires the workflow to be
active, same gate the scheduler itself applies in internal_process_due_schedules.
Send an Idempotency-Key header to dedupe retries (a double-click, or a client retry
after a timed-out request): a repeat with the same key returns the first call's result
instead of firing a second AI task. Without the header, every call fires a new run.
Required API key scopes
hog_flow:writePath parameters
- idstring
Request parameters
- variablesobject
Response
Example request
POST /api /projects /:project_id /hog_flows /:id /run




