workflow_email_drafts

Draft an email about an error, feature, survey, flag or cohort

Write a first draft of an email to the people an entity points at. A model writes it when the project has AI drafts on and the organization approved AI data processing; otherwise, or when the model fails, the fixed template for the source is returned. Nothing is saved.

post/api/projects/{project_id}/workflow_email_drafts/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/workflow_email_drafts/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

source'error_tracking' | 'early_access' | 'survey' | 'feature_flag' | 'cohort' required
  • error_tracking - Error tracking issue
  • early_access - Early access feature
  • survey - Survey
  • feature_flag - Feature flag
  • cohort - Cohort
source_idstring required

ID of that entity: an issue, early access feature or survey UUID, or a feature flag or cohort ID.

Response

subjectstring required

Email subject line. Empty when there is nothing to draft from.

preheaderstring required

Preview text shown after the subject in most inboxes.

htmlstring required

Email body as HTML paragraphs.

textstring required

Plain-text version of the body.

generated_by'ai' | 'template' required
  • ai - AI
  • template - Template

Changes

No recorded changes to this operation across all 1 revision of this API.