hog_functions
hog_functions

post/api/projects/{project_id}/hog_functions/{id}/publish/

Request

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

Path parameters

idstring uuid required

A UUID string identifying this hog function.

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

confirmboolean

False (default) previews the publish: returns which config fields would change without changing anything. True applies the staged draft to the live function.

confirm_tokenstring

From the preview response, and required when confirm=true on an enabled function. Expires after 15 minutes, and any edit to the draft or the live config invalidates it (409), so you always publish the exact draft you previewed.

Response

publishedboolean required

Whether the draft was applied to the live function.

draft_updated_atstring date-time nullable required

The staged draft's timestamp, for reference; publishing is confirmed via confirm_token.

confirm_tokenstring nullable required

Echo this back with confirm=true to publish the previewed draft. Only set on previews.

changed_fieldsstring[] nullable required

Config fields publishing would change (hog, inputs_schema, inputs, filters, mappings, masking). Only set on previews.

Changes

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