Platform

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

Endpoints

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

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 roles

Also available via the PostHog MCP server:

  • roles-listList organization roles.

Required API key scopes

organization:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"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"
},
"members": [
{}
],
"is_default": true
}
]
}

Create roles

Required API key scopes

organization:write

Request parameters

  • name
    string

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"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"
},
"members": [
{}
],
"is_default": true
}

Retrieve roles

Required API key scopes

organization:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"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"
},
"members": [
{}
],
"is_default": true
}

Update roles

Required API key scopes

organization:write

Path parameters

  • id
    string

Request parameters

  • name
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"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"
},
"members": [
{}
],
"is_default": true
}

Delete roles

Required API key scopes

organization:write

Path parameters

  • id
    string

Example request

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

Example response

Status 204 No response body

List all roles role memberships

Required API key scopes

organization:read

Path parameters

  • role_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
"organization_member": {
"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"
},
"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"
},
"joined_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"user_uuid": "7c4d2d7d-8620-4fb3-967a-4a621082cf1f"
}
]
}

Create roles role memberships

Required API key scopes

organization:write

Path parameters

  • role_id
    string

Request parameters

  • user_uuid
    string

Response


Example request

POST /api/organizations/:organization_id/roles/:role_id/role_memberships
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/roles/:role_id/role_memberships/\
-d user_uuid="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
"organization_member": {
"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"
},
"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"
},
"joined_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"user_uuid": "7c4d2d7d-8620-4fb3-967a-4a621082cf1f"
}

Retrieve roles role memberships

Required API key scopes

organization:read

Path parameters

  • id
    string
  • role_id
    string

Response


Example request

GET /api/organizations/:organization_id/roles/:role_id/role_memberships/: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/roles/:role_id/role_memberships/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
"organization_member": {
"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"
},
"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"
},
"joined_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"user_uuid": "7c4d2d7d-8620-4fb3-967a-4a621082cf1f"
}

Delete roles role memberships

Required API key scopes

organization:write

Path parameters

  • id
    string
  • role_id
    string

Example request

DELETE /api/organizations/:organization_id/roles/:role_id/role_memberships/: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/roles/:role_id/role_memberships/:id/

Example response

Status 204 No response body

Retrieve welcome current

Aggregated payload for the invited-user welcome screen.

Response


Example request

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

Example response

Status 200
RESPONSE
{
"organization_name": "string",
"inviter": {
"name": "string",
"email": "user@example.com"
},
"team_members": [
{
"name": "string",
"email": "user@example.com",
"avatar": "string",
"role": "string",
"last_active": "today"
}
],
"recent_activity": [
{
"type": "string",
"actor_name": "string",
"entity_name": "string",
"entity_url": "string",
"timestamp": "2019-08-24T14:15:22Z"
}
],
"popular_dashboards": [
{
"id": 0,
"name": "string",
"description": "string",
"team_id": 0,
"url": "string"
}
],
"products_in_use": [
"string"
],
"suggested_next_steps": [
{
"label": "string",
"href": "string",
"reason": "string",
"docs_href": "string",
"product_key": "string"
}
],
"is_organization_first_user": true
}
Status 404 Current organization not found

List all activity log

Also available via the PostHog MCP server:

  • activity-log-listList recent activity in the project.

Required API key scopes

activity_log:read

Query parameters

  • item_id
    string
  • page
    integer
  • page_size
    integer
    Default: 100
  • scope
    string
    One of: "Cohort""FeatureFlag""Person""Group""Insight""Plugin""PluginConfig""HogFunction""HogFlow""DataManagement""EventDefinition""PropertyDefinition""Notebook""Endpoint""EndpointVersion""Dashboard""Replay""Experiment""ExperimentHoldout""ExperimentSavedMetric""Survey""EarlyAccessFeature""SessionRecordingPlaylist""Comment""Team""Project""ErrorTrackingIssue""DataWarehouseSavedQuery""LegalDocument""Organization""OrganizationDomain""OrganizationMembership""Role""UserGroup""BatchExport""BatchImport""Integration""Annotation""Tag""TaggedItem""Subscription""PersonalAPIKey""ProjectSecretAPIKey""User""Action""AlertConfiguration""Threshold""AlertSubscription""ExternalDataSource""ExternalDataSchema""Evaluation""LLMTrace""WebAnalyticsFilterPreset""CustomerProfileConfig""Log""LogsAlertConfiguration""LogsExclusionRule""ProductTour""Ticket"
  • scopes
    array
  • user
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"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"
},
"unread": true,
"team_id": 2147483647,
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"was_impersonated": true,
"is_system": true,
"client": "string",
"activity": "string",
"item_id": "string",
"scope": "string",
"detail": null,
"created_at": "2019-08-24T14:15:22Z"
}
]
}

List all advanced activity logs

Also available via the PostHog MCP server:

  • advanced-activity-logs-listList activity logs with advanced filtering.

Required API key scopes

activity_log:read

Query parameters

  • activities
    array
    Default:
  • clients
    array
    Default:
  • detail_filters
    string
  • end_date
    string
  • hogql_filter
    string
  • is_system
    booleannull
  • item_ids
    array
    Default:
  • page
    integer
  • page_size
    integer
    Default: 100
  • scopes
    array
    Default:
  • search_text
    string
  • start_date
    string
  • team_ids
    array
    Default:
  • users
    array
    Default:
  • was_impersonated
    booleannull

Response


Example request

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

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"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"
},
"unread": true,
"team_id": 2147483647,
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"was_impersonated": true,
"is_system": true,
"client": "string",
"activity": "string",
"item_id": "string",
"scope": "string",
"detail": null,
"created_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve advanced activity logs available filters

Required API key scopes

activity_log:read

Response


Example request

GET /api/projects/:project_id/advanced_activity_logs/available_filters
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/advanced_activity_logs/available_filters/

Example response

Status 200
RESPONSE
{
"static_filters": {
"users": [
{}
],
"scopes": [
{}
],
"activities": [
{}
],
"clients": [
{}
]
},
"detail_fields": {}
}

Create advanced activity logs export

Request parameters

  • user
  • team_id
    integernull
  • organization_id
    stringnull
  • was_impersonated
    booleannull
  • is_system
    booleannull
  • client
    stringnull
  • activity
    string
  • item_id
    stringnull
  • scope
    string
  • detail
  • created_at
    string

Response


Example request

POST /api/projects/:project_id/advanced_activity_logs/export
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/advanced_activity_logs/export/\
-d user=undefined,\
-d activity="string",\
-d scope="string"

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"
},
"unread": true,
"team_id": 2147483647,
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"was_impersonated": true,
"is_system": true,
"client": "string",
"activity": "string",
"item_id": "string",
"scope": "string",
"detail": null,
"created_at": "2019-08-24T14:15:22Z"
}

Community questions

Questions about this page? or post a community question.