Organizations

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

Endpoints

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

List all desktop beta terms

Required API key scopes

organization:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"is_desktop_beta_terms_accepted": true
}

Create desktop beta terms

Required API key scopes

organization:write

Response


Example request

POST /api/organizations/:organization_id/desktop_beta_terms
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/desktop_beta_terms/

Example response

Status 200
RESPONSE
{
"is_desktop_beta_terms_accepted": true
}

List all domains

Required API key scopes

organization:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"domain": "string",
"is_verified": true,
"verified_at": "2019-08-24T14:15:22Z",
"verification_challenge": "string",
"jit_provisioning_enabled": true,
"sso_enforcement": "string",
"scim_base_url": "string"
}
]
}

Create domains

Required API key scopes

organization:write

Request parameters

  • domain
    string
  • jit_provisioning_enabled
    boolean
  • sso_enforcement
    string

Response


Example request

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

Example response

Status 201
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",
"scim_base_url": "string"
}

Retrieve domains

Required API key scopes

organization:read

Path parameters

  • id
    string

Response


Example request

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

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",
"scim_base_url": "string"
}

Update domains

Required API key scopes

organization:write

Path parameters

  • id
    string

Request parameters

  • domain
    string
  • jit_provisioning_enabled
    boolean
  • sso_enforcement
    string

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",
"scim_base_url": "string"
}

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 verify

Path parameters

  • id
    string

Request parameters

  • domain
    string
  • jit_provisioning_enabled
    boolean
  • sso_enforcement
    string

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",
"domain_scope": "all",
"config_scope": "saml",
"organization_domain_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_relay_state": "string",
"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
  • domain_scope
  • config_scope
  • organization_domain_ids
    array
  • 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",
"domain_scope": "all",
"config_scope": "saml",
"organization_domain_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_relay_state": "string",
"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",
"domain_scope": "all",
"config_scope": "saml",
"organization_domain_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_relay_state": "string",
"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
  • domain_scope
  • config_scope
  • organization_domain_ids
    array
  • 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",
"domain_scope": "all",
"config_scope": "saml",
"organization_domain_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"has_saml": true,
"saml_relay_state": "string",
"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
Status 409 Deauthorization is blocked because the account has unpaid invoices.