Core-5

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

Endpoints

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

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

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

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

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

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

Create invites bulk

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

Example request

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

Example response

Status 200 No response body

Create invites delegate

Create an onboarding delegation invite: an admin-level invite flagged as a setup delegation. Sends a single dedicated delegation email and records the inviting user as having delegated.

Required API key scopes

organization_member:write

Request parameters

  • target_email
    string
  • message
    string
  • step_at_delegation
    string

Response


Example request

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

Example response

Status 200
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
}


Create legal documents

Required API key scopes

legal_document:write

Request parameters

  • document_type
  • company_name
    string
  • company_address
    string
  • representative_email
    string

Response


Example request

POST /api/organizations/:organization_id/legal_documents
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/legal_documents/\
-d document_type=undefined,\
-d company_name="string",\
-d company_address="string",\
-d representative_email="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"document_type": "string",
"company_name": "string",
"representative_email": "string",
"status": "string",
"created_by": {
"first_name": "string",
"email": "string"
},
"created_at": "2019-08-24T14:15:22Z"
}



List all members

Required API key scopes

organization_member:read

Query parameters

  • limit
    integer
  • offset
    integer
  • order
    string
    One of: "-joined_at""joined_at"
  • search
    string

Response


Example request

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

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",
"user": {
"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"
},
"level": 1,
"joined_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"is_2fa_enabled": true,
"has_social_auth": true,
"last_login": "2019-08-24T14:15:22Z"
}
]
}

Update members

Required API key scopes

organization_member:write

Path parameters

  • user__uuid
    string

Request parameters

  • level

Response


Example request

PATCH /api/organizations/:organization_id/members/:user__uuid
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/members/:user__uuid/\
-d user=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user": {
"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"
},
"level": 1,
"joined_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"is_2fa_enabled": true,
"has_social_auth": true,
"last_login": "2019-08-24T14:15:22Z"
}

Delete members

Required API key scopes

organization_member:write

Path parameters

  • user__uuid
    string

Example request

DELETE /api/organizations/:organization_id/members/:user__uuid
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/members/:user__uuid/

Example response

Status 204 No response body

Retrieve members scoped api keys

Path parameters

  • user__uuid
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user": {
"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"
},
"level": 1,
"joined_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"is_2fa_enabled": true,
"has_social_auth": true,
"last_login": "2019-08-24T14:15:22Z"
}

List all oauth applications

ViewSet for listing OAuth applications at the organization level (read-only).

Required API key scopes

organization:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"client_id": "string",
"redirect_uris_list": [
"string"
],
"is_verified": true,
"created": "2019-08-24T14:15:22Z",
"updated": "2019-08-24T14:15:22Z"
}
]
}

Community questions

Questions about this page? or post a community question.