Hog functions
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
POST | |
POST | |
GET | |
GET | |
POST | |
GET | |
GET | |
PATCH |
Retrieve hog functions metrics
Required API key scopes
hog_function:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /metricsExample response
Status 200
Retrieve hog functions metrics
Required API key scopes
hog_function:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /metricsExample response
Status 200
Retrieve hog functions metrics totals
Required API key scopes
hog_function:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /metrics /totalsExample response
Status 200
Retrieve hog functions metrics totals
Required API key scopes
hog_function:readPath parameters
- idstring
Query parameters
- afterstringDefault:
-7d - beforestring
- breakdown_bystringDefault:
kindOne of:"name""kind" - instance_idstring
- intervalstringDefault:
dayOne of:"hour""day""week" - kindstring
- namestring
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /metrics /totalsExample response
Status 200
Create hog functions publish
Required API key scopes
hog_function:writePath parameters
- idstring
Request parameters
- confirmbooleanDefault:
false - confirm_tokenstring
Response
Example request
POST /api /projects /:project_id /hog_functions /:id /publishExample response
Status 200
Create hog functions publish
Required API key scopes
hog_function:writePath parameters
- idstring
Request parameters
- confirmbooleanDefault:
false - confirm_tokenstring
Response
Example request
POST /api /projects /:project_id /hog_functions /:id /publishExample response
Status 200
Create hog functions rerun
Rerun past invocations of this hog function from their stored payloads.
The CDP worker reads matching rows from the hog_invocation_results
ClickHouse table, rehydrates the invocation from the stored
invocation_globals, and re-enqueues onto cyclotron. Each rerun
run reuses the original invocation_id with is_retry=1 set on the
new lifecycle row so the UI can surface that it was a rerun.
Only types a cyclotron worker executes (TYPES_THAT_CAN_RERUN) can be
rerun: rerun re-enqueues onto the cyclotron hog queue, and other types
run elsewhere (source webhooks inline in the cdp-api HTTP handler,
transformations during ingestion, site_* transpiled to client-side
JS). A re-enqueued invocation of one of those would never drain and
wedges the partition, so a rerun of a non-rerunnable type is rejected
with a 400 here.
Because rerun replays historical event/person/group data, it requires
person:read and group:read on top of hog_function:write.
Required API key scopes
hog_function:writeperson:readgroup:readPath parameters
- idstring
Request parameters
- filter
Response
Example request
POST /api /projects /:project_id /hog_functions /:id /rerunExample response
Status 200
Status 400
Create hog functions rerun
Rerun past invocations of this hog function from their stored payloads.
The CDP worker reads matching rows from the hog_invocation_results
ClickHouse table, rehydrates the invocation from the stored
invocation_globals, and re-enqueues onto cyclotron. Each rerun
run reuses the original invocation_id with is_retry=1 set on the
new lifecycle row so the UI can surface that it was a rerun.
Only types a cyclotron worker executes (TYPES_THAT_CAN_RERUN) can be
rerun: rerun re-enqueues onto the cyclotron hog queue, and other types
run elsewhere (source webhooks inline in the cdp-api HTTP handler,
transformations during ingestion, site_* transpiled to client-side
JS). A re-enqueued invocation of one of those would never drain and
wedges the partition, so a rerun of a non-rerunnable type is rejected
with a 400 here.
Because rerun replays historical event/person/group data, it requires
person:read and group:read on top of hog_function:write.
Required API key scopes
hog_function:writeperson:readgroup:readPath parameters
- idstring
Request parameters
- filter
Response
Example request
POST /api /projects /:project_id /hog_functions /:id /rerunExample response
Status 200
Status 400
List all hog functions revisions
Required API key scopes
hog_function:readPath parameters
- idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /revisionsExample response
Status 200
List all hog functions revisions
Required API key scopes
hog_function:readPath parameters
- idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /revisionsExample response
Status 200
Retrieve hog functions revisions
Required API key scopes
hog_function:readPath parameters
- idstring
- versioninteger
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /revisions /:versionExample response
Status 200
Retrieve hog functions revisions
Required API key scopes
hog_function:readPath parameters
- idstring
- versioninteger
Response
Example request
GET /api /projects /:project_id /hog_functions /:id /revisions /:versionExample response
Status 200
Create hog functions revisions restore
Required API key scopes
hog_function:writePath parameters
- idstring
- versioninteger
Request parameters
- overwritebooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /hog_functions /:id /revisions /:version /restoreExample response
Status 200
Create hog functions revisions restore
Required API key scopes
hog_function:writePath parameters
- idstring
- versioninteger
Request parameters
- overwritebooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /hog_functions /:id /revisions /:version /restoreExample response
Status 200
Retrieve hog functions icon
Example request
GET /api /projects /:project_id /hog_functions /iconExample response
Status 200 No response body
Retrieve hog functions icon
Example request
GET /api /projects /:project_id /hog_functions /iconExample response
Status 200 No response body
Retrieve hog functions icons
Example request
GET /api /projects /:project_id /hog_functions /iconsExample response
Status 200 No response body
Retrieve hog functions icons
Example request
GET /api /projects /:project_id /hog_functions /iconsExample response
Status 200 No response body
Update hog functions rearrange
Update the execution order of multiple HogFunctions.
Required API key scopes
hog_function:writeRequest parameters
- ordersobject
Example request
PATCH /api /projects /:project_id /hog_functions /rearrangeExample response
Status 200
Update hog functions rearrange
Update the execution order of multiple HogFunctions.
Required API key scopes
hog_function:writeRequest parameters
- ordersobject
Example request
PATCH /api /projects /:project_id /hog_functions /rearrange