Platform

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

Endpoints

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

List all approval policies

Also available via the PostHog MCP server:

  • approval-policies-listList approval policies for the project.

Required API key scopes

approvals:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"action_key": "string",
"conditions": null,
"approver_config": null,
"allow_self_approve": true,
"bypass_org_membership_levels": null,
"bypass_roles": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"expires_after": "string",
"enabled": 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"
}
]
}

Create approval policies

Required API key scopes

approvals:write

Request parameters

  • action_key
    string
  • conditions
  • approver_config
  • allow_self_approve
    boolean
  • bypass_org_membership_levels
  • bypass_roles
    array
  • expires_after
    string
  • enabled
    boolean

Response


Example request

POST /api/environments/:project_id/approval_policies
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/:project_id/approval_policies/\
-d action_key="string",\
-d approver_config=undefined

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"action_key": "string",
"conditions": null,
"approver_config": null,
"allow_self_approve": true,
"bypass_org_membership_levels": null,
"bypass_roles": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"expires_after": "string",
"enabled": 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"
}

Retrieve approval policies

Required API key scopes

approvals:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"action_key": "string",
"conditions": null,
"approver_config": null,
"allow_self_approve": true,
"bypass_org_membership_levels": null,
"bypass_roles": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"expires_after": "string",
"enabled": 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"
}

Update approval policies

Required API key scopes

approvals:write

Path parameters

  • id
    string

Request parameters

  • action_key
    string
  • conditions
  • approver_config
  • allow_self_approve
    boolean
  • bypass_org_membership_levels
  • bypass_roles
    array
  • expires_after
    string
  • enabled
    boolean

Response


Example request

PATCH /api/environments/:project_id/approval_policies/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/approval_policies/:id/\
-d action_key="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"action_key": "string",
"conditions": null,
"approver_config": null,
"allow_self_approve": true,
"bypass_org_membership_levels": null,
"bypass_roles": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"expires_after": "string",
"enabled": 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"
}

Delete approval policies

Required API key scopes

approvals:write

Path parameters

  • id
    string

Example request

DELETE /api/environments/:project_id/approval_policies/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/approval_policies/:id/

Example response

Status 204 No response body

List all change requests

Also available via the PostHog MCP server:

  • change-requests-listList pending and resolved approval requests.

Required API key scopes

approvals:read

Query parameters

  • action_key
    string
  • limit
    integer
  • offset
    integer
  • requester
    number
  • resource_id
    string
  • resource_type
    string
  • state
    array

Response


Example request

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

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",
"action_key": "string",
"action_version": 0,
"resource_type": "string",
"resource_id": "string",
"intent": null,
"intent_display": null,
"policy_snapshot": null,
"validation_status": "valid",
"validation_errors": null,
"validated_at": "2019-08-24T14:15:22Z",
"state": "pending",
"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"
},
"applied_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",
"expires_at": "2019-08-24T14:15:22Z",
"applied_at": "2019-08-24T14:15:22Z",
"apply_error": "string",
"result_data": null,
"approvals": [
{}
],
"can_approve": true,
"can_cancel": true,
"is_requester": true,
"user_decision": "string"
}
]
}

Retrieve change requests

Required API key scopes

approvals:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"action_key": "string",
"action_version": 0,
"resource_type": "string",
"resource_id": "string",
"intent": null,
"intent_display": null,
"policy_snapshot": null,
"validation_status": "valid",
"validation_errors": null,
"validated_at": "2019-08-24T14:15:22Z",
"state": "pending",
"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"
},
"applied_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",
"expires_at": "2019-08-24T14:15:22Z",
"applied_at": "2019-08-24T14:15:22Z",
"apply_error": "string",
"result_data": null,
"approvals": [
{}
],
"can_approve": true,
"can_cancel": true,
"is_requester": true,
"user_decision": "string"
}

Create change requests approve

Approve a change request. If quorum is reached, automatically applies the change immediately.

Required API key scopes

approvals:write

Path parameters

  • id
    string

Request parameters


    Response


    Example request

    POST /api/environments/:project_id/change_requests/:id/approve
    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/:project_id/change_requests/:id/approve/\
    -d action_key="string"

    Example response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "action_key": "string",
    "action_version": 0,
    "resource_type": "string",
    "resource_id": "string",
    "intent": null,
    "intent_display": null,
    "policy_snapshot": null,
    "validation_status": "valid",
    "validation_errors": null,
    "validated_at": "2019-08-24T14:15:22Z",
    "state": "pending",
    "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"
    },
    "applied_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",
    "expires_at": "2019-08-24T14:15:22Z",
    "applied_at": "2019-08-24T14:15:22Z",
    "apply_error": "string",
    "result_data": null,
    "approvals": [
    {}
    ],
    "can_approve": true,
    "can_cancel": true,
    "is_requester": true,
    "user_decision": "string"
    }

    Create change requests cancel

    Cancel a change request. Only the requester can cancel their own pending change request.

    Required API key scopes

    approvals:write

    Path parameters

    • id
      string

    Request parameters


      Response


      Example request

      POST /api/environments/:project_id/change_requests/:id/cancel
      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/:project_id/change_requests/:id/cancel/\
      -d action_key="string"

      Example response

      Status 200
      RESPONSE
      {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "action_key": "string",
      "action_version": 0,
      "resource_type": "string",
      "resource_id": "string",
      "intent": null,
      "intent_display": null,
      "policy_snapshot": null,
      "validation_status": "valid",
      "validation_errors": null,
      "validated_at": "2019-08-24T14:15:22Z",
      "state": "pending",
      "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"
      },
      "applied_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",
      "expires_at": "2019-08-24T14:15:22Z",
      "applied_at": "2019-08-24T14:15:22Z",
      "apply_error": "string",
      "result_data": null,
      "approvals": [
      {}
      ],
      "can_approve": true,
      "can_cancel": true,
      "is_requester": true,
      "user_decision": "string"
      }

      Create change requests reject

      Reject a change request.

      Required API key scopes

      approvals:write

      Path parameters

      • id
        string

      Request parameters


        Response


        Example request

        POST /api/environments/:project_id/change_requests/:id/reject
        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/:project_id/change_requests/:id/reject/\
        -d action_key="string"

        Example response

        Status 200
        RESPONSE
        {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "action_key": "string",
        "action_version": 0,
        "resource_type": "string",
        "resource_id": "string",
        "intent": null,
        "intent_display": null,
        "policy_snapshot": null,
        "validation_status": "valid",
        "validation_errors": null,
        "validated_at": "2019-08-24T14:15:22Z",
        "state": "pending",
        "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"
        },
        "applied_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",
        "expires_at": "2019-08-24T14:15:22Z",
        "applied_at": "2019-08-24T14:15:22Z",
        "apply_error": "string",
        "result_data": null,
        "approvals": [
        {}
        ],
        "can_approve": true,
        "can_cancel": true,
        "is_requester": true,
        "user_decision": "string"
        }

        Retrieve

        Required API key scopes

        organization:read

        Query parameters

        • limit
          integer
        • offset
          integer

        Response


        Example request

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

        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",
        "slug": "string",
        "logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "membership_level": 1,
        "plugins_access_level": 0,
        "teams": [
        {}
        ],
        "projects": [
        {}
        ],
        "available_product_features": [
        null
        ],
        "is_member_join_email_enabled": true,
        "metadata": {
        "property1": "string",
        "property2": "string"
        },
        "customer_id": "string",
        "enforce_2fa": true,
        "members_can_invite": true,
        "members_can_use_personal_api_keys": true,
        "allow_publicly_shared_resources": true,
        "member_count": 0,
        "is_ai_data_processing_approved": true,
        "is_ai_training_opted_in": true,
        "is_ai_training_locked": true,
        "is_ai_training_cta_shown": true,
        "is_hipaa": true,
        "default_experiment_stats_method": "bayesian",
        "default_anonymize_ips": true,
        "default_role_id": "string",
        "is_active": true,
        "is_not_active_reason": "string",
        "is_pending_deletion": true
        }
        ]
        }

        Create

        Required API key scopes

        organization:write

        Request parameters

        • name
          string
        • logo_media_id
          stringnull
        • enforce_2fa
          booleannull
        • members_can_invite
          booleannull
        • members_can_use_personal_api_keys
          boolean
        • allow_publicly_shared_resources
          boolean
        • is_ai_data_processing_approved
          booleannull
        • is_ai_training_opted_in
          booleannull
        • default_experiment_stats_method
        • default_anonymize_ips
          boolean
        • default_role_id
          stringnull

        Response


        Example request

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

        Example response

        Status 201
        RESPONSE
        {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "string",
        "slug": "string",
        "logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "membership_level": 1,
        "plugins_access_level": 0,
        "teams": [
        {}
        ],
        "projects": [
        {}
        ],
        "available_product_features": [
        null
        ],
        "is_member_join_email_enabled": true,
        "metadata": {
        "property1": "string",
        "property2": "string"
        },
        "customer_id": "string",
        "enforce_2fa": true,
        "members_can_invite": true,
        "members_can_use_personal_api_keys": true,
        "allow_publicly_shared_resources": true,
        "member_count": 0,
        "is_ai_data_processing_approved": true,
        "is_ai_training_opted_in": true,
        "is_ai_training_locked": true,
        "is_ai_training_cta_shown": true,
        "is_hipaa": true,
        "default_experiment_stats_method": "bayesian",
        "default_anonymize_ips": true,
        "default_role_id": "string",
        "is_active": true,
        "is_not_active_reason": "string",
        "is_pending_deletion": true
        }

        Retrieve

        Required API key scopes

        organization:read

        Path parameters

        • id
          string

        Response


        Example request

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

        Example response

        Status 200
        RESPONSE
        {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "string",
        "slug": "string",
        "logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "membership_level": 1,
        "plugins_access_level": 0,
        "teams": [
        {}
        ],
        "projects": [
        {}
        ],
        "available_product_features": [
        null
        ],
        "is_member_join_email_enabled": true,
        "metadata": {
        "property1": "string",
        "property2": "string"
        },
        "customer_id": "string",
        "enforce_2fa": true,
        "members_can_invite": true,
        "members_can_use_personal_api_keys": true,
        "allow_publicly_shared_resources": true,
        "member_count": 0,
        "is_ai_data_processing_approved": true,
        "is_ai_training_opted_in": true,
        "is_ai_training_locked": true,
        "is_ai_training_cta_shown": true,
        "is_hipaa": true,
        "default_experiment_stats_method": "bayesian",
        "default_anonymize_ips": true,
        "default_role_id": "string",
        "is_active": true,
        "is_not_active_reason": "string",
        "is_pending_deletion": true
        }

        Update partial

        Required API key scopes

        organization:write

        Path parameters

        • id
          string

        Request parameters

        • name
          string
        • logo_media_id
          stringnull
        • enforce_2fa
          booleannull
        • members_can_invite
          booleannull
        • members_can_use_personal_api_keys
          boolean
        • allow_publicly_shared_resources
          boolean
        • is_ai_data_processing_approved
          booleannull
        • is_ai_training_opted_in
          booleannull
        • default_experiment_stats_method
        • default_anonymize_ips
          boolean
        • default_role_id
          stringnull

        Response


        Example request

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

        Example response

        Status 200
        RESPONSE
        {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "string",
        "slug": "string",
        "logo_media_id": "a5d9f2f1-d934-4d2e-bebe-4b3cdcd08a33",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "membership_level": 1,
        "plugins_access_level": 0,
        "teams": [
        {}
        ],
        "projects": [
        {}
        ],
        "available_product_features": [
        null
        ],
        "is_member_join_email_enabled": true,
        "metadata": {
        "property1": "string",
        "property2": "string"
        },
        "customer_id": "string",
        "enforce_2fa": true,
        "members_can_invite": true,
        "members_can_use_personal_api_keys": true,
        "allow_publicly_shared_resources": true,
        "member_count": 0,
        "is_ai_data_processing_approved": true,
        "is_ai_training_opted_in": true,
        "is_ai_training_locked": true,
        "is_ai_training_cta_shown": true,
        "is_hipaa": true,
        "default_experiment_stats_method": "bayesian",
        "default_anonymize_ips": true,
        "default_role_id": "string",
        "is_active": true,
        "is_not_active_reason": "string",
        "is_pending_deletion": true
        }

        Delete

        Required API key scopes

        organization:write

        Path parameters

        • id
          string

        Example request

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

        Example response

        Status 204 No response body

        List all org organizations advanced activity logs

        Organization-wide view of activity logs across every project in the organization.

        Mounted at /api/organizations/<organization_id>/advanced_activity_logs/. Restricted to organization admins and owners.

        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/organizations/:organization_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/organizations/:organization_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 org organizations advanced activity logs available filters

        Organization-wide view of activity logs across every project in the organization.

        Mounted at /api/organizations/<organization_id>/advanced_activity_logs/. Restricted to organization admins and owners.

        Required API key scopes

        activity_log:read

        Response


        Example request

        GET /api/organizations/:organization_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/organizations/:organization_id/advanced_activity_logs/available_filters/

        Example response

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

        Create org organizations advanced activity logs export

        Organization-wide view of activity logs across every project in the organization.

        Mounted at /api/organizations/<organization_id>/advanced_activity_logs/. Restricted to organization admins and owners.

        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/organizations/:organization_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/organizations/:organization_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.