Integrations

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

Endpoints

POST
GET
POST
POST
POST
POST

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

Questions about this page? or post a community question.