Organizations

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

Endpoints

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

Update domains

Required API key scopes

organization:write

Path parameters

  • id
    string

Request parameters

  • domain
    string
  • jit_provisioning_enabled
    boolean
  • sso_enforcement
    string
  • saml_entity_id
    stringnull
  • saml_acs_url
    stringnull
  • saml_x509_cert
    stringnull
  • scim_enabled
    boolean
  • id_jag_issuer_url
    stringnull
  • id_jag_jwks_url
    stringnull
  • id_jag_allowed_clients
    array
  • identity_provider_config
    stringnull

Response


Example request

PATCH /api/organizations/:organization_id/domains/:id
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/domains/:id/\
-d domain="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"domain": "string",
"is_verified": true,
"verified_at": "2019-08-24T14:15:22Z",
"verification_challenge": "string",
"jit_provisioning_enabled": true,
"sso_enforcement": "string",
"has_saml": true,
"saml_entity_id": "string",
"saml_acs_url": "string",
"saml_x509_cert": "string",
"has_scim": true,
"scim_enabled": true,
"scim_base_url": "string",
"scim_bearer_token": "string",
"has_id_jag": true,
"id_jag_issuer_url": "string",
"id_jag_jwks_url": "string",
"id_jag_allowed_clients": [
"string"
],
"identity_provider_config": "3e237978-0e52-4adb-b24c-b6519404b7da"
}

Delete domains

Required API key scopes

organization:write

Path parameters

  • id
    string

Example request

DELETE /api/organizations/:organization_id/domains/: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/domains/:id/

Example response

Status 204 No response body

Retrieve domains scim logs

Path parameters

  • id
    string

Example request

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

Example response

Status 200 No response body

Create domains scim token

Regenerate SCIM bearer token.

Path parameters

  • id
    string

Request parameters

  • domain
    string
  • jit_provisioning_enabled
    boolean
  • sso_enforcement
    string
  • saml_entity_id
    stringnull
  • saml_acs_url
    stringnull
  • saml_x509_cert
    stringnull
  • scim_enabled
    boolean
  • id_jag_issuer_url
    stringnull
  • id_jag_jwks_url
    stringnull
  • id_jag_allowed_clients
    array
  • identity_provider_config
    stringnull

Example request

POST /api/organizations/:organization_id/domains/:id/scim/token
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/organizations/:organization_id/domains/:id/scim/token/\
-d domain="string"

Example response

Status 200 No response body

Create domains verify

Path parameters

  • id
    string

Request parameters

  • domain
    string
  • jit_provisioning_enabled
    boolean
  • sso_enforcement
    string
  • saml_entity_id
    stringnull
  • saml_acs_url
    stringnull
  • saml_x509_cert
    stringnull
  • scim_enabled
    boolean
  • id_jag_issuer_url
    stringnull
  • id_jag_jwks_url
    stringnull
  • id_jag_allowed_clients
    array
  • identity_provider_config
    stringnull

Example request

POST /api/organizations/:organization_id/domains/:id/verify
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/organizations/:organization_id/domains/:id/verify/\
-d domain="string"

Example response

Status 200 No response body

List all identity provider configs

Required API key scopes

organization:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_entity_id": "string",
"saml_acs_url": "string",
"saml_x509_cert": "string",
"has_scim": true,
"scim_enabled": true,
"scim_bearer_token": "string",
"has_id_jag": true,
"id_jag_issuer_url": "string",
"id_jag_jwks_url": "string",
"id_jag_allowed_clients": [
"string"
]
}
]
}

Create identity provider configs

Required API key scopes

organization:write

Request parameters

  • name
    string
  • saml_entity_id
    stringnull
  • saml_acs_url
    stringnull
  • saml_x509_cert
    stringnull
  • scim_enabled
    boolean
  • id_jag_issuer_url
    stringnull
  • id_jag_jwks_url
    stringnull
  • id_jag_allowed_clients
    array

Response


Example request

POST /api/organizations/:organization_id/identity_provider_configs
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/organizations/:organization_id/identity_provider_configs/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_entity_id": "string",
"saml_acs_url": "string",
"saml_x509_cert": "string",
"has_scim": true,
"scim_enabled": true,
"scim_bearer_token": "string",
"has_id_jag": true,
"id_jag_issuer_url": "string",
"id_jag_jwks_url": "string",
"id_jag_allowed_clients": [
"string"
]
}

Retrieve identity provider configs

Required API key scopes

organization:read

Path parameters

  • id
    string

Response


Example request

GET /api/organizations/:organization_id/identity_provider_configs/: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/identity_provider_configs/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_entity_id": "string",
"saml_acs_url": "string",
"saml_x509_cert": "string",
"has_scim": true,
"scim_enabled": true,
"scim_bearer_token": "string",
"has_id_jag": true,
"id_jag_issuer_url": "string",
"id_jag_jwks_url": "string",
"id_jag_allowed_clients": [
"string"
]
}

Update identity provider configs

Required API key scopes

organization:write

Path parameters

  • id
    string

Request parameters

  • name
    string
  • saml_entity_id
    stringnull
  • saml_acs_url
    stringnull
  • saml_x509_cert
    stringnull
  • scim_enabled
    boolean
  • id_jag_issuer_url
    stringnull
  • id_jag_jwks_url
    stringnull
  • id_jag_allowed_clients
    array

Response


Example request

PATCH /api/organizations/:organization_id/identity_provider_configs/:id
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/identity_provider_configs/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_entity_id": "string",
"saml_acs_url": "string",
"saml_x509_cert": "string",
"has_scim": true,
"scim_enabled": true,
"scim_bearer_token": "string",
"has_id_jag": true,
"id_jag_issuer_url": "string",
"id_jag_jwks_url": "string",
"id_jag_allowed_clients": [
"string"
]
}

Delete identity provider configs

Required API key scopes

organization:write

Path parameters

  • id
    string

Example request

DELETE /api/organizations/:organization_id/identity_provider_configs/: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/identity_provider_configs/:id/

Example response

Status 204 No response body

Create identity provider configs scim token

Regenerate the SCIM bearer token for this IdP config.

Path parameters

  • id
    string

Response


Example request

POST /api/organizations/:organization_id/identity_provider_configs/:id/scim/token
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/organizations/:organization_id/identity_provider_configs/:id/scim/token/

Example response

Status 200
RESPONSE
{
"scim_enabled": true,
"scim_bearer_token": "string"
}

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

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 invites

    Required API key scopes

    organization_member:read

    Query parameters

    • limit
      integer
    • offset
      integer

    Response


    Example request

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

    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",
    "target_email": "user@example.com",
    "first_name": "string",
    "emailing_attempt_made": true,
    "level": 1,
    "is_expired": true,
    "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"
    },
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "message": "string",
    "private_project_access": null,
    "send_email": true,
    "combine_pending_invites": false
    }
    ]
    }

    Create invites

    Required API key scopes

    organization_member:write

    Request parameters

    • target_email
      string
    • first_name
      string
    • level
    • message
      stringnull
    • private_project_access
    • send_email
      boolean
      Default: true
    • combine_pending_invites
      boolean
      Default: false

    Response


    Example request

    POST /api/organizations/:organization_id/invites
    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/organizations/:organization_id/invites/\
    -d target_email="string"

    Example response

    Status 201
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "target_email": "user@example.com",
    "first_name": "string",
    "emailing_attempt_made": true,
    "level": 1,
    "is_expired": true,
    "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"
    },
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "message": "string",
    "private_project_access": null,
    "send_email": true,
    "combine_pending_invites": false
    }

    Delete invites

    Required API key scopes

    organization_member:write

    Path parameters

    • id
      string

    Example request

    DELETE /api/organizations/:organization_id/invites/: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/invites/:id/

    Example response

    Status 204 No response body

    Community questions

    Questions about this page? or post a community question.