Integrations

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

Endpoints

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

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 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 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 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 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

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

  • source_team_id
    integernull
  • installation_id
    string

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 source_team_id=["integer","null"]

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"
}

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

Create integrations request access

Notify project admins that a member is requesting an integration be connected.

Required API key scopes

integration:write

Request parameters

  • kind
  • reason
    string

Response


Example request

POST /api/projects/:project_id/integrations/request_access
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/request_access/\
-d kind=undefined,\
-d reason="string"

Example response

Status 200
RESPONSE
{
"success": true
}

Community questions