PostHog Hog Functions API

The hog_functions API from PostHog — 20 operation(s) for hog_functions.

GitHub OpenAPI

Operations 28

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/environments/{environment_id}/hog_functions/ List Hog functions in an environment · Environments hog functions list #
Ask an LLM
“What Hog functions are set up in my legacy environment?”
“Can I filter an environment's functions by type or search their name?”
Tell an agent
List Hog functions in environment {environment_id}.
Show {type} functions in environment {environment_id} matching {search}.
POST /api/environments/{environment_id}/hog_functions/ Create a Hog function in an environment · Environments hog functions create #
Ask an LLM
“How do I add a Hog function to an environment using the legacy endpoint?”
“Can I set filters and mappings on an environment function?”
Tell an agent
Create Hog function {name} of type {type} in environment {environment_id}.
Add a {type} function {name} to environment {environment_id} with filters {filters}.
GET /api/environments/{environment_id}/hog_functions/{id}/ Get a Hog function in an environment · Environments hog functions retrieve #
Ask an LLM
“What filters and mappings does a specific Hog function in an environment have?”
“Can I look up one environment function by its ID?”
Tell an agent
Get Hog function {id} in environment {environment_id}.
Show the filters and mappings of function {id} in environment {environment_id}.
PUT /api/environments/{environment_id}/hog_functions/{id}/ Replace a Hog function in an environment · Environments hog functions update #
Ask an LLM
“How do I overwrite an existing Hog function in an environment?”
“Can I change the source code of an environment function?”
Tell an agent
Replace Hog function {id} in environment {environment_id} with code {hog}.
Overwrite function {id} in environment {environment_id} with filters {filters}.
PATCH /api/environments/{environment_id}/hog_functions/{id}/ Update a Hog function in an environment · Environments hog functions partial update #
Ask an LLM
“How do I disable just one Hog function in an environment?”
“Can I change the execution order of an environment function?”
Tell an agent
Set enabled to {enabled} on Hog function {id} in environment {environment_id}.
Move function {id} in environment {environment_id} to execution order {execution_order}.
DELETE /api/environments/{environment_id}/hog_functions/{id}/ Delete a Hog function in an environment · Environments hog functions destroy #
Ask an LLM
“Can I hard delete a Hog function from an environment?”
“Is there a permanent remove for an environment function?”
Tell an agent destructive · confirm first
Delete Hog function {id} from environment {environment_id}.
Permanently remove function {id} in environment {environment_id}.
POST /api/environments/{environment_id}/hog_functions/{id}/enable_backfills/ Enable backfills on a Hog function in an environment · Environments hog functions enable backfills create #
Ask an LLM
“How do I re-run an environment function on past events?”
“Can I turn on backfills for a legacy environment function?”
Tell an agent
Enable backfills on Hog function {id} in environment {environment_id}.
Reprocess old events with function {id} in environment {environment_id}.
POST /api/environments/{environment_id}/hog_functions/{id}/invocations/ Test a Hog function in an environment · Environments hog functions invocations create #
Ask an LLM
“How do I test a Hog function in an environment with a sample event?”
“Can I simulate a backfill invocation on an environment function?”
Tell an agent
Test Hog function {id} in environment {environment_id} with event {clickhouse_event}.
Invoke function {id} in environment {environment_id} using test configuration {configuration}.
GET /api/environments/{environment_id}/hog_functions/{id}/logs/ Get logs for a Hog function in an environment · Environments hog functions logs retrieve #
Ask an LLM
“What did a Hog function in an environment log during a backfill?”
“Can I filter an environment function's logs by level?”
Tell an agent
Show logs for Hog function {id} in environment {environment_id}.
Get {level} logs for function {id} in environment {environment_id} after {after}.
GET /api/environments/{environment_id}/hog_functions/{id}/metrics/ Get metrics for a Hog function in an environment · Environments hog functions metrics retrieve #
Ask an LLM
“How many events has a Hog function in an environment processed?”
“Can I break down an environment function's metrics by kind?”
Tell an agent
Show metrics for Hog function {id} in environment {environment_id}.
Break down function {id} metrics in environment {environment_id} by {breakdown_by}.
GET /api/environments/{environment_id}/hog_functions/{id}/metrics/totals/ Get a Hog function's execution metrics totals · Environments hog functions metrics totals retrieve #
Ask an LLM
“How many times has a Hog function run and failed over the last day?”
“Can I get a Hog function's metrics broken down by name or kind?”
Tell an agent
Show the execution totals for Hog function {id} in env {environment_id} from {after} to {before}.
Break down Hog function {id} metrics in env {environment_id} by {breakdown_by} between {after} and {before}.
GET /api/environments/{environment_id}/hog_functions/icon/ Get the icon of a Hog function environment · Environments hog functions icon retrieve #
Ask an LLM
“What icon is shown for a Hog function in the deprecated environment path?”
“Is there a Hog function icon for a legacy env endpoint?”
Tell an agent
Get the Hog function icon for environment {environment_id} using the deprecated env path.
Show the icon of the Hog function environment {environment_id}.
GET /api/environments/{environment_id}/hog_functions/icons/ List icons for Hog functions in an environment · Environments hog functions icons retrieve #
Ask an LLM
“Which Hog functions in an environment have icons?”
“Can I list all function icons in an environment?”
Tell an agent
List icons for Hog functions in environment {environment_id}.
Show the icon for each function in environment {environment_id}.
PATCH /api/environments/{environment_id}/hog_functions/rearrange/ Rearrange Hog functions in an environment · Environments hog functions rearrange partial update #
Ask an LLM
“How do I change the execution order of several Hog functions in an environment?”
“Can I reorder functions in an environment by their IDs?”
Tell an agent
Rearrange Hog functions in environment {environment_id} with orders {orders}.
Set the execution order of functions in environment {environment_id} to {orders}.
GET /api/projects/{project_id}/hog_functions/ List Hog functions in a project · Hog functions list #
Ask an LLM
“What Hog functions exist in my project?”
“Can I list only the enabled Hog functions in a project?”
Tell an agent
List Hog functions in project {project_id}.
Show {type} functions in project {project_id} with enabled {enabled}.
POST /api/projects/{project_id}/hog_functions/ Create a Hog function in a project · Hog functions create #
Ask an LLM
“How do I add a Hog function to a project?”
“Can I create a transformation Hog function in a project?”
Tell an agent
Create Hog function {name} of type {type} in project {project_id}.
Add a {type} function {name} to project {project_id} with filters {filters}.
GET /api/projects/{project_id}/hog_functions/{id}/ Get a Hog function in a project · Hog functions retrieve #
Ask an LLM
“What filters and mappings does a Hog function in my project have?”
“Can I look up one project Hog function by its ID?”
Tell an agent
Get Hog function {id} in project {project_id}.
Show the filters and mappings of function {id} in project {project_id}.
PUT /api/projects/{project_id}/hog_functions/{id}/ Replace a Hog function in a project · Hog functions update #
Ask an LLM
“How do I overwrite an existing Hog function in a project?”
“Can I change the source code of a project function?”
Tell an agent
Replace Hog function {id} in project {project_id} with code {hog}.
Overwrite function {id} in project {project_id} with filters {filters}.
PATCH /api/projects/{project_id}/hog_functions/{id}/ Update a Hog function in a project · Hog functions partial update #
Ask an LLM
“How do I disable just one Hog function in a project?”
“Can I change the execution order of a project function?”
Tell an agent
Set enabled to {enabled} on Hog function {id} in project {project_id}.
Move function {id} in project {project_id} to execution order {execution_order}.
DELETE /api/projects/{project_id}/hog_functions/{id}/ Delete a Hog function in a project · Hog functions destroy #
Ask an LLM
“Can I hard delete a Hog function from a project?”
“Is there a permanent remove for a project function?”
Tell an agent destructive · confirm first
Delete Hog function {id} from project {project_id}.
Permanently remove function {id} in project {project_id}.
POST /api/projects/{project_id}/hog_functions/{id}/enable_backfills/ Enable backfills for a Hog function · Hog functions enable backfills create #
Ask an LLM
“How do I turn on backfilling for a Hog function that already has events?”
“Can I enable backfills for a Hog function by its ID?”
Tell an agent
Enable backfills for Hog function {id} in project {project_id}.
Turn on backfilling on Hog function {id} for project {project_id}.
POST /api/projects/{project_id}/hog_functions/{id}/invocations/ Test a Hog function with a sample event · Hog functions invocations create #
Ask an LLM
“Can I test a Hog function against a sample event before it runs on live events?”
“What does a Hog function return when I invoke it with a test event?”
Tell an agent
Invoke Hog function {id} in project {project_id} with test event {clickhouse_event}.
Test Hog function {id} in project {project_id} using configuration {configuration}.
GET /api/projects/{project_id}/hog_functions/{id}/logs/ Get logs for a Hog function · Hog functions logs retrieve #
Ask an LLM
“Where can I see the execution logs of a Hog function?”
“Can I filter a Hog function's logs by level or search a message?”
Tell an agent
Show logs for Hog function {id} in project {project_id}.
Get {level} logs for Hog function {id} in project {project_id} matching {search}.
GET /api/projects/{project_id}/hog_functions/{id}/metrics/ Get execution metrics for a Hog function · Hog functions metrics retrieve #
Ask an LLM
“How many times has a Hog function executed and failed?”
“Can I break down a Hog function's metrics by kind or name?”
Tell an agent
Show metrics for Hog function {id} in project {project_id}.
Break down execution metrics for Hog function {id} in project {project_id} by {breakdown_by}.
GET /api/projects/{project_id}/hog_functions/{id}/metrics/totals/ Get total executions for a Hog function · Hog functions metrics totals retrieve #
Ask an LLM
“What is the total number of times a Hog function ran in a date range?”
“Can I get a single total for a Hog function's executions?”
Tell an agent
Get total executions for Hog function {id} in project {project_id}.
Sum Hog function {id} executions in project {project_id} from {after} to {before}.
GET /api/projects/{project_id}/hog_functions/icon/ Get the icon of Hog functions · Hog functions icon retrieve #
Ask an LLM
“What is the icon type for a Hog function?”
“Can I fetch the icon used by Hog functions?”
Tell an agent
Get the Hog function icon for project {project_id}.
Show the icon used by Hog functions in project {project_id}.
GET /api/projects/{project_id}/hog_functions/icons/ List all Hog function icons · Hog functions icons retrieve #
Ask an LLM
“Which icons are used for all the Hog functions in my project?”
“Can I get every Hog function icon at once?”
Tell an agent
List all Hog function icons in project {project_id}.
Show every icon used by Hog functions in project {project_id}.
PATCH /api/projects/{project_id}/hog_functions/rearrange/ Rearrange Hog function execution order · Hog functions rearrange partial update #
Ask an LLM
“Can I change the order in which Hog functions run?”
“How do I set execution priorities for several Hog functions at once?”
Tell an agent
Rearrange Hog functions in project {project_id} with orders {orders}.
Set execution order for Hog functions in project {project_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/posthog:posthog-hog-functions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

posthog-hog-functions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PostHog Hog Functions API
  version: 1.0.0
  description: ''
tags:


# --- truncated at 32 KB (59 KB total) ---
# Full source: https://artifacts.apis.io/posthog/openapi/posthog-hog-functions-api-openapi.yml