: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
*/
/**
* * `vercel` - Vercel
*/
export type OrganizationIntegrationKindEnumApi =
(typeof OrganizationIntegrationKindEnumApi)[keyof typeof OrganizationIntegrationKindEnumApi]
export const OrganizationIntegrationKindEnumApi = {
Vercel: 'vercel',
} as const
/**
* * `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
}
/**
* Serializer for organization-level integrations.
*/
export interface PatchedOrganizationIntegrationApi {
readonly id?: string
readonly kind?: OrganizationIntegrationKindEnumApi
/** @nullable */
readonly integration_id?: string | null
readonly config?: unknown
readonly created_at?: string
readonly updated_at?: string
readonly created_by?: UserBasicApi
}
/**
* Serializer for organization-level integrations.
*/
export interface OrganizationIntegrationApi {
readonly id: string
readonly kind: OrganizationIntegrationKindEnumApi
/** @nullable */
readonly integration_id: string | null
readonly config: unknown
readonly created_at: string
readonly updated_at: string
readonly created_by: UserBasicApi
}
export interface RoleExternalReferenceApi {
readonly id: string
/**
* Integration kind (e.g., github, linear, jira, slack).
* @maxLength 32
*/
provider: string
/**
* Provider organization/workspace/site identifier.
* @maxLength 255
*/
provider_organization_id: string
/**
* Stable provider role identifier.
* @maxLength 255
*/
provider_role_id: string
/**
* Human-friendly provider role identifier.
* @maxLength 255
* @nullable
*/
provider_role_slug?: string | null
/**
* Display name of the provider role.
* @maxLength 255
*/
provider_role_name: string
/** PostHog role UUID this external role maps to. */
role: string
readonly created_at: string
readonly created_by: UserBasicApi
}
export interface PaginatedRoleExternalReferenceListApi {
count: number
/** @nullable */
next?: string | null
/** @nullable */
previous?: string | null
results: RoleExternalReferenceApi[]
}
export interface RoleLookupResponseApi {
/** Matching reference, or null if none exists. */
reference: RoleExternalReferenceApi | null
}
/**
* * `oauth` - OAuth
* * `token` - Token
* * `credentials` - Credentials
*/
export type IntegrationAuthTypeEnumApi = (typeof IntegrationAuthTypeEnumApi)[keyof typeof IntegrationAuthTypeEnumApi]
export const IntegrationAuthTypeEnumApi = {
Oauth: 'oauth',
Token: 'token',
Credentials: 'credentials',
} as const
/**
* * `connected` - connected
* * `unavailable` - unavailable
*/
export type InstallationStatusEnumApi = (typeof InstallationStatusEnumApi)[keyof typeof InstallationStatusEnumApi]
export const InstallationStatusEnumApi = {
Connected: 'connected',
Unavailable: 'unavailable',
} as const
/**
* Standard Integration serializer.
*/
export interface IntegrationConfigApi {
readonly id: number
/**
* The provider of the integration, for example 'slack' or 'github'. A create accepts only the kinds that PostHog connects here. Data warehouse sources also store their typed-in credentials as integrations, under a kind per source type.
* @maxLength 32
*/
kind: string
/** How this integration authenticates with the provider: `oauth` for a connection the provider manages (an OAuth grant or an app installation), `token` for one static secret, or `credentials` for several typed-in fields. A kind can have several auth types.
*
* * `oauth` - OAuth
* * `token` - Token
* * `credentials` - Credentials */
readonly auth_type: IntegrationAuthTypeEnumApi
config?: unknown
readonly created_at: string
readonly created_by: UserBasicApi
readonly errors: string
readonly display_name: string
/** Slack only: whether reconnecting can request the files:write scope. */
readonly files_write_requestable: boolean
/**
* GitHub only, null otherwise. Whether another project's GitHub integration references the same App installation. When false, disconnecting this integration also uninstalls the GitHub App from the connected account or organization and removes personal GitHub connections that share it.
* @nullable
*/
readonly installation_shared: boolean | null
/** GitHub only, null otherwise. `unavailable` means the App was uninstalled or suspended on GitHub and PostHog can no longer mint tokens for it; `connected` otherwise. */
readonly installation_status: InstallationStatusEnumApi | null
/**
* Linear only, null otherwise. True when the workspace last authorized PostHog before the Linear app had webhooks, so linked error tracking issues may not follow their tickets until someone reconnects it.
* @nullable
*/
readonly needs_webhook_reconnect: boolean | null
}
export interface PaginatedIntegrationConfigListApi {
count: number
/** @nullable */
next?: string | null
/** @nullable */
previous?: string | null
results: IntegrationConfigApi[]
}
/**
* * `anthropic` - Anthropic
* * `apple-ads` - Apple Ads
* * `apns` - Apple Push
* * `aws-redshift` - Aws Redshift
* * `aws-s3` - Aws S3
* * `azure-blob` - Azure Blob
* * `bing-ads` - Bing Ads
* * `clickup` - Clickup
* * `customerio-app` - Customerio App
* * `customerio-track` - Customerio Track
* * `customerio-webhook` - Customerio Webhook
* * `databricks` - Databricks
* * `email` - Email
* * `firebase` - Firebase
* * `github` - Github
* * `gitlab` - Gitlab
* * `google-ads` - Google Ads
* * `google-analytics` - Google Analytics
* * `google-calendar` - Google Calendar
* * `google-cloud-service-account` - Google Cloud Service Account
* * `google-cloud-storage` - Google Cloud Storage
* * `google-pubsub` - Google Pubsub
* * `google-search-console` - Google Search Console
* * `google-sheets` - Google Sheets
* * `helpscout` - Helpscout
* * `hubspot` - Hubspot
* * `instagram` - Instagram
* * `intercom` - Intercom
* * `jira` - Jira
* * `linear` - Linear
* * `linkedin-ads` - Linkedin Ads
* * `meta-ads` - Meta Ads
* * `pardot` - Pardot
* * `pinterest-ads` - Pinterest Ads
* * `postgresql` - Postgresql
* * `posthog` - Posthog
* * `reddit-ads` - Reddit Ads
* * `twitter-ads` - Twitter Ads
* * `resend` - Resend
* * `s3-compatible` - S3 Compatible
* * `salesforce` - Salesforce
* * `slack` - Slack
* * `slack-posthog-code` - Slack Posthog Code
* * `snapchat` - Snapchat
* * `snowflake` - Snowflake
* * `stripe` - Stripe
* * `tiktok-ads` - Tiktok Ads
* * `twilio` - Twilio
* * `vercel` - Vercel
* * `youtube-analytics` - Youtube Analytics
*/
export type IntegrationKindEnumApi = (typeof IntegrationKindEnumApi)[keyof typeof IntegrationKindEnumApi]
export const IntegrationKindEnumApi = {
Anthropic: 'anthropic',
AppleAds: 'apple-ads',
Apns: 'apns',
AwsRedshift: 'aws-redshift',
AwsS3: 'aws-s3',
AzureBlob: 'azure-blob',
BingAds: 'bing-ads',
Clickup: 'clickup',
CustomerioApp: 'customerio-app',
CustomerioTrack: 'customerio-track',
CustomerioWebhook: 'customerio-webhook',
Databricks: 'databricks',
Email: 'email',
Firebase: 'firebase',
Github: 'github',
Gitlab: 'gitlab',
GoogleAds: 'google-ads',
GoogleAnalytics: 'google-analytics',
GoogleCalendar: 'google-calendar',
GoogleCloudServiceAccount: 'google-cloud-service-account',
GoogleCloudStorage: 'google-cloud-storage',
GooglePubsub: 'google-pubsub',
GoogleSearchConsole: 'google-search-console',
GoogleSheets: 'google-sheets',
Helpscout: 'helpscout',
Hubspot: 'hubspot',
Instagram: 'instagram',
Intercom: 'intercom',
Jira: 'jira',
Linear: 'linear',
LinkedinAds: 'linkedin-ads',
MetaAds: 'meta-ads',
Pardot: 'pardot',
PinterestAds: 'pinterest-ads',
Postgresql: 'postgresql',
Posthog: 'posthog',
RedditAds: 'reddit-ads',
TwitterAds: 'twitter-ads',
Resend: 'resend',
S3Compatible: 's3-compatible',
Salesforce: 'salesforce',
Slack: 'slack',
SlackPosthogCode: 'slack-posthog-code',
Snapchat: 'snapchat',
Snowflake: 'snowflake',
Stripe: 'stripe',
TiktokAds: 'tiktok-ads',
Twilio: 'twilio',
Vercel: 'vercel',
YoutubeAnalytics: 'youtube-analytics',
} as const
/**
* The request schema of a create. A create accepts only the public kinds, so the schema lists them.
*/
export interface IntegrationConfigCreateApi {
readonly id: number
/** The provider of the integration, for example 'slack' or 'github'.
*
* * `anthropic` - Anthropic
* * `apple-ads` - Apple Ads
* * `apns` - Apple Push
* * `aws-redshift` - Aws Redshift
* * `aws-s3` - Aws S3
* * `azure-blob` - Azure Blob
* * `bing-ads` - Bing Ads
* * `clickup` - Clickup
* * `customerio-app` - Customerio App
* * `customerio-track` - Customerio Track
* * `customerio-webhook` - Customerio Webhook
* * `databricks` - Databricks
* * `email` - Email
* * `firebase` - Firebase
* * `github` - Github
* * `gitlab` - Gitlab
* * `google-ads` - Google Ads
* * `google-analytics` - Google Analytics
* * `google-calendar` - Google Calendar
* * `google-cloud-service-account` - Google Cloud Service Account
* * `google-cloud-storage` - Google Cloud Storage
* * `google-pubsub` - Google Pubsub
* * `google-search-console` - Google Search Console
* * `google-sheets` - Google Sheets
* * `helpscout` - Helpscout
* * `hubspot` - Hubspot
* * `instagram` - Instagram
* * `intercom` - Intercom
* * `jira` - Jira
* * `linear` - Linear
* * `linkedin-ads` - Linkedin Ads
* * `meta-ads` - Meta Ads
* * `pardot` - Pardot
* * `pinterest-ads` - Pinterest Ads
* * `postgresql` - Postgresql
* * `posthog` - Posthog
* * `reddit-ads` - Reddit Ads
* * `twitter-ads` - Twitter Ads
* * `resend` - Resend
* * `s3-compatible` - S3 Compatible
* * `salesforce` - Salesforce
* * `slack` - Slack
* * `slack-posthog-code` - Slack Posthog Code
* * `snapchat` - Snapchat
* * `snowflake` - Snowflake
* * `stripe` - Stripe
* * `tiktok-ads` - Tiktok Ads
* * `twilio` - Twilio
* * `vercel` - Vercel
* * `youtube-analytics` - Youtube Analytics */
kind: IntegrationKindEnumApi
/** How this integration authenticates with the provider: `oauth` for a connection the provider manages (an OAuth grant or an app installation), `token` for one static secret, or `credentials` for several typed-in fields. A kind can have several auth types.
*
* * `oauth` - OAuth
* * `token` - Token
* * `credentials` - Credentials */
readonly auth_type: IntegrationAuthTypeEnumApi
config?: unknown
readonly created_at: string
readonly created_by: UserBasicApi
readonly errors: string
readonly display_name: string
/** Slack only: whether reconnecting can request the files:write scope. */
readonly files_write_requestable: boolean
/**
* GitHub only, null otherwise. Whether another project's GitHub integration references the same App installation. When false, disconnecting this integration also uninstalls the GitHub App from the connected account or organization and removes personal GitHub connections that share it.
* @nullable
*/
readonly installation_shared: boolean | null
/** GitHub only, null otherwise. `unavailable` means the App was uninstalled or suspended on GitHub and PostHog can no longer mint tokens for it; `connected` otherwise. */
readonly installation_status: InstallationStatusEnumApi | null
/**
* Linear only, null otherwise. True when the workspace last authorized PostHog before the Linear app had webhooks, so linked error tracking issues may not follow their tickets until someone reconnects it.
* @nullable
*/
readonly needs_webhook_reconnect: boolean | null
}
export interface SlackChannelApi {
/** Slack channel ID (e.g. C0123ABC) — pass to cdp-functions inputs.channel. */
id: string
/** Slack channel name without the leading '#'. */
name: string
/** True if the channel is private. */
is_private: boolean
/** True if the PostHog Slack app is a member of the channel and can post to it. */
is_member: boolean
/** True if the channel is shared with another Slack workspace. */
is_ext_shared: boolean
/** True if the channel is private and the PostHog Slack app cannot access it. */
is_private_without_access: boolean
}
/**
* Declares the `next` and `previous` links of a page response that the view fills with `page_link`.
*/
export interface SlackChannelsResponseApi {
/**
* URL of the next page, or null on the last page.
* @nullable
*/
readonly next: string | null
/**
* URL of the previous page, or null on the first page and on lists that page forward only.
* @nullable
*/
readonly previous: string | null
/** Slack channels visible to the PostHog Slack app. */
channels: SlackChannelApi[]
/**
* ISO 8601 timestamp of the last full Slack API refresh (only set on full lists, not single-channel lookups).
* @nullable
*/
lastRefreshedAt?: string | null
/** Whether more channels match the current search beyond this page. */
has_more?: boolean
}
/**
* Standard Integration serializer.
*/
export interface PatchedIntegrationConfigApi {
readonly id?: number
/**
* The provider of the integration, for example 'slack' or 'github'. A create accepts only the kinds that PostHog connects here. Data warehouse sources also store their typed-in credentials as integrations, under a kind per source type.
* @maxLength 32
*/
kind?: string
/** How this integration authenticates with the provider: `oauth` for a connection the provider manages (an OAuth grant or an app installation), `token` for one static secret, or `credentials` for several typed-in fields. A kind can have several auth types.
*
* * `oauth` - OAuth
* * `token` - Token
* * `credentials` - Credentials */
readonly auth_type?: IntegrationAuthTypeEnumApi
config?: unknown
readonly created_at?: string
readonly created_by?: UserBasicApi
readonly errors?: string
readonly display_name?: string
/** Slack only: whether reconnecting can request the files:write scope. */
readonly files_write_requestable?: boolean
/**
* GitHub only, null otherwise. Whether another project's GitHub integration references the same App installation. When false, disconnecting this integration also uninstalls the GitHub App from the connected account or organization and removes personal GitHub connections that share it.
* @nullable
*/
readonly installation_shared?: boolean | null
/** GitHub only, null otherwise. `unavailable` means the App was uninstalled or suspended on GitHub and PostHog can no longer mint tokens for it; `connected` otherwise. */
readonly installation_status?: InstallationStatusEnumApi | null
/**
* Linear only, null otherwise. True when the workspace last authorized PostHog before the Linear app had webhooks, so linked error tracking issues may not follow their tickets until someone reconnects it.
* @nullable
*/
readonly needs_webhook_reconnect?: boolean | null
}
/**
* * `not_started` - Not started
* * `pending` - Waiting for DNS records
* * `records_found` - Records found, waiting for verification
* * `verified` - Verified
* * `temporary_failure` - Temporary failure
* * `failed` - Failed
*/
export type EmailDomainSetupStatusEnumApi =
(typeof EmailDomainSetupStatusEnumApi)[keyof typeof EmailDomainSetupStatusEnumApi]
export const EmailDomainSetupStatusEnumApi = {
NotStarted: 'not_started',
Pending: 'pending',
RecordsFound: 'records_found',
Verified: 'verified',
TemporaryFailure: 'temporary_failure',
Failed: 'failed',
} as const
/**
* * `domain_added` - Domain added
* * `records_found` - DNS records found
* * `verified` - Verified
*/
export type EmailDomainSetupStepKeyEnumApi =
(typeof EmailDomainSetupStepKeyEnumApi)[keyof typeof EmailDomainSetupStepKeyEnumApi]
export const EmailDomainSetupStepKeyEnumApi = {
DomainAdded: 'domain_added',
RecordsFound: 'records_found',
Verified: 'verified',
} as const
/**
* * `done` - Done
* * `pending` - Pending
* * `failed` - Failed
*/
export type EmailDomainSetupStepStateEnumApi =
(typeof EmailDomainSetupStepStateEnumApi)[keyof typeof EmailDomainSetupStepStateEnumApi]
export const EmailDomainSetupStepStateEnumApi = {
Done: 'done',
Pending: 'pending',
Failed: 'failed',
} as const
export interface EmailDomainStatusStepApi {
/** The setup step: domain_added (SES knows the domain), records_found (every DNS record is published), verified (SES verified the domain and the sender can send).
*
* * `domain_added` - Domain added
* * `records_found` - DNS records found
* * `verified` - Verified */
key: EmailDomainSetupStepKeyEnumApi
/** Progress of this step.
*
* * `done` - Done
* * `pending` - Pending
* * `failed` - Failed */
state: EmailDomainSetupStepStateEnumApi
}
/**
* * `verification` - Domain ownership
* * `dkim` - DKIM signing
* * `spf` - SPF
* * `mail_from_mx` - MAIL FROM MX
* * `mail_from_spf` - MAIL FROM SPF
* * `dmarc` - DMARC
*/
export type EmailDomainSetupRecordKindEnumApi =
(typeof EmailDomainSetupRecordKindEnumApi)[keyof typeof EmailDomainSetupRecordKindEnumApi]
export const EmailDomainSetupRecordKindEnumApi = {
Verification: 'verification',
Dkim: 'dkim',
Spf: 'spf',
MailFromMx: 'mail_from_mx',
MailFromSpf: 'mail_from_spf',
Dmarc: 'dmarc',
} as const
/**
* * `TXT` - TXT
* * `CNAME` - CNAME
* * `MX` - MX
*/
export type EmailDomainSetupRecordTypeEnumApi =
(typeof EmailDomainSetupRecordTypeEnumApi)[keyof typeof EmailDomainSetupRecordTypeEnumApi]
export const EmailDomainSetupRecordTypeEnumApi = {
Txt: 'TXT',
Cname: 'CNAME',
Mx: 'MX',
} as const
/**
* * `pending` - Not found yet
* * `found` - Found in DNS
* * `verified` - Verified
*/
export type EmailDomainSetupRecordStatusEnumApi =
(typeof EmailDomainSetupRecordStatusEnumApi)[keyof typeof EmailDomainSetupRecordStatusEnumApi]
export const EmailDomainSetupRecordStatusEnumApi = {
Pending: 'pending',
Found: 'found',
Verified: 'verified',
} as const
export interface EmailDomainStatusRecordApi {
/** What the record does: verification proves domain ownership, dkim signs email, spf and mail_from_spf list SES as an allowed sender, mail_from_mx routes bounces, dmarc sets the policy for unauthenticated mail.
*
* * `verification` - Domain ownership
* * `dkim` - DKIM signing
* * `spf` - SPF
* * `mail_from_mx` - MAIL FROM MX
* * `mail_from_spf` - MAIL FROM SPF
* * `dmarc` - DMARC */
kind: EmailDomainSetupRecordKindEnumApi
/** Full DNS name to create the record at, including the domain. */
hostname: string
/** DNS record type.
*
* * `TXT` - TXT
* * `CNAME` - CNAME
* * `MX` - MX */
type: EmailDomainSetupRecordTypeEnumApi
/** Value to publish. For an SPF record, add the include to an existing SPF record instead of creating a second one. For DMARC, any existing v=DMARC1 record counts. */
value: string
/**
* MX priority. Null for other record types.
* @nullable
*/
priority: number | null
/** pending: not found in DNS yet. found: published in DNS, SES has not confirmed it yet. verified: SES confirmed the record, or for DMARC a v=DMARC1 record exists.
*
* * `pending` - Not found yet
* * `found` - Found in DNS
* * `verified` - Verified */
status: EmailDomainSetupRecordStatusEnumApi
}
export interface EmailDomainStatusApi {
/** Overall setup status. records_found means every record is published and SES has not confirmed yet. temporary_failure means SES could not see the records, usually because DNS changes have not spread yet. failed means SES gave up after 72 hours; start verification again.
*
* * `not_started` - Not started
* * `pending` - Waiting for DNS records
* * `records_found` - Records found, waiting for verification
* * `verified` - Verified
* * `temporary_failure` - Temporary failure
* * `failed` - Failed */
status: EmailDomainSetupStatusEnumApi
/** Whether the sender can send email. Set by email/verify once SES verifies the domain. */
verified: boolean
/** When SES and DNS were read. Responses are cached for 10 seconds unless refresh is set. */
checked_at: string
/** The three setup steps, in order. */
steps: EmailDomainStatusStepApi[]
/** DNS records to publish at the domain's DNS host, with the status of each. Empty when status is not_started. */
records: EmailDomainStatusRecordApi[]
}
/**
* * `success` - Success
* * `pending` - Pending
* * `failed` - Failed
*/
export type EmailDomainVerificationStatusEnumApi =
(typeof EmailDomainVerificationStatusEnumApi)[keyof typeof EmailDomainVerificationStatusEnumApi]
export const EmailDomainVerificationStatusEnumApi = {
Success: 'success',
Pending: 'pending',
Failed: 'failed',
} as const
export interface EmailDomainVerificationRecordApi {
/** What the record does: verification, dkim, mail_from or dmarc. */
type: string
/** DNS record type: TXT, CNAME or MX. */
recordType: string
/** DNS name to create the record at. */
recordHostname: string
/** Value to publish. */
recordValue: string
/** success once SES or DNS confirms the record, else pending. */
status: string
/** MX priority. Only set on MX records. */
priority?: number
}
export interface EmailDomainVerificationApi {
/** success when SES verified the domain and its senders are now marked verified.
*
* * `success` - Success
* * `pending` - Pending
* * `failed` - Failed */
status: EmailDomainVerificationStatusEnumApi
/** DNS records the domain needs. */
dnsRecords: EmailDomainVerificationRecordApi[]
}
export interface IntegrationAssigneeApi {
/** Provider user identifier to pass as error tracking config.assignee: a Linear user ID, a GitHub login, a GitLab user ID, or a Jira account ID. */
id: string
/** User display name. */
name: string
}
export interface IntegrationAssigneesResponseApi {
/** Users who can be assigned an issue, up to 100. */
users: IntegrationAssigneeApi[]
/** True when the connection lacks the permission to list users. Reconnecting the integration grants it. */
reconnect_required: boolean
}
/**
* Declares the `next` and `previous` links of a page response that the view fills with `page_link`.
*/
export interface GitHubBranchesResponseApi {
/**
* URL of the next page, or null on the last page.
* @nullable
*/
readonly next: string | null
/**
* URL of the previous page, or null on the first page and on lists that page forward only.
* @nullable
*/
readonly previous: string | null
/** List of branch names */
branches: string[]
/**
* The default branch of the repository
* @nullable
*/
default_branch?: string | null
/** Whether more branches exist beyond the returned page */
has_more: boolean
}
export interface GitHubRepoApi {
/** GitHub repository numeric identifier. */
id: number
/** Repository short name (without the owner prefix). */
name: string
/** Fully-qualified repository name as 'owner/repo'. */
full_name: string
/** Whether the repository is private. */
private?: boolean
/** The repository's default branch (e.g. 'main'). */
default_branch?: string
/** Primary programming language GitHub detected for the repository. */
language?: string
/** ISO 8601 timestamp of the most recent push, useful for sorting by recent activity. */
pushed_at?: string
/** Whether the repository is archived. */
archived?: boolean
/** Whether the PostHog GitHub App has write access — required to open pull requests. */
can_push?: boolean
}
/**
* Declares the `next` and `previous` links of a page response that the view fills with `page_link`.
*/
export interface GitHubReposResponseApi {
/**
* URL of the next page, or null on the last page.
* @nullable
*/
readonly next: string | null
/**
* URL of the previous page, or null on the first page and on lists that page forward only.
* @nullable
*/
readonly previous: string | null
repositories: GitHubRepoApi[]
/** Whether more repositories are available beyond this page. */
has_more: boolean
/**
* The offset to pass to get the next page, or null when this page is the last one.
* @nullable
*/
next_offset: number | null
/** Total number of repositories matching the search query, across all pages. */
total: number
}
export interface GitHubReposRefreshResponseApi {
/** The refreshed repository cache. */
repositories: GitHubRepoApi[]
/** `unavailable` when GitHub reports the App installation as uninstalled or suspended, in which case `repositories` is the last cached list rather than a fresh one.
*
* * `connected` - connected
* * `unavailable` - unavailable */
installation_status: InstallationStatusEnumApi
}
export interface GitHubRepositoryAccessResponseApi {
/** Whether a live GitHub request confirmed repository access. */
available: boolean
}
export interface ErrorResponseApi {
/** Error message */
error: string
}
export interface GitHubTeamApi {
/** GitHub team numeric identifier. */
id: number
/** GitHub team slug. */
slug: string
/** GitHub team display name. */
name: string
}
/**
* Declares the `next` and `previous` links of a page response that the view fills with `page_link`.
*/
export interface GitHubTeamsResponseApi {
/**
* URL of the next page, or null on the last page.
* @nullable
*/
readonly next: string | null
/**
* URL of the previous page, or null on the first page and on lists that page forward only.
* @nullable
*/
readonly previous: string | null
/** List of GitHub teams available to the installation organization. */
teams: GitHubTeamApi[]
/** Whether more teams are available beyond this page. */
has_more: boolean
}
export interface JiraProjectApi {
/** Jira project ID. */
id: string
/** Jira project key to pass as error tracking config.project_key. */
key: string
/** Jira project display name. */
name: string
}
export interface JiraProjectsResponseApi {
/** Jira projects available to this integration. */
projects: JiraProjectApi[]
}
export interface LinearTeamApi {
/** Linear team ID to pass as error tracking config.team_id. */
id: string
/** Linear team display name. */
name: string
}
export interface LinearTeamsResponseApi {
/** Linear teams available to this integration. */
teams: LinearTeamApi[]
}
export interface PushTokenSubscriptionApi {
/**
* The person's distinct ID in this project: the ID your app passes to `identify`.
* @maxLength 200
*/
distinct_id: string
/**
* The token of one device. An APNs channel takes the hex APNs device token. A Firebase channel takes the FCM registration token. Expo push tokens are not accepted.
* @maxLength 4096
*/
device_token: string
}
export interface PushTokenImportRequestApi {
/** Up to 1000 devices to register on this push channel. List a person once per device. */
subscriptions: PushTokenSubscriptionApi[]
/** Check every row and report what would fail, without storing anything. Run this first and fix the failed rows before importing. */
dry_run?: boolean
/**
* A new UUID for each batch. Send the same value when you retry that batch, so a retried batch can be recognized as a repeat.
* @nullable
*/
import_id?: string | null
/** Create a person for a distinct ID that has none. Off by default, because a distinct ID that does not match your app's identify call creates a person that never gets a push. */
create_missing_persons?: boolean
}
/**
* * `unknown_person` - No person has this distinct ID
* * `token_mismatch` - The token does not fit this channel
* * `not_stored` - The device was not stored
* * `person_processing_disabled` - Person processing is off for this person
*/
export type PushTokenImportFailureReasonEnumApi =
(typeof PushTokenImportFailureReasonEnumApi)[keyof typeof PushTokenImportFailureReasonEnumApi]
export const PushTokenImportFailureReasonEnumApi = {
UnknownPerson: 'unknown_person',
TokenMismatch: 'token_mismatch',
NotStored: 'not_stored',
PersonProcessingDisabled: 'person_processing_disabled',
} as const
export interface PushTokenImportFailureApi {
/** Position of the row in the request's `subscriptions`, from 0. */
index: number
/** The distinct ID of the row. */
distinct_id: string
/** The last 6 characters of the row's device token, to find the row. */
device_token_suffix: string
/** Why the device was not stored. `unknown_person`: no person has this distinct ID, so check the ID or set `create_missing_persons`. `token_mismatch`: the token is the wrong kind for this channel, for example an Expo token, or an APNs token on a Firebase channel. `not_stored` and `person_processing_disabled`: ingestion did not store the device.
*
* * `unknown_person` - No person has this distinct ID
* * `token_mismatch` - The token does not fit this channel
* * `not_stored` - The device was not stored
* * `person_processing_disabled` - Person processing is off for this person */
reason: PushTokenImportFailureReasonEnumApi
/** A sentence a person can act on. */
detail: string
}
export interface PushTokenImportResponseApi {
/** Number of devices stored on their person. On a dry run, the number that would be stored. */
imported: number
/** True when nothing was stored. */
dry_run: boolean
/** One entry per device that was not stored. */
failed: PushTokenImportFailureApi[]
/** Distinct IDs with at least one device that was not stored. Prefer `failed`, which says why. */
failed_distinct_ids: string[]
}
export interface SlackUserApi {
/** Slack member ID (e.g. U0123ABC) — post to it to open a direct message. */
id: string
/** Slack username (handle) without the leading '@'. */
name: string
/** Name to show in pickers: the member's display name, falling back to their real name or handle. */
display_name: string
}
/**
* Declares the `next` and `previous` links of a page response that the view fills with `page_link`.
*/
export interface SlackUsersResponseApi {
/**
* URL of the next page, or null on the last page.
* @nullable
*/
readonly next: string | null
/**
* URL of the previous page, or null on the first page and on lists that page forward only.
* @nullable
*/
readonly previous: string | null
/** Human Slack workspace members the PostHog Slack app can DM. */
users: SlackUserApi[]
/**
* ISO 8601 timestamp of the last full Slack API refresh (only set on full lists, not single-member lookups).
* @nullable
*/
lastRefreshedAt?: string | null
/** Whether more members match the current search beyond this page. */
has_more?: boolean
}
export interface EmailDomainConnectProviderApi {
/** Domain Connect endpoint of the provider. */
endpoint: string
/** Display name of the provider. */
name: string
}
export interface EmailDomainDnsHostApi {
/** Name of the company that hosts the domain's DNS, such as Cloudflare. */
name: string
/** Link to the DNS settings page at that host. */
dns_settings_url: string
}
export interface EmailDomainConnectCheckApi {
/** Whether the domain's DNS provider supports automatic setup through Domain Connect. */
supported: boolean
/**
* Domain Connect provider that hosts the domain. Null when not supported.
* @nullable
*/
provider_name: string | null
/** Providers the user can pick manually when automatic detection fails. Empty when supported. */
available_providers: EmailDomainConnectProviderApi[]
/** The detected DNS host of the root domain, from its nameservers. Null when unknown. */
dns_host: EmailDomainDnsHostApi | null
/** Email tools that already send for the root domain, detected from SPF and DKIM records. Best effort, empty when none are found or when include_email_setup is off. */
existing_email_tools: string[]
}
/**
* * `ok` - Ok
* * `not_connected` - Not Connected
* * `unavailable` - Unavailable
*/
export type GitHubPersonalDiscoveryStatusEnumApi =
(typeof GitHubPersonalDiscoveryStatusEnumApi)[keyof typeof GitHubPersonalDiscoveryStatusEnumApi]
export const GitHubPersonalDiscoveryStatusEnumApi = {
Ok: 'ok',
NotConnected: 'not_connected',
Unavailable: 'unavailable',
} as const
export interface GitHubAvailableInstallationApi {
/** GitHub installation ID to pass to github/link_existing when linking this installation. */
installation_id: string
/**
* GitHub account (organization or user) the installation belongs to, for display in the picker.
* @nullable
*/
account_name: string | null
/**
* GitHub account type, e.g. 'Organization' or 'User'.
* @nullable
*/
account_type: string | null
/**
* A project in the organization that already has this installation linked. Null when the installation isn't linked to any project yet — it was found via the user's personal GitHub link and can be adopted by linking it here.
* @nullable
*/
source_team_id: number | null
/**
* Name of the project in source_team_id, so the picker can say where the installation comes from. Null for an installation no project has linked yet.
* @nullable
*/
source_team_name: string | null
}
export interface GitHubAvailableInstallationsResponseApi {
/** Correlation ID for this discovery response. */
discovery_id: string
/** Time this discovery completed. */
discovered_at: string
/**
* GitHub identity of the credential used for personal discovery.
* @nullable
*/
personal_github_login: string | null
/** Whether personal discovery succeeded, has no connection, or is unavailable.
*
* * `ok` - Ok
* * `not_connected` - Not Connected
* * `unavailable` - Unavailable */
personal_discovery_status: GitHubPersonalDiscoveryStatusEnumApi
/** GitHub installations available to link to this project: the organization's existing installations plus any the user's personal GitHub link can see but that aren't linked to any project yet. */
installations: GitHubAvailableInstallationApi[]
/** Whether the requesting user has a personal GitHub account linked (via Linked Accounts). Used to prompt for that link when it would surface more installations to adopt. */
personal_github_connected: boolean
}
export interface GitHubLinkExistingRequestApi {
/**
* Discovery response ID for diagnostics only; grants no authority.
* @nullable
*/
discovery_id?: string | null
/**
* Sibling team in the same organization whose GitHub installation should be reused.
* @nullable
*/
source_team_id?: number | null
/**
* GitHub installation ID to link; resolved within the organization when source_team_id is omitted.
* @nullable
*/
installation_id?: string | null
}
/**
* * `posthog_code` - posthog_code
*/
export type ConnectFromEnumApi = (typeof ConnectFromEnumApi)[keyof typeof ConnectFromEnumApi]
export const ConnectFromEnumApi = {
PosthogCode: 'posthog_code',
} as const
export interface GitHubOAuthAuthorizeRequestApi {
/** GitHub installation ID to carry through the User OAuth flow. */
installation_id?: string
/** Relative URL to redirect to after the OAuth flow completes. */
next?: string
/** Originating surface for the connect flow; only 'posthog_code' is recognized.
*
* * `posthog_code` - posthog_code */
connect_from?: ConnectFromEnumApi
}
export interface GitHubOAuthAuthorizeResponseApi {
/** GitHub User OAuth URL the client should redirect to. */
oauth_url: string
}
export interface GitHubPrepareCallbackRequestApi {
/** Relative URL to redirect to after GitHub setup completes (e.g. account-connected for PostHog Desktop). */
next?: string
/** GitHub installation ID being managed; binds the seeded update state so a callback can't swap in a different installation. */
installation_id?: string
}
export interface IntegrationAccessRequestApi {
/** The kind of integration the member is requesting be connected (e.g. 'slack', 'github').
*
* * `anthropic` - Anthropic
* * `apple-ads` - Apple Ads
* * `apns` - Apple Push
* * `aws-redshift` - Aws Redshift
* * `aws-s3` - Aws S3
* * `azure-blob` - Azure Blob
* * `bing-ads` - Bing Ads
* * `clickup` - Clickup
* * `customerio-app` - Customerio App
* * `customerio-track` - Customerio Track
* * `customerio-webhook` - Customerio Webhook
* * `databricks` - Databricks
* * `email` - Email
* * `firebase` - Firebase
* * `github` - Github
* * `gitlab` - Gitlab
* * `google-ads` - Google Ads
* * `google-analytics` - Google Analytics
* * `google-calendar` - Google Calendar
* * `google-cloud-service-account` - Google Cloud Service Account
* * `google-cloud-storage` - Google Cloud Storage
* * `google-pubsub` - Google Pubsub
* * `google-search-console` - Google Search Console
* * `google-sheets` - Google Sheets
* * `helpscout` - Helpscout
* * `hubspot` - Hubspot
* * `instagram` - Instagram
* * `intercom` - Intercom
* * `jira` - Jira
* * `linear` - Linear
* * `linkedin-ads` - Linkedin Ads
* * `meta-ads` - Meta Ads
* * `pardot` - Pardot
* * `pinterest-ads` - Pinterest Ads
* * `postgresql` - Postgresql
* * `posthog` - Posthog
* * `reddit-ads` - Reddit Ads
* * `twitter-ads` - Twitter Ads
* * `resend` - Resend
* * `s3-compatible` - S3 Compatible
* * `salesforce` - Salesforce
* * `slack` - Slack
* * `slack-posthog-code` - Slack Posthog Code
* * `snapchat` - Snapchat
* * `snowflake` - Snowflake
* * `stripe` - Stripe
* * `tiktok-ads` - Tiktok Ads
* * `twilio` - Twilio
* * `vercel` - Vercel
* * `youtube-analytics` - Youtube Analytics */
kind: IntegrationKindEnumApi
/**
* Explanation from the requester of why this integration is needed. Shown to admins in the notification email.
* @maxLength 2000
*/
reason: string
}
export interface IntegrationAccessRequestResponseApi {
/** Whether the access request was accepted and the project admins were notified. */
success: boolean
}
/**
* Query parameters to send to the target.
*/
export type PostHogConnectionForwardApiQuery = { [key: string]: string }
/**
* * `GET` - GET
* * `POST` - POST
* * `PUT` - PUT
* * `PATCH` - PATCH
* * `DELETE` - DELETE
*/
export type PostHogConnectionForwardMethodEnumApi =
(typeof PostHogConnectionForwardMethodEnumApi)[keyof typeof PostHogConnectionForwardMethodEnumApi]
export const PostHogConnectionForwardMethodEnumApi = {
Get: 'GET',
Post: 'POST',
Put: 'PUT',
Patch: 'PATCH',
Delete: 'DELETE',
} as const
export interface PostHogConnectionForwardApi {
/** HTTP method to use against the target project's API.
*
* * `GET` - GET
* * `POST` - POST
* * `PUT` - PUT
* * `PATCH` - PATCH
* * `DELETE` - DELETE */
method: PostHogConnectionForwardMethodEnumApi
/** Relative target API path with no host or scheme, e.g. `api/projects/2/insights/`. */
path: string
/** Query parameters to send to the target. */
query?: PostHogConnectionForwardApiQuery
/** JSON request body for write methods. */
data?: unknown
}
export interface PostHogConnectionForwardResponseApi {
/** HTTP status the target project returned. */
status: number
/** The target project's response body, passed through. */
data: unknown
}
export interface PostHogConnectionTargetApi {
/** Project id to use in target API paths. It is the connected project's id, not this one's. */
project_id: number
/** Name of the connected project. */
project_name: string
/** Id of the organization the connected project belongs to. */
organization_id: string
/** Name of the organization the connected project belongs to. */
organization_name: string
/** Cloud region the connected project lives in, e.g. `US` or `EU`. */
region: string
/** Base URL requests through this connection are sent to. */
base_url: string
}
export interface PostHogConnectionTargetErrorApi {
/** Why the connected project's context could not be read. */
error: string
}
export type RoleExternalReferencesListParams = {
/**
* Number of results to return per page.
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
}
export type RoleExternalReferencesLookupRetrieveParams = {
/**
* Integration kind (e.g., github, linear, jira, slack).
* @minLength 1
*/
provider: string
/**
* Provider organization/workspace/site identifier.
* @minLength 1
*/
provider_organization_id: string
/**
* Stable provider role identifier.
* @minLength 1
*/
provider_role_id?: string
/**
* Human-friendly provider role identifier.
* @minLength 1
*/
provider_role_slug?: string
}
export type IntegrationsListParams = {
/**
* * `anthropic` - Anthropic
* * `apple-ads` - Apple Ads
* * `apns` - Apple Push
* * `aws-redshift` - Aws Redshift
* * `aws-s3` - Aws S3
* * `azure-blob` - Azure Blob
* * `bing-ads` - Bing Ads
* * `clickup` - Clickup
* * `customerio-app` - Customerio App
* * `customerio-track` - Customerio Track
* * `customerio-webhook` - Customerio Webhook
* * `databricks` - Databricks
* * `email` - Email
* * `firebase` - Firebase
* * `github` - Github
* * `gitlab` - Gitlab
* * `google-ads` - Google Ads
* * `google-analytics` - Google Analytics
* * `google-calendar` - Google Calendar
* * `google-cloud-service-account` - Google Cloud Service Account
* * `google-cloud-storage` - Google Cloud Storage
* * `google-pubsub` - Google Pubsub
* * `google-search-console` - Google Search Console
* * `google-sheets` - Google Sheets
* * `helpscout` - Helpscout
* * `hubspot` - Hubspot
* * `instagram` - Instagram
* * `intercom` - Intercom
* * `jira` - Jira
* * `linear` - Linear
* * `linkedin-ads` - Linkedin Ads
* * `meta-ads` - Meta Ads
* * `pardot` - Pardot
* * `pinterest-ads` - Pinterest Ads
* * `postgresql` - Postgresql
* * `posthog` - Posthog
* * `reddit-ads` - Reddit Ads
* * `twitter-ads` - Twitter Ads
* * `resend` - Resend
* * `s3-compatible` - S3 Compatible
* * `salesforce` - Salesforce
* * `slack` - Slack
* * `slack-posthog-code` - Slack Posthog Code
* * `snapchat` - Snapchat
* * `snowflake` - Snowflake
* * `stripe` - Stripe
* * `tiktok-ads` - Tiktok Ads
* * `twilio` - Twilio
* * `vercel` - Vercel
* * `youtube-analytics` - Youtube Analytics
*/
kind?: IntegrationsListKind
/**
* Number of results to return per page.
*/
limit?: number
/**
* The initial index from which to return the results.
*/
offset?: number
}
export type IntegrationsListKind = (typeof IntegrationsListKind)[keyof typeof IntegrationsListKind]
export const IntegrationsListKind = {
Anthropic: 'anthropic',
Apns: 'apns',
AppleAds: 'apple-ads',
AwsRedshift: 'aws-redshift',
AwsS3: 'aws-s3',
AzureBlob: 'azure-blob',
BingAds: 'bing-ads',
Clickup: 'clickup',
CustomerioApp: 'customerio-app',
CustomerioTrack: 'customerio-track',
CustomerioWebhook: 'customerio-webhook',
Databricks: 'databricks',
Email: 'email',
Firebase: 'firebase',
Github: 'github',
Gitlab: 'gitlab',
GoogleAds: 'google-ads',
GoogleAnalytics: 'google-analytics',
GoogleCalendar: 'google-calendar',
GoogleCloudServiceAccount: 'google-cloud-service-account',
GoogleCloudStorage: 'google-cloud-storage',
GooglePubsub: 'google-pubsub',
GoogleSearchConsole: 'google-search-console',
GoogleSheets: 'google-sheets',
Helpscout: 'helpscout',
Hubspot: 'hubspot',
Instagram: 'instagram',
Intercom: 'intercom',
Jira: 'jira',
Linear: 'linear',
LinkedinAds: 'linkedin-ads',
MetaAds: 'meta-ads',
Pardot: 'pardot',
PinterestAds: 'pinterest-ads',
Postgresql: 'postgresql',
Posthog: 'posthog',
RedditAds: 'reddit-ads',
Resend: 'resend',
S3Compatible: 's3-compatible',
Salesforce: 'salesforce',
Slack: 'slack',
SlackPosthogCode: 'slack-posthog-code',
Snapchat: 'snapchat',
Snowflake: 'snowflake',
Stripe: 'stripe',
TiktokAds: 'tiktok-ads',
Twilio: 'twilio',
TwitterAds: 'twitter-ads',
Vercel: 'vercel',
YoutubeAnalytics: 'youtube-analytics',
} as const
export type IntegrationsChannelsRetrieveParams = {
/**
* Look up one channel directly by Slack channel ID (e.g. C0123ABC). When set, `search`, `limit`, and `offset` are ignored and the response holds at most that channel.
*/
channel_id?: string
/**
* Bypass the 1 hour channel cache, including for a `channel_id` lookup, which is how a caller reads the channel's current membership after inviting the app to it. Honored only for browser session callers; API key, OAuth, and MCP callers always read through the cache.
*/
force_refresh?: boolean
/**
* Maximum number of channels to return per request (max 200).
* @minimum 1
* @maximum 200
*/
limit?: number
/**
* Number of channels to skip before returning results.
* @minimum 0
*/
offset?: number
/**
* Optional case-insensitive channel name or ID search query.
*/
search?: string
}
export type IntegrationsEmailStatusRetrieveParams = {
/**
* Skip the 10 second status cache and read SES and DNS again. Use it after changing DNS records.
*/
refresh?: boolean
}
export type IntegrationsGithubAssigneesRetrieveParams = {
/**
* Repository name, or owner/name, whose assignable users to list.
* @minLength 1
*/
repository: string
/**
* Optional case-insensitive name search. Leave blank to list the first users.
*/
search?: string
}
export type IntegrationsGithubBranchesRetrieveParams = {
/**
* Maximum number of branches to return
* @minimum 1
* @maximum 1000
*/
limit?: number
/**
* Number of branches to skip
* @minimum 0
*/
offset?: number
/**
* Repository in owner/repo format
* @minLength 1
*/
repo: string
/**
* Optional case-insensitive branch name search query.
*/
search?: string
}
export type IntegrationsGithubReposRetrieveParams = {
/**
* When true, return only id, name, and full_name for each repository. Use it to list large rosters in fewer, smaller pages.
*/
compact?: boolean
/**
* Maximum number of repositories to return per request (max 500).
* @minimum 1
* @maximum 500
*/
limit?: number
/**
* Number of repositories to skip before returning results.
* @minimum 0
*/
offset?: number
/**
* Optional case-insensitive repository name search query.
*/
search?: string
}
export type IntegrationsGithubRepositoryAccessRetrieveParams = {
/**
* Repository in owner/repo format. Omit to check access to any repository.
* @minLength 1
*/
repository?: string
}
export type IntegrationsGithubTeamsRetrieveParams = {
/**
* Maximum number of teams to return per request (max 500).
* @minimum 1
* @maximum 500
*/
limit?: number
/**
* Number of teams to skip before returning results.
* @minimum 0
*/
offset?: number
/**
* Optional case-insensitive team name or slug search query.
*/
search?: string
}
export type IntegrationsGitlabMembersRetrieveParams = {
/**
* Optional case-insensitive name search. Leave blank to list the first users.
*/
search?: string
}
export type IntegrationsJiraAssignableUsersRetrieveParams = {
/**
* Jira project key whose assignable users to list.
* @minLength 1
*/
project_key: string
/**
* Optional case-insensitive name search. Leave blank to list the first users.
*/
search?: string
}
export type IntegrationsLinearTeamMembersRetrieveParams = {
/**
* Optional case-insensitive name search. Leave blank to list the first users.
*/
search?: string
/**
* Linear team ID whose members to list.
* @minLength 1
*/
team_id: string
}
export type IntegrationsUsersRetrieveParams = {
/**
* Bypass the 1 hour member cache. Honored only for browser session callers; API key, OAuth, and MCP callers always read through the cache.
*/
force_refresh?: boolean
/**
* Maximum number of members to return per request (max 200).
* @minimum 1
* @maximum 200
*/
limit?: number
/**
* Number of members to skip before returning results.
* @minimum 0
*/
offset?: number
/**
* Optional case-insensitive member name or ID search query.
*/
search?: string
/**
* Look up one member directly by Slack member ID (e.g. U0123ABC). When set, `search`, `limit`, and `offset` are ignored and the response holds at most that member.
*/
user_id?: string
}
export type IntegrationsDomainConnectCheckRetrieveParams = {
/**
* Domain to check, such as mail.example.com. Its root domain is checked.
* @minLength 1
*/
domain: string
/**
* Also look up the DNS host and the email tools that already send for the domain. Email domain setup needs these. Leave it off for other setups, because the lookups add DNS queries.
*/
include_email_setup?: boolean
}