Integrations

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

POST
GET
GET
GET
GET
GET
GET
GET
GET
GET
GET
GET
GET
GET
POST
GET
GET
POST
POST
POST

Create integrations github repos refresh

Required API key scopes

integration:write

Path parameters

  • id
    integer

Response


Example request

POST /api/projects/:project_id/integrations/:id/github_repos/refresh
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/github_repos/refresh/

Example response

Status 200
RESPONSE
{
"repositories": [
{
"id": 0,
"name": "string",
"full_name": "string",
"private": true,
"default_branch": "string",
"language": "string",
"pushed_at": "string",
"archived": true,
"can_push": true
}
],
"installation_status": "connected"
}

Retrieve integrations github teams

Required API key scopes

integration:read

Path parameters

  • id
    integer

Query parameters

  • limit
    integer
    Default: 100
  • offset
    integer
    Default: 0
  • search
    string
    Default:

Response


Example request

GET /api/projects/:project_id/integrations/:id/github_teams
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/github_teams/

Example response

Status 200
RESPONSE
{
"teams": [
{
"id": 0,
"slug": "string",
"name": "string"
}
],
"has_more": true
}

Retrieve integrations gitlab members

Required API key scopes

integration:read

Path parameters

  • id
    integer

Query parameters

  • search
    string
    Default:

Response


Example request

GET /api/projects/:project_id/integrations/:id/gitlab_members
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/gitlab_members/

Example response

Status 200
RESPONSE
{
"users": [
{
"id": "string",
"name": "string"
}
],
"reconnect_required": true
}

Retrieve integrations google accessible accounts

Path parameters

  • id
    integer

Example request

GET /api/projects/:project_id/integrations/:id/google_accessible_accounts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/google_accessible_accounts/

Example response

Status 200 No response body

Retrieve integrations google conversion actions

Path parameters

  • id
    integer

Example request

GET /api/projects/:project_id/integrations/:id/google_conversion_actions
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/google_conversion_actions/

Example response

Status 200 No response body

Retrieve integrations jira assignable users

Required API key scopes

integration:read

Path parameters

  • id
    integer

Query parameters

  • project_key
    string
  • search
    string
    Default:

Response


Example request

GET /api/projects/:project_id/integrations/:id/jira_assignable_users
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/jira_assignable_users/

Example response

Status 200
RESPONSE
{
"users": [
{
"id": "string",
"name": "string"
}
],
"reconnect_required": true
}

Retrieve integrations jira projects

Required API key scopes

integration:read

Path parameters

  • id
    integer

Response


Example request

GET /api/projects/:project_id/integrations/:id/jira_projects
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/jira_projects/

Example response

Status 200
RESPONSE
{
"projects": [
{
"id": "string",
"key": "string",
"name": "string"
}
]
}

Retrieve integrations linear team members

Required API key scopes

integration:read

Path parameters

  • id
    integer

Query parameters

  • search
    string
    Default:
  • team_id
    string

Response


Example request

GET /api/projects/:project_id/integrations/:id/linear_team_members
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/linear_team_members/

Example response

Status 200
RESPONSE
{
"users": [
{
"id": "string",
"name": "string"
}
],
"reconnect_required": true
}

Retrieve integrations linear teams

Required API key scopes

integration:read

Path parameters

  • id
    integer

Response


Example request

GET /api/projects/:project_id/integrations/:id/linear_teams
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/linear_teams/

Example response

Status 200
RESPONSE
{
"teams": [
{
"id": "string",
"name": "string"
}
]
}

Retrieve integrations linkedin ads accounts

Path parameters

  • id
    integer

Example request

GET /api/projects/:project_id/integrations/:id/linkedin_ads_accounts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/linkedin_ads_accounts/

Example response

Status 200 No response body

Retrieve integrations linkedin ads conversion rules

Path parameters

  • id
    integer

Example request

GET /api/projects/:project_id/integrations/:id/linkedin_ads_conversion_rules
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/linkedin_ads_conversion_rules/

Example response

Status 200 No response body

Retrieve integrations twilio phone numbers

Path parameters

  • id
    integer

Example request

GET /api/projects/:project_id/integrations/:id/twilio_phone_numbers
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/twilio_phone_numbers/

Example response

Status 200 No response body

Retrieve integrations users

Required API key scopes

integration:read

Path parameters

  • id
    integer

Query parameters

  • force_refresh
    boolean
    Default: false
  • limit
    integer
    Default: 50
  • offset
    integer
    Default: 0
  • search
    string
    Default:
  • user_id
    string
    Default:

Response


Example request

GET /api/projects/:project_id/integrations/:id/users
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/:id/users/

Example response

Status 200
RESPONSE
{
"users": [
{
"id": "string",
"name": "string",
"display_name": "string"
}
],
"lastRefreshedAt": "string",
"has_more": true
}

Retrieve integrations authorize

Example request

GET /api/projects/:project_id/integrations/authorize
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/authorize/

Example response

Status 200 No response body

Create integrations domain connect apply url

Unified endpoint for generating Domain Connect apply URLs.

Accepts a context ("email" or "proxy") and the relevant resource ID. The backend resolves the domain, template variables, and service ID based on context, then builds the signed apply URL.

Request parameters

  • kind
  • config

Example request

POST /api/projects/:project_id/integrations/domain-connect/apply-url
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/domain-connect/apply-url/\
-d kind=undefined

Example response

Status 200 No response body

Retrieve integrations domain connect check

Example request

GET /api/projects/:project_id/integrations/domain-connect/check
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/domain-connect/check/

Example response

Status 200 No response body

Retrieve integrations github available installations

List GitHub installations this project can link.

A GitHub App installs once per organization, so a second project links an existing installation rather than reinstalling. This backs the picker: when more than one option exists, the client passes the chosen installation_id to github/link_existing. The list also includes installations the user's personal GitHub link can see but that aren't linked to any project yet (source_team_id: null) — orphan installations approved on GitHub outside PostHog's callback, which github/link_existing can adopt.

Required API key scopes

integration:read

Response


Example request

GET /api/projects/:project_id/integrations/github/available_installations
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/github/available_installations/

Example response

Status 200
RESPONSE
{
"discovery_id": "cdd44607-512c-4795-96df-93dabc33c12d",
"discovered_at": "2019-08-24T14:15:22Z",
"personal_github_login": "string",
"personal_discovery_status": "ok",
"installations": [
{
"installation_id": "string",
"account_name": "string",
"account_type": "string",
"source_team_id": 0,
"source_team_name": "string"
}
],
"personal_github_connected": true
}

Create integrations github link existing

Reuse a GitHub installation already linked to a sibling team in the same organization.

Required API key scopes

integration:write

Request parameters

  • discovery_id
    string | null
  • source_team_id
    integer | null
  • installation_id
    string | null

Response


Example request

POST /api/projects/:project_id/integrations/github/link_existing
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/github/link_existing/\
-d discovery_id="string"

Example response

Status 200
RESPONSE
{
"id": 0,
"kind": "anthropic",
"config": null,
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"errors": "string",
"display_name": "string",
"files_write_requestable": true,
"installation_shared": true,
"installation_status": "connected"
}

Create integrations github oauth authorize

Mint a User OAuth URL to bootstrap a fresh code when the install flow returns without one.

Required API key scopes

integration:write

Request parameters

  • installation_id
    string
  • next
    string
  • connect_from

Response


Example request

POST /api/projects/:project_id/integrations/github/oauth_authorize
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/github/oauth_authorize/\
-d installation_id="string"

Example response

Status 200
RESPONSE
{
"oauth_url": "string"
}

Create integrations github prepare callback

Seed GitHub setup callback state without redirecting to GitHub.

Used when the user opens an existing installation's settings on github.com (e.g. PostHog Code "Update in GitHub") so the subsequent Setup URL redirect can be validated.

Required API key scopes

integration:write

Request parameters

  • next
    string
  • installation_id
    string

Example request

POST /api/projects/:project_id/integrations/github/prepare_callback
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/integrations/github/prepare_callback/\
-d next="string"

Example response

Status 204 No response body