Data pipelines API

Contents

Use the API when you want pipelines to live in your own configuration rather than being clicked together in the UI – provisioning the same destinations across projects, keeping function definitions in version control, or wiring pipeline changes into your deploy process.

What's available

Hog functions

Every source, transformation, destination, and web script is a Hog function, so a single set of endpoints covers all of them. You can list and filter functions by type, create one from a template or from raw Hog code, update its inputs and filters, reorder transformation execution, and delete it. See the Hog functions API reference.

Batch exports

Batch exports have their own endpoints for listing, creating, updating, and deleting scheduled exports, plus inspecting individual runs. See the batch exports API reference.

Authentication

Use a personal API key with the appropriate scopes, passed as a bearer token:

Terminal
curl -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
https://us.posthog.com/api/projects/:project_id/hog_functions/

Reading requires hog_function:read and writing requires hog_function:write. Grant only what the integration needs – a key that can write functions can also change where your event data is sent.

Community questions

Was this page useful?