:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
/**
* Auto-generated from the Django backend OpenAPI schema.
* To modify these types, update the Django serializers or views, then run:
* hogli build:openapi
* Questions or issues? #team-devex on Slack
*
* PostHog API - generated
* OpenAPI spec version: 1.0.0
*/
export interface HogFunctionMappingTemplateApi {
/** Name of this mapping template. */
name: string
/**
* Whether this mapping is enabled by default.
* @nullable
*/
include_by_default?: boolean | null
/**
* Whether this mapping should match all events by default, hiding the event filter UI.
* @nullable
*/
use_all_events_by_default?: boolean | null
/** Event filters specific to this mapping. */
filters?: unknown
/** Input values specific to this mapping. */
inputs?: unknown
/** Additional input schema fields specific to this mapping. */
inputs_schema?: unknown
}
export interface HogFunctionTemplateApi {
/** Unique template identifier (e.g. 'template-slack'). */
id: string
/**
* Display name of the template.
* @maxLength 400
*/
name: string
/**
* What this template does.
* @nullable
*/
description?: string | null
/** Source code of the template. */
code: string
/**
* Programming language: 'hog' or 'javascript'.
* @maxLength 20
*/
code_language?: string
/** Schema defining configurable inputs for functions created from this template. */
inputs_schema: unknown
/**
* Function type this template creates.
* @maxLength 50
*/
type: string
/**
* Lifecycle status: alpha, beta, stable, deprecated, or hidden.
* @maxLength 20
*/
status?: string
/** Category tags for organizing templates. */
category?: unknown
/** Whether available on free plans. */
free?: boolean
/**
* URL for the template's icon.
* @nullable
*/
icon_url?: string | null
/** Default event filters. */
filters?: unknown
/** Default PII masking configuration. */
masking?: unknown
/**
* Pre-defined mapping configurations for destination templates.
* @nullable
*/
mapping_templates?: HogFunctionMappingTemplateApi[] | null
}
export interface PaginatedHogFunctionTemplateListApi {
count: number
/** @nullable */
next?: string | null
/** @nullable */
previous?: string | null
results: HogFunctionTemplateApi[]
}
/**
* * `engineering` - Engineering
* * `data` - Data
* * `product` - Product Management
* * `founder` - Founder
* * `leadership` - Leadership
* * `marketing` - Marketing
* * `sales` - Sales / Success
* * `student` - Student
* * `other` - Other
*/
export type RoleAtOrganizationEnumApi = (typeof RoleAtOrganizationEnumApi)[keyof typeof RoleAtOrganizationEnumApi]
export const RoleAtOrganizationEnumApi = {
Engineering: 'engineering',
Data: 'data',
Product: 'product',
Founder: 'founder',
Leadership: 'leadership',
Marketing: 'marketing',
Sales: 'sales',
Student: 'student',
Other: 'other',
} as const
export type BlankEnumApi = (typeof BlankEnumApi)[keyof typeof BlankEnumApi]
export const BlankEnumApi = {
'': '',
} as const
/**
* @nullable
*/
export type UserBasicApiHedgehogConfig = { [key: string]: unknown } | null
export interface UserBasicApi {
readonly id: number
readonly uuid: string
/**
* @maxLength 200
* @nullable
*/
distinct_id?: string | null
/** @maxLength 150 */
first_name?: string
/** @maxLength 150 */
last_name?: string
/** @maxLength 254 */
email: string
/** @nullable */
is_email_verified?: boolean | null
/** @nullable */
readonly hedgehog_config: UserBasicApiHedgehogConfig
role_at_organization?: RoleAtOrganizationEnumApi | BlankEnumApi | null
}
/**
* * `0` - 0
* * `1` - 1
* * `2` - 2
* * `3` - 3
* * `11` - 11
* * `12` - 12
*/
export type HogFunctionStatusStateEnumApi =
(typeof HogFunctionStatusStateEnumApi)[keyof typeof HogFunctionStatusStateEnumApi]
export const HogFunctionStatusStateEnumApi = {
Number0: 0,
Number1: 1,
Number2: 2,
Number3: 3,
Number11: 11,
Number12: 12,
} as const
export interface HogFunctionStatusApi {
state: HogFunctionStatusStateEnumApi
tokens: number
}
export type SearchMatchTypeEnumApi = (typeof SearchMatchTypeEnumApi)[keyof typeof SearchMatchTypeEnumApi]
export const SearchMatchTypeEnumApi = {
Exact: 'exact',
Similar: 'similar',
} as const
export interface HogFunctionMinimalApi {
readonly id: string
/** @nullable */
readonly type: string | null
/** @nullable */
readonly name: string | null
readonly description: string
readonly created_at: string
readonly created_by: UserBasicApi
readonly updated_at: string
readonly enabled: boolean
readonly hog: string
readonly filters: unknown
/** @nullable */
readonly icon_url: string | null
readonly template: HogFunctionTemplateApi
readonly status: HogFunctionStatusApi | null
/** @nullable */
readonly execution_order: number | null
/** How this row matched the `search` query parameter: `exact` (the term is a case-insensitive substring of a searched field) or `similar` (a fuzzy trigram match, returned only when no exact match exists). Null when the list is not filtered by `search`. */
readonly search_match_type: SearchMatchTypeEnumApi | null
/**
* When config was last staged for review, or null when nothing is staged.
* @nullable
*/
readonly draft_updated_at: string | null
}
export interface PaginatedHogFunctionMinimalListApi {
count: number
/** @nullable */
next?: string | null
/** @nullable */
previous?: string | null
results: HogFunctionMinimalApi[]
}
/**
* * `hog` - hog
* * `liquid` - liquid
*/
export type HogFunctionTemplatingEnumApi =
(typeof HogFunctionTemplatingEnumApi)[keyof typeof HogFunctionTemplatingEnumApi]
export const HogFunctionTemplatingEnumApi = {
Hog: 'hog',
Liquid: 'liquid',
} as const
export interface InputsItemApi {
value?: unknown
templating?: HogFunctionTemplatingEnumApi
readonly bytecode: readonly unknown[]
readonly bytecode_contract: string
readonly order: number
readonly transpiled: unknown
}
/**
* Values for each input defined in inputs_schema.
*/
export type HogFunctionApiInputs = { [key: string]: InputsItemApi }
/**
* * `destination` - Destination
* * `site_destination` - Site Destination
* * `internal_destination` - Internal Destination
* * `source_webhook` - Source Webhook
* * `warehouse_source_webhook` - Warehouse Source Webhook
* * `site_app` - Site App
* * `transformation` - Transformation
* * `transformation_log` - Transformation Log
* * `legacy_destination` - Legacy Destination
*/
export type HogFunctionTypeEnumApi = (typeof HogFunctionTypeEnumApi)[keyof typeof HogFunctionTypeEnumApi]
export const HogFunctionTypeEnumApi = {
Destination: 'destination',
SiteDestination: 'site_destination',
InternalDestination: 'internal_destination',
SourceWebhook: 'source_webhook',
WarehouseSourceWebhook: 'warehouse_source_webhook',
SiteApp: 'site_app',
Transformation: 'transformation',
TransformationLog: 'transformation_log',
LegacyDestination: 'legacy_destination',
} as const
/**
* * `string` - string
* * `number` - number
* * `boolean` - boolean
* * `dictionary` - dictionary
* * `choice` - choice
* * `json` - json
* * `integration` - integration
* * `integration_multi` - integration_multi
* * `integration_field` - integration_field
* * `email` - email
* * `native_email` - native_email
* * `posthog_assignee` - posthog_assignee
* * `posthog_ticket_tags` - posthog_ticket_tags
* * `posthog_business_hours` - posthog_business_hours
* * `non_failure_status_codes` - non_failure_status_codes
* * `customer_analytics_account_properties` - customer_analytics_account_properties
* * `customer_analytics_account_relationships` - customer_analytics_account_relationships
* * `task_model` - task_model
* * `task_repository` - task_repository
* * `task_mcp_installations` - task_mcp_installations
* * `signals_scout` - signals_scout
* * `posthog_survey` - posthog_survey
* * `task_skills` - task_skills
* * `replay_vision_scan` - replay_vision_scan
*/
export type InputsSchemaItemTypeEnumApi = (typeof InputsSchemaItemTypeEnumApi)[keyof typeof InputsSchemaItemTypeEnumApi]
export const InputsSchemaItemTypeEnumApi = {
String: 'string',
Number: 'number',
Boolean: 'boolean',
Dictionary: 'dictionary',
Choice: 'choice',
Json: 'json',
Integration: 'integration',
IntegrationMulti: 'integration_multi',
IntegrationField: 'integration_field',
Email: 'email',
NativeEmail: 'native_email',
PosthogAssignee: 'posthog_assignee',
PosthogTicketTags: 'posthog_ticket_tags',
PosthogBusinessHours: 'posthog_business_hours',
NonFailureStatusCodes: 'non_failure_status_codes',
CustomerAnalyticsAccountProperties: 'customer_analytics_account_properties',
CustomerAnalyticsAccountRelationships: 'customer_analytics_account_relationships',
TaskModel: 'task_model',
TaskRepository: 'task_repository',
TaskMcpInstallations: 'task_mcp_installations',
SignalsScout: 'signals_scout',
PosthogSurvey: 'posthog_survey',
TaskSkills: 'task_skills',
ReplayVisionScan: 'replay_vision_scan',
} as const
export type InputsSchemaItemApiChoicesItem = { [key: string]: unknown }
export interface InputsSchemaItemApi {
type: InputsSchemaItemTypeEnumApi
key: string
label?: string
choices?: InputsSchemaItemApiChoicesItem[]
searchable?: boolean
required?: boolean
default?: unknown
secret?: boolean
hidden?: boolean
description?: string
integration?: string
integration_key?: string
requires_field?: string
integration_field?: string
requiredScopes?: string
templating?: boolean | 'hog' | 'liquid'
}
/**
* * `events` - events
* * `internal-events` - internal-events
* * `person-updates` - person-updates
* * `data-warehouse-table` - data-warehouse-table
* * `data-warehouse-view` - data-warehouse-view
*/
export type HogFunctionFiltersSourceEnumApi =
(typeof HogFunctionFiltersSourceEnumApi)[keyof typeof HogFunctionFiltersSourceEnumApi]
export const HogFunctionFiltersSourceEnumApi = {
Events: 'events',
InternalEvents: 'internal-events',
PersonUpdates: 'person-updates',
DataWarehouseTable: 'data-warehouse-table',
DataWarehouseView: 'data-warehouse-view',
} as const
export type HogFunctionFiltersApiActionsItem = { [key: string]: unknown }
export type HogFunctionFiltersApiEventsItem = { [key: string]: unknown }
export type HogFunctionFiltersApiDataWarehouseItem = { [key: string]: unknown }
export type HogFunctionFiltersApiPropertiesItem = { [key: string]: unknown }
export interface HogFunctionFiltersApi {
source?: HogFunctionFiltersSourceEnumApi
actions?: HogFunctionFiltersApiActionsItem[]
events?: HogFunctionFiltersApiEventsItem[]
data_warehouse?: HogFunctionFiltersApiDataWarehouseItem[]
properties?: HogFunctionFiltersApiPropertiesItem[]
bytecode?: unknown
transpiled?: unknown
filter_test_accounts?: boolean
bytecode_error?: string
bytecode_contract?: string
}
export interface HogFunctionMaskingApi {
/**
* Time-to-live in seconds for the masking cache (60–86400).
* @minimum 60
* @maximum 86400
*/
ttl: number
/**
* Optional threshold count before masking applies.
* @nullable
*/
threshold?: number | null
/** Hog expression used to compute the masking hash. */
hash: string
/** Compiled bytecode for the hash expression. Auto-generated. */
bytecode?: unknown
}
export type MappingsApiInputs = { [key: string]: InputsItemApi }
export interface MappingsApi {
inputs_schema?: InputsSchemaItemApi[]
inputs?: MappingsApiInputs
name?: string
filters?: HogFunctionFiltersApi
}
export interface HogFunctionApi {
readonly id: string
/** Function type: destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, transformation, or transformation_log.
*
* * `destination` - Destination
* * `site_destination` - Site Destination
* * `internal_destination` - Internal Destination
* * `source_webhook` - Source Webhook
* * `warehouse_source_webhook` - Warehouse Source Webhook
* * `site_app` - Site App
* * `transformation` - Transformation
* * `transformation_log` - Transformation Log
* * `legacy_destination` - Legacy Destination */
type?: HogFunctionTypeEnumApi | null
/**
* Display name for the function.
* @maxLength 400
* @nullable
*/
name?: string | null
/** Human-readable description of what this function does. */
description?: string
readonly created_at: string
readonly created_by: UserBasicApi
readonly updated_at: string
/** Whether the function is active and processing events. */
enabled?: boolean
/** Soft-delete flag. Set to true to archive the function. */
deleted?: boolean
/** Source code. Hog language for most types; TypeScript for site_destination and site_app. */
hog?: string
readonly bytecode: unknown
/** @nullable */
readonly transpiled: string | null
/** Schema defining the configurable input parameters for this function. */
inputs_schema?: InputsSchemaItemApi[]
/** Values for each input defined in inputs_schema. */
inputs?: HogFunctionApiInputs
/** Event filters that control which events trigger this function. */
filters?: HogFunctionFiltersApi
/** PII masking configuration with TTL, threshold, and hash expression. */
masking?: HogFunctionMaskingApi | null
/**
* Event-to-destination field mappings. Only for destination and site_destination types.
* @nullable
*/
mappings?: MappingsApi[] | null
/**
* URL for the function's icon displayed in the UI.
* @nullable
*/
icon_url?: string | null
readonly template: HogFunctionTemplateApi
/**
* ID of the template to create this function from.
* @maxLength 400
* @nullable
*/
template_id?: string | null
readonly status: HogFunctionStatusApi | null
/**
* Execution priority for transformations. Lower values run first.
* @minimum 0
* @maximum 32767
* @nullable
*/
execution_order?: number | null
_create_in_folder?: string
/** @nullable */
readonly batch_export_id: string | null
/** How this row matched the `search` query parameter: `exact` (the term is a case-insensitive substring of a searched field) or `similar` (a fuzzy trigram match, returned only when no exact match exists). Null when the list is not filtered by `search`. */
readonly search_match_type: SearchMatchTypeEnumApi | null
/** Incremented every time the live config changes. See the revisions endpoint. */
readonly version: number
/** Config staged for review but not live yet: a full snapshot of hog, inputs_schema, inputs, filters, mappings and masking. Null when nothing is staged. Publish or discard it to clear. */
readonly draft: unknown
/**
* When config was last staged for review, or null when nothing is staged.
* @nullable
*/
readonly draft_updated_at: string | null
/** Optimistic concurrency: the updated_at (or draft_updated_at when editing a staged draft) you last read. If the stored side is newer, the write fails with 409 instead of overwriting the concurrent edit. Omit to overwrite unconditionally. */
base_updated_at?: string
}
/**
* Values for each input defined in inputs_schema.
*/
export type PatchedHogFunctionApiInputs = { [key: string]: InputsItemApi }
export interface PatchedHogFunctionApi {
readonly id?: string
/** Function type: destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, transformation, or transformation_log.
*
* * `destination` - Destination
* * `site_destination` - Site Destination
* * `internal_destination` - Internal Destination
* * `source_webhook` - Source Webhook
* * `warehouse_source_webhook` - Warehouse Source Webhook
* * `site_app` - Site App
* * `transformation` - Transformation
* * `transformation_log` - Transformation Log
* * `legacy_destination` - Legacy Destination */
type?: HogFunctionTypeEnumApi | null
/**
* Display name for the function.
* @maxLength 400
* @nullable
*/
name?: string | null
/** Human-readable description of what this function does. */
description?: string
readonly created_at?: string
readonly created_by?: UserBasicApi
readonly updated_at?: string
/** Whether the function is active and processing events. */
enabled?: boolean
/** Soft-delete flag. Set to true to archive the function. */
deleted?: boolean
/** Source code. Hog language for most types; TypeScript for site_destination and site_app. */
hog?: string
readonly bytecode?: unknown
/** @nullable */
readonly transpiled?: string | null
/** Schema defining the configurable input parameters for this function. */
inputs_schema?: InputsSchemaItemApi[]
/** Values for each input defined in inputs_schema. */
inputs?: PatchedHogFunctionApiInputs
/** Event filters that control which events trigger this function. */
filters?: HogFunctionFiltersApi
/** PII masking configuration with TTL, threshold, and hash expression. */
masking?: HogFunctionMaskingApi | null
/**
* Event-to-destination field mappings. Only for destination and site_destination types.
* @nullable
*/
mappings?: MappingsApi[] | null
/**
* URL for the function's icon displayed in the UI.
* @nullable
*/
icon_url?: string | null
readonly template?: HogFunctionTemplateApi
/**
* ID of the template to create this function from.
* @maxLength 400
* @nullable
*/
template_id?: string | null
readonly status?: HogFunctionStatusApi | null
/**
* Execution priority for transformations. Lower values run first.
* @minimum 0
* @maximum 32767
* @nullable
*/
execution_order?: number | null
_create_in_folder?: string
/** @nullable */
readonly batch_export_id?: string | null
/** How this row matched the `search` query parameter: `exact` (the term is a case-insensitive substring of a searched field) or `similar` (a fuzzy trigram match, returned only when no exact match exists). Null when the list is not filtered by `search`. */
readonly search_match_type?: SearchMatchTypeEnumApi | null
/** Incremented every time the live config changes. See the revisions endpoint. */
readonly version?: number
/** Config staged for review but not live yet: a full snapshot of hog, inputs_schema, inputs, filters, mappings and masking. Null when nothing is staged. Publish or discard it to clear. */
readonly draft?: unknown
/**
* When config was last staged for review, or null when nothing is staged.
* @nullable
*/
readonly draft_updated_at?: string | null
/** Optimistic concurrency: the updated_at (or draft_updated_at when editing a staged draft) you last read. If the stored side is newer, the write fails with 409 instead of overwriting the concurrent edit. Omit to overwrite unconditionally. */
base_updated_at?: string
}
/**
* Mock global variables available during test invocation.
*/
export type HogFunctionInvocationApiGlobals = { [key: string]: unknown }
/**
* Mock ClickHouse event data to test the function with.
*/
export type HogFunctionInvocationApiClickhouseEvent = { [key: string]: unknown }
export interface HogFunctionInvocationApi {
/** Full function configuration to test. Omit when use_draft is true. */
configuration?: HogFunctionApi
/** Test the function's staged draft instead of passing a configuration. Staged secret inputs are used; secrets the draft doesn't change fall back to the live values. 400 when nothing is staged. */
use_draft?: boolean
/** Mock global variables available during test invocation. */
globals?: HogFunctionInvocationApiGlobals
/** Mock ClickHouse event data to test the function with. */
clickhouse_event?: HogFunctionInvocationApiClickhouseEvent
/** When true (default), async functions like fetch() are simulated. */
mock_async_functions?: boolean
/** Invocation result status. */
readonly status: string
/** Execution logs from the test invocation. */
readonly logs: readonly unknown[]
/**
* Optional invocation ID for correlation.
* @nullable
*/
invocation_id?: string | null
}
export interface AppMetricSeriesApi {
name: string
values: number[]
}
export interface AppMetricsResponseApi {
labels: string[]
series: AppMetricSeriesApi[]
}
export type AppMetricsTotalsResponseApiTotals = { [key: string]: number }
export interface AppMetricsTotalsResponseApi {
totals: AppMetricsTotalsResponseApiTotals
}
export interface HogFunctionPublishRequestApi {
/** False (default) previews the publish: returns which config fields would change without changing anything. True applies the staged draft to the live function. */
confirm?: boolean
/** 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. */
confirm_token?: string
}
export interface HogFunctionPublishResponseApi {
/** Whether the draft was applied to the live function. */
published: boolean
/**
* The staged draft's timestamp, for reference; publishing is confirmed via confirm_token.
* @nullable
*/
draft_updated_at: string | null
/**
* Echo this back with confirm=true to publish the previewed draft. Only set on previews.
* @nullable
*/
confirm_token: string | null
/**
* Config fields publishing would change (hog, inputs_schema, inputs, filters, mappings, masking). Only set on previews.
* @nullable
*/
changed_fields: string[] | null
/** The function after publishing (only set when published=true). */
function?: HogFunctionApi | null
}
/**
* * `running` - running
* * `succeeded` - succeeded
* * `failed` - failed
* * `canceled` - canceled
*/
export type HogInvocationRerunFilterStatusEnumApi =
(typeof HogInvocationRerunFilterStatusEnumApi)[keyof typeof HogInvocationRerunFilterStatusEnumApi]
export const HogInvocationRerunFilterStatusEnumApi = {
Running: 'running',
Succeeded: 'succeeded',
Failed: 'failed',
Canceled: 'canceled',
} as const
/**
* Filter shape for the rerun endpoint. `window_start`/`window_end` are required.
*/
export interface HogInvocationRerunFilterApi {
/** Inclusive lower bound on `scheduled_at` (UTC). */
window_start: string
/** Exclusive upper bound on `scheduled_at` (UTC). */
window_end: string
/** Restrict to invocations whose latest status is one of these. Defaults to ['failed']. */
status?: HogInvocationRerunFilterStatusEnumApi[]
/** Restrict to invocations whose error_kind matches one of these (e.g. 'http_5xx', 'timeout'). */
error_kind?: string[]
/**
* Restrict to invocations whose error_message contains this substring (case-insensitive). Use to isolate one failure mode when error_kind is too coarse (most app-level errors share the 'hog_error' kind).
* @maxLength 200
*/
error_message_contains?: string
/**
* Skip invocations that have already been attempted this many times or more.
* @minimum 1
* @maximum 255
*/
max_attempts?: number
/**
* Maximum number of invocations to rerun in this request. Server-side cap is 10000.
* @minimum 1
* @maximum 10000
*/
max_count?: number
/**
* Optional restriction to specific invocation IDs within the window. Capped at 10000 per request. Always combined with `window_start`/`window_end` so the ClickHouse query can be partition-pruned.
* @maxItems 10000
*/
invocation_ids?: string[]
}
/**
* Rerun invocations of a hog function or hog flow from their stored payloads.
*/
export interface HogInvocationRerunRequestApi {
/** Required. `window_start` / `window_end` pin the query to a small set of date partitions on the `hog_invocation_results` table. Optional `invocation_ids` restricts to specific invocations within that window. */
filter: HogInvocationRerunFilterApi
}
/**
* Response from the rerun endpoint. The endpoint only enqueues a wrapper
* job onto the cyclotron `rerun` queue — the actual ClickHouse paging and
* re-enqueue work happens asynchronously in the `cdp-rerun-worker` service.
* Use `rerun_job_id` to look up progress on the wrapper job later.
*/
export interface HogInvocationRerunResponseApi {
/** ID of the cyclotron wrapper job that will run the rerun. Use this to poll status. */
rerun_job_id: string
/** Always 0 — rerun runs asynchronously. Kept for response shape stability. */
queued_count: number
/** Always 0 — rerun runs asynchronously. Kept for response shape stability. */
skipped_count: number
}
export interface HogFunctionRevisionBasicApi {
/** Function version this snapshot was published as. */
readonly version: number
readonly created_at: string
readonly created_by: UserBasicApi | null
}
export interface PaginatedHogFunctionRevisionBasicListApi {
count: number
/** @nullable */
next?: string | null
/** @nullable */
previous?: string | null
results: HogFunctionRevisionBasicApi[]
}
export interface HogFunctionRevisionApi {
/** Function version this snapshot was published as. */
readonly version: number
readonly created_at: string
readonly created_by: UserBasicApi | null
/** Full snapshot of the function's config fields (hog, inputs_schema, inputs, filters, mappings, masking) at this version. */
readonly content: unknown
}
export interface HogFunctionRevisionRestoreRequestApi {
/** Replace the open staged draft with this revision's config. Without it, restoring while a draft is open returns 409. */
overwrite?: boolean
}
export interface HogFunctionMaskedSecretApi {
/** ID of the hog function. */
id: string
/** Name of the hog function. */
name: string
/** Hog function type, for example 'destination'. */
type: string
/** Whether the hog function is enabled. */
enabled: boolean
/** Keys of the live secret inputs to enter again. Only keys are returned, never values. */
input_keys: string[]
/** Keys of the staged draft's secret inputs to enter again. Only keys are returned. */
draft_input_keys: string[]
}
/**
* Map of hog function UUIDs to their new execution_order values.
*/
export type PatchedHogFunctionRearrangeApiOrders = { [key: string]: number }
export interface PatchedHogFunctionRearrangeApi {
/** Map of hog function UUIDs to their new execution_order values. */
orders?: PatchedHogFunctionRearrangeApiOrders
}
/**
* * `SYSTEM` - SYSTEM
* * `PLUGIN` - PLUGIN
* * `CONSOLE` - CONSOLE
*/
export type PluginLogEntrySourceEnumApi = (typeof PluginLogEntrySourceEnumApi)[keyof typeof PluginLogEntrySourceEnumApi]
export const PluginLogEntrySourceEnumApi = {
System: 'SYSTEM',
Plugin: 'PLUGIN',
Console: 'CONSOLE',
} as const
/**
* * `DEBUG` - Debug
* * `LOG` - Log
* * `INFO` - Info
* * `WARN` - Warn
* * `ERROR` - Error
*/
export type PluginLogEntryTypeEnumApi = (typeof PluginLogEntryTypeEnumApi)[keyof typeof PluginLogEntryTypeEnumApi]
export const PluginLogEntryTypeEnumApi = {
Debug: 'DEBUG',
Log: 'LOG',
Info: 'INFO',
Warn: 'WARN',
Error: 'ERROR',
} as const
export interface PluginLogEntryApi {
id: string
team_id: number
plugin_id: number
plugin_config_id: number
timestamp: string
source: PluginLogEntrySourceEnumApi
type: PluginLogEntryTypeEnumApi
message: string
instance_id: string
}
export interface PaginatedPluginLogEntryListApi {
count: number
/** @nullable */
next?: string | null
/** @nullable */
previous?: string | null
results: PluginLogEntryApi[]
}
export type HogFunctionTemplatesListParams = {
/**
* Number of results to return per page.
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
/**
* Filter to a specific template by its template_id. Deprecated templates are excluded from list results; use the retrieve endpoint to look up a template by ID regardless of status.
*/
template_id?: string
/**
* Filter by template type (e.g. destination, email, sms_provider, broadcast). Defaults to destination if neither type nor types is provided.
*/
type?: string
/**
* Comma-separated list of template types to include (e.g. destination,email,sms_provider).
*/
types?: string
}
export type HogFunctionsListParams = {
created_at?: string
created_by?: number
enabled?: boolean
id?: string
/**
* Number of results to return per page.
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
/**
* Multiple values may be separated by commas.
*/
type?: string[]
updated_at?: string
}
export type HogFunctionsLogsRetrieveParams = {
/**
* Only return entries after this ISO 8601 timestamp. Defaults to 7 days ago; pass an explicit value to read further back.
*/
after?: string
/**
* Only return entries before this ISO 8601 timestamp.
*/
before?: string
/**
* Filter logs to a specific execution instance.
* @minLength 1
*/
instance_id?: string
/**
* Comma-separated log levels to include, e.g. 'WARN,ERROR'. Valid levels: DEBUG, LOG, INFO, WARN, ERROR.
* @minLength 1
*/
level?: string
/**
* Maximum number of log entries to return (1-500, default 50).
* @minimum 1
* @maximum 500
*/
limit?: number
/**
* Number of log entries to skip before the first returned entry (default 0).
* @minimum 0
*/
offset?: number
/**
* Case-insensitive substring search across log messages.
* @minLength 1
*/
search?: string
}
export type HogFunctionsMetricsRetrieveParams = {
/**
* Start of the time range. Accepts relative formats like '-7d', '-24h' or ISO 8601 timestamps. Defaults to '-7d'.
* @minLength 1
*/
after?: string
/**
* End of the time range. Same format as 'after'. Defaults to now.
* @minLength 1
*/
before?: string
/**
* Group the series by metric 'name' or 'kind'. Defaults to 'kind'.
*
* * `name` - name
* * `kind` - kind
* @minLength 1
*/
breakdown_by?: HogFunctionsMetricsRetrieveBreakdownBy
/**
* Filter metrics to a specific execution instance.
* @minLength 1
*/
instance_id?: string
/**
* Time bucket size for the series. One of: hour, day, week. Defaults to 'day'.
*
* * `hour` - hour
* * `day` - day
* * `week` - week
* @minLength 1
*/
interval?: HogFunctionsMetricsRetrieveInterval
/**
* Comma-separated metric kinds to filter by, up to 50, e.g. 'success,failure'. With breakdown_by=kind, each named kind is returned, as zeros when it has no rows.
* @minLength 1
*/
kind?: string
/**
* Comma-separated metric names to filter by, up to 50. With breakdown_by=name, each named metric is returned, as zeros when it has no rows.
* @minLength 1
*/
name?: string
}
export type HogFunctionsMetricsRetrieveBreakdownBy =
(typeof HogFunctionsMetricsRetrieveBreakdownBy)[keyof typeof HogFunctionsMetricsRetrieveBreakdownBy]
export const HogFunctionsMetricsRetrieveBreakdownBy = {
Name: 'name',
Kind: 'kind',
} as const
export type HogFunctionsMetricsRetrieveInterval =
(typeof HogFunctionsMetricsRetrieveInterval)[keyof typeof HogFunctionsMetricsRetrieveInterval]
export const HogFunctionsMetricsRetrieveInterval = {
Hour: 'hour',
Day: 'day',
Week: 'week',
} as const
export type HogFunctionsMetricsTotalsRetrieveParams = {
/**
* Start of the time range. Accepts relative formats like '-7d', '-24h' or ISO 8601 timestamps. Defaults to '-7d'.
* @minLength 1
*/
after?: string
/**
* End of the time range. Same format as 'after'. Defaults to now.
* @minLength 1
*/
before?: string
/**
* Group the series by metric 'name' or 'kind'. Defaults to 'kind'.
*
* * `name` - name
* * `kind` - kind
* @minLength 1
*/
breakdown_by?: HogFunctionsMetricsTotalsRetrieveBreakdownBy
/**
* Filter metrics to a specific execution instance.
* @minLength 1
*/
instance_id?: string
/**
* Time bucket size for the series. One of: hour, day, week. Defaults to 'day'.
*
* * `hour` - hour
* * `day` - day
* * `week` - week
* @minLength 1
*/
interval?: HogFunctionsMetricsTotalsRetrieveInterval
/**
* Comma-separated metric kinds to filter by, up to 50, e.g. 'success,failure'. With breakdown_by=kind, each named kind is returned, as zeros when it has no rows.
* @minLength 1
*/
kind?: string
/**
* Comma-separated metric names to filter by, up to 50. With breakdown_by=name, each named metric is returned, as zeros when it has no rows.
* @minLength 1
*/
name?: string
}
export type HogFunctionsMetricsTotalsRetrieveBreakdownBy =
(typeof HogFunctionsMetricsTotalsRetrieveBreakdownBy)[keyof typeof HogFunctionsMetricsTotalsRetrieveBreakdownBy]
export const HogFunctionsMetricsTotalsRetrieveBreakdownBy = {
Name: 'name',
Kind: 'kind',
} as const
export type HogFunctionsMetricsTotalsRetrieveInterval =
(typeof HogFunctionsMetricsTotalsRetrieveInterval)[keyof typeof HogFunctionsMetricsTotalsRetrieveInterval]
export const HogFunctionsMetricsTotalsRetrieveInterval = {
Hour: 'hour',
Day: 'day',
Week: 'week',
} as const
export type HogFunctionsRevisionsListParams = {
/**
* Number of results to return per page.
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
}
export type PluginConfigsLogsListParams = {
/**
* Only return entries after this ISO 8601 timestamp.
*/
after?: string
/**
* Only return entries before this ISO 8601 timestamp.
*/
before?: string
/**
* Maximum number of log entries to return (1-1000, default 100).
* @minimum 1
* @maximum 1000
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
/**
* Case-insensitive substring search across log messages.
*/
search?: string
/**
* Log types to include. Repeat the parameter to include more than one type.
*/
type_filter?: PluginConfigsLogsListTypeFilterItem[]
}
/**
* * `DEBUG` - Debug
* * `LOG` - Log
* * `INFO` - Info
* * `WARN` - Warn
* * `ERROR` - Error
*/
export type PluginConfigsLogsListTypeFilterItem =
(typeof PluginConfigsLogsListTypeFilterItem)[keyof typeof PluginConfigsLogsListTypeFilterItem]
export const PluginConfigsLogsListTypeFilterItem = {
Debug: 'DEBUG',
Log: 'LOG',
Info: 'INFO',
Warn: 'WARN',
Error: 'ERROR',
} as const
export type PublicHogFunctionTemplatesListParams = {
/**
* Number of results to return per page.
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
/**
* Filter to a specific template by its template_id. Deprecated templates are excluded from list results; use the retrieve endpoint to look up a template by ID regardless of status.
*/
template_id?: string
/**
* Filter by template type (e.g. destination, email, sms_provider, broadcast). Defaults to destination if neither type nor types is provided.
*/
type?: string
/**
* Comma-separated list of template types to include (e.g. destination,email,sms_provider).
*/
types?: string
}