Workflow Data

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

POST
POST
GET
POST

Create workflow data suggestions

Workflow ideas written by AI from the project's own events. Both calls are free for the customer.

Required API key scopes

hog_flow:writequery:read

Request parameters

  • suggestion_id
    string
  • retry
    boolean
    Default: false
  • save_draft
    boolean
    Default: false

Response


Example request

POST /api/projects/:project_id/workflow_data_suggestions/build
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/workflow_data_suggestions/build/\
-d suggestion_id="string"

Example response

Status 200
RESPONSE
{
"status": "ready",
"workflow": null,
"uses_saved_template": true,
"workflow_id": "string",
"missing_inputs": [
{
"step_id": "string",
"step_name": "string",
"field": "string"
}
]
}

Create workflow data suggestions build for

Build and save draft email workflows for events the team picked, such as the events it was about to send to an email tool. Free for the customer. Needs the feature flag and AI data processing approved for the organization.

Required API key scopes

hog_flow:writequery:read

Request parameters

  • events
    array
  • retry
    boolean
    Default: false

Response


Example request

POST /api/projects/:project_id/workflow_data_suggestions/build_for_events
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/workflow_data_suggestions/build_for_events/\
-d events="array"

Example response

Status 200
RESPONSE
{
"status": "ready",
"workflow_ids": [
"string"
]
}

Retrieve workflow data suggestions

Workflow ideas written by AI from the project's own events. Both calls are free for the customer.

Required API key scopes

hog_flow:readquery:read

Response


Example request

GET /api/projects/:project_id/workflow_data_suggestions/current
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/workflow_data_suggestions/current/

Example response

Status 200
RESPONSE
{
"status": "ready",
"suggestions": [
{
"id": "string",
"name": "string",
"description": "string",
"reason": "string",
"trigger_event": "string",
"weekly_count": 0,
"stage": "signup",
"step_outline": [
"email"
],
"premade": true
}
],
"email_sender_ready": true
}

Create workflow data suggestions

Workflow ideas written by AI from the project's own events. Both calls are free for the customer.

Required API key scopes

hog_flow:writequery:read

Request parameters

  • refresh
    boolean
    Default: false

Response


Example request

POST /api/projects/:project_id/workflow_data_suggestions/generate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/workflow_data_suggestions/generate/\
-d refresh="boolean"

Example response

Status 200
RESPONSE
{
"status": "ready",
"suggestions": [
{
"id": "string",
"name": "string",
"description": "string",
"reason": "string",
"trigger_event": "string",
"weekly_count": 0,
"stage": "signup",
"step_outline": [
"email"
],
"premade": true
}
],
"email_sender_ready": true
}