Integrations

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

Endpoints

GET
GET
GET
GET
GET
POST
GET
POST
POST
POST
POST
GET
GET
DELETE
PATCH
GET
POST
GET
DELETE
GET

Retrieve environments integrations linear teams

Required API key scopes

integration:read

Path parameters

  • id
    integer

Response


Example request

GET /api/environments/:environment_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/environments/:environment_id/integrations/:id/linear_teams/

Example response

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

Retrieve environments integrations linkedin ads accounts

Path parameters

  • id
    integer

Example request

GET /api/environments/:environment_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/environments/:environment_id/integrations/:id/linkedin_ads_accounts/

Example response

Status 200 No response body

Retrieve environments integrations linkedin ads conversion rules

Path parameters

  • id
    integer

Example request

GET /api/environments/:environment_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/environments/:environment_id/integrations/:id/linkedin_ads_conversion_rules/

Example response

Status 200 No response body

Retrieve environments integrations twilio phone numbers

Path parameters

  • id
    integer

Example request

GET /api/environments/:environment_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/environments/:environment_id/integrations/:id/twilio_phone_numbers/

Example response

Status 200 No response body

Retrieve environments integrations authorize

Example request

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

Example response

Status 200 No response body

Create environments 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/environments/:environment_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/environments/:environment_id/integrations/domain-connect/apply-url/\
-d kind=undefined

Example response

Status 200 No response body

Retrieve environments integrations domain connect check

Example request

GET /api/environments/:environment_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/environments/:environment_id/integrations/domain-connect/check/

Example response

Status 200 No response body

Create environments 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/environments/:environment_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/environments/:environment_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 environments 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/environments/:environment_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/environments/:environment_id/integrations/github/oauth_authorize/\
-d installation_id="string"

Example response

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

Create environments 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/environments/:environment_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/environments/:environment_id/integrations/github/prepare_callback/\
-d next="string"

Example response

Status 204 No response body

Create environments 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/environments/:environment_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/environments/:environment_id/integrations/request_access/\
-d kind=undefined,\
-d reason="string"

Example response

Status 200
RESPONSE
{
"success": true
}

List all org organizations integrations

ViewSet for organization-level integrations.

Provides access to integrations that are scoped to the entire organization (vs. project-level integrations). Examples include Vercel, AWS Marketplace, etc.

Creation is handled by the integration installation flows (e.g., Vercel marketplace installation). Users can disconnect integrations via the DELETE endpoint.

Required API key scopes

organization_integration:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "vercel",
"integration_id": "string",
"config": null,
"created_at": "2019-08-24T14:15:22Z",
"updated_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"
}
}
]
}

Retrieve org organizations integrations

ViewSet for organization-level integrations.

Provides access to integrations that are scoped to the entire organization (vs. project-level integrations). Examples include Vercel, AWS Marketplace, etc.

Creation is handled by the integration installation flows (e.g., Vercel marketplace installation). Users can disconnect integrations via the DELETE endpoint.

Required API key scopes

organization_integration:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "vercel",
"integration_id": "string",
"config": null,
"created_at": "2019-08-24T14:15:22Z",
"updated_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"
}
}

Delete org organization integrations

ViewSet for organization-level integrations.

Provides access to integrations that are scoped to the entire organization (vs. project-level integrations). Examples include Vercel, AWS Marketplace, etc.

Creation is handled by the integration installation flows (e.g., Vercel marketplace installation). Users can disconnect integrations via the DELETE endpoint.

Required API key scopes

organization_integration:write

Path parameters

  • id
    string

Example request

DELETE /api/organizations/:organization_id/integrations/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/organizations/:organization_id/integrations/:id/

Example response

Status 204 No response body
Status 409 Deauthorization is blocked because the account has unpaid invoices.

Update integrations environment mapping

ViewSet for organization-level integrations.

Provides access to integrations that are scoped to the entire organization (vs. project-level integrations). Examples include Vercel, AWS Marketplace, etc.

Creation is handled by the integration installation flows (e.g., Vercel marketplace installation). Users can disconnect integrations via the DELETE endpoint.

Path parameters

  • id
    string

Request parameters


    Response


    Example request

    PATCH /api/organizations/:organization_id/integrations/:id/environment-mapping
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X PATCH \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    <ph_app_host>/api/organizations/:organization_id/integrations/:id/environment-mapping/\
    -d kind=undefined

    Example response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "kind": "vercel",
    "integration_id": "string",
    "config": null,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_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"
    }
    }

    List all integrations

    Also available via the PostHog MCP server:

    • integrations-listList integrations

    Required API key scopes

    integration:read

    Query parameters

    • kind
      string
      One of: "anthropic""apns""aws-s3""azure-blob""bing-ads""clickup""customerio-app""customerio-track""customerio-webhook""databricks""email""firebase""github""gitlab""google-ads""google-analytics""google-cloud-service-account""google-cloud-storage""google-pubsub""google-search-console""google-sheets""hubspot""intercom""jira""linear""linkedin-ads""meta-ads""pinterest-ads""postgresql""reddit-ads""s3-compatible""salesforce""slack""slack-posthog-code""snapchat""stripe""tiktok-ads""twilio""vercel"
    • limit
      integer
    • offset
      integer

    Response


    Example request

    GET /api/projects/:project_id/integrations
    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/

    Example response

    Status 200
    RESPONSE
    {
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
    {
    "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

    Required API key scopes

    integration:write

    Request parameters

    • kind
    • config

    Response


    Example request

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

    Example response

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

    Retrieve integrations

    Required API key scopes

    integration:read

    Path parameters

    • id
      integer

    Response


    Example request

    GET /api/projects/:project_id/integrations/:id
    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/

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

    Delete integrations

    Required API key scopes

    integration:write

    Path parameters

    • id
      integer

    Example request

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

    Example response

    Status 204 No response body

    Retrieve integrations anthropic managed agent envs

    Required API key scopes

    integration:read

    Path parameters

    • id
      integer

    Example request

    GET /api/projects/:project_id/integrations/:id/anthropic_managed_agent_environments
    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/anthropic_managed_agent_environments/

    Example response

    Status 200 No response body

    Community questions

    Questions about this page? or post a community question.