Integrations-3

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

Endpoints

GET
GET
GET
GET
GET
POST
GET
POST
POST
GET
GET

Retrieve environments integrations linear teams

Path parameters

  • id
    integer

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 No response body

Retrieve environments integrations linear teams

Path parameters

  • id
    integer

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 No response body

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

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

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

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

  • kind
  • config

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 kind=undefined

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

  • kind
  • config

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 kind=undefined

Example response

Status 200 No response body

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

  • kind
  • config

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 kind=undefined

Example response

Status 200 No response body

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

  • kind
  • config

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 kind=undefined

Example response

Status 200 No response body

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

Community questions

Questions about this page? or post a community question.