Organizations

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

Endpoints

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

Retrieve

Required API key scopes

organization:read

Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}
]
}

Retrieve

Required API key scopes

organization:read

Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}
]
}

Create

Required API key scopes

organization:write

Request parameters

  • name
    string
  • logo_media_id
    string
  • is_member_join_email_enabled
    boolean
  • enforce_2fa
    boolean
  • members_can_invite
    boolean
  • members_can_use_personal_api_keys
    boolean
  • allow_publicly_shared_resources
    boolean
  • is_ai_data_processing_approved
    boolean
  • default_experiment_stats_method

    Default statistical method for new experiments in this organization.

    • bayesian - Bayesian
    • frequentist - Frequentist
  • default_role_id
    string

    ID of the role to automatically assign to new members joining the organization


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

Create

Required API key scopes

organization:write

Request parameters

  • name
    string
  • logo_media_id
    string
  • is_member_join_email_enabled
    boolean
  • enforce_2fa
    boolean
  • members_can_invite
    boolean
  • members_can_use_personal_api_keys
    boolean
  • allow_publicly_shared_resources
    boolean
  • is_ai_data_processing_approved
    boolean
  • default_experiment_stats_method

    Default statistical method for new experiments in this organization.

    • bayesian - Bayesian
    • frequentist - Frequentist
  • default_role_id
    string

    ID of the role to automatically assign to new members joining the organization


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

Retrieve

Required API key scopes

organization:read

Path parameters

  • id
    string

    A UUID string identifying this organization.


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

Retrieve

Required API key scopes

organization:read

Path parameters

  • id
    string

    A UUID string identifying this organization.


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

Update partial

Required API key scopes

organization:write

Path parameters

  • id
    string

    A UUID string identifying this organization.


Request parameters

  • name
    string
  • logo_media_id
    string
  • is_member_join_email_enabled
    boolean
  • enforce_2fa
    boolean
  • members_can_invite
    boolean
  • members_can_use_personal_api_keys
    boolean
  • allow_publicly_shared_resources
    boolean
  • is_ai_data_processing_approved
    boolean
  • default_experiment_stats_method

    Default statistical method for new experiments in this organization.

    • bayesian - Bayesian
    • frequentist - Frequentist
  • default_role_id
    string

    ID of the role to automatically assign to new members joining the organization


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

Update partial

Required API key scopes

organization:write

Path parameters

  • id
    string

    A UUID string identifying this organization.


Request parameters

  • name
    string
  • logo_media_id
    string
  • is_member_join_email_enabled
    boolean
  • enforce_2fa
    boolean
  • members_can_invite
    boolean
  • members_can_use_personal_api_keys
    boolean
  • allow_publicly_shared_resources
    boolean
  • is_ai_data_processing_approved
    boolean
  • default_experiment_stats_method

    Default statistical method for new experiments in this organization.

    • bayesian - Bayesian
    • frequentist - Frequentist
  • default_role_id
    string

    ID of the role to automatically assign to new members joining the organization


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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

Delete

Required API key scopes

organization:write

Path parameters

  • id
    string

    A UUID string identifying this organization.


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

Delete

Required API key scopes

organization:write

Path parameters

  • id
    string

    A UUID string identifying this organization.


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

Create environments rollback

Trigger environments rollback migration for users previously on multi-environment projects. The request data should be a mapping of source environment IDs to target environment IDs. Example: { "2": 2, "116911": 2, "99346": 99346, "140256": 99346 }

Path parameters

  • id
    string

    A UUID string identifying this organization.


Request parameters

  • name
    string
  • logo_media_id
    string
  • is_member_join_email_enabled
    boolean
  • enforce_2fa
    boolean
  • members_can_invite
    boolean
  • members_can_use_personal_api_keys
    boolean
  • allow_publicly_shared_resources
    boolean
  • is_ai_data_processing_approved
    boolean
  • default_experiment_stats_method

    Default statistical method for new experiments in this organization.

    • bayesian - Bayesian
    • frequentist - Frequentist
  • default_role_id
    string

    ID of the role to automatically assign to new members joining the organization


Response


Example request

POST /api/organizations/:id/environments_rollback
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/:id/environments_rollback/\
-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": [
{
"property1": null,
"property2": null
}
],
"projects": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
null
],
"is_member_join_email_enabled": true,
"metadata": "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": "string",
"is_ai_data_processing_approved": true,
"default_experiment_stats_method": "bayesian",
"default_role_id": "string"
}

List all batch exports

Required API key scopes

batch_export:read

Path parameters

  • organization_id
    string

Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


Response


Example request

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

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",
"team_id": 0,
"name": "string",
"model": "events",
"destination": {
"type": "S3",
"config": null,
"integration": 0,
"integration_id": 0
},
"interval": "hour",
"paused": true,
"created_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"last_paused_at": "2019-08-24T14:15:22Z",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"latest_runs": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "Cancelled",
"records_completed": -2147483648,
"latest_error": "string",
"data_interval_start": "2019-08-24T14:15:22Z",
"data_interval_end": "2019-08-24T14:15:22Z",
"cursor": "string",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"records_total_count": -2147483648,
"bytes_exported": -9223372036854776000,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f",
"backfill": "4f806519-f4aa-4807-bea5-95595ab1adf0"
}
],
"hogql_query": "string",
"schema": null,
"filters": null
}
]
}

Create batch exports

Required API key scopes

batch_export:write

Path parameters

  • organization_id
    string

Request parameters

  • name
    string

    A human-readable name for this BatchExport.

  • model

    Which model this BatchExport is exporting.

    • events - Events
    • persons - Persons
    • sessions - Sessions
  • destination
  • interval
  • paused
    boolean

    Whether this BatchExport is paused or not.

  • last_paused_at
    string

    The timestamp at which this BatchExport was last paused.

  • start_at
    string

    Time before which any Batch Export runs won't be triggered.

  • end_at
    string

    Time after which any Batch Export runs won't be triggered.

  • hogql_query
    string
  • filters

Response


Example request

POST /api/organizations/:organization_id/batch_exports
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/batch_exports/\
-d name="string",\
-d destination=undefined,\
-d interval=undefined

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"name": "string",
"model": "events",
"destination": {
"type": "S3",
"config": null,
"integration": 0,
"integration_id": 0
},
"interval": "hour",
"paused": true,
"created_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"last_paused_at": "2019-08-24T14:15:22Z",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"latest_runs": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "Cancelled",
"records_completed": -2147483648,
"latest_error": "string",
"data_interval_start": "2019-08-24T14:15:22Z",
"data_interval_end": "2019-08-24T14:15:22Z",
"cursor": "string",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"records_total_count": -2147483648,
"bytes_exported": -9223372036854776000,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f",
"backfill": "4f806519-f4aa-4807-bea5-95595ab1adf0"
}
],
"hogql_query": "string",
"schema": null,
"filters": null
}

Retrieve batch exports

Required API key scopes

batch_export:read

Path parameters

  • id
    string

    A UUID string identifying this batch export.

  • organization_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"name": "string",
"model": "events",
"destination": {
"type": "S3",
"config": null,
"integration": 0,
"integration_id": 0
},
"interval": "hour",
"paused": true,
"created_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"last_paused_at": "2019-08-24T14:15:22Z",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"latest_runs": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "Cancelled",
"records_completed": -2147483648,
"latest_error": "string",
"data_interval_start": "2019-08-24T14:15:22Z",
"data_interval_end": "2019-08-24T14:15:22Z",
"cursor": "string",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"records_total_count": -2147483648,
"bytes_exported": -9223372036854776000,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f",
"backfill": "4f806519-f4aa-4807-bea5-95595ab1adf0"
}
],
"hogql_query": "string",
"schema": null,
"filters": null
}

Update batch exports

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

  • organization_id
    string

Request parameters

  • name
    string

    A human-readable name for this BatchExport.

  • model

    Which model this BatchExport is exporting.

    • events - Events
    • persons - Persons
    • sessions - Sessions
  • destination
  • interval
  • paused
    boolean

    Whether this BatchExport is paused or not.

  • last_paused_at
    string

    The timestamp at which this BatchExport was last paused.

  • start_at
    string

    Time before which any Batch Export runs won't be triggered.

  • end_at
    string

    Time after which any Batch Export runs won't be triggered.

  • hogql_query
    string
  • filters

Response


Example request

PATCH /api/organizations/:organization_id/batch_exports/: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/batch_exports/:id/\
-d team_id="integer"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"name": "string",
"model": "events",
"destination": {
"type": "S3",
"config": null,
"integration": 0,
"integration_id": 0
},
"interval": "hour",
"paused": true,
"created_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"last_paused_at": "2019-08-24T14:15:22Z",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"latest_runs": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "Cancelled",
"records_completed": -2147483648,
"latest_error": "string",
"data_interval_start": "2019-08-24T14:15:22Z",
"data_interval_end": "2019-08-24T14:15:22Z",
"cursor": "string",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"records_total_count": -2147483648,
"bytes_exported": -9223372036854776000,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f",
"backfill": "4f806519-f4aa-4807-bea5-95595ab1adf0"
}
],
"hogql_query": "string",
"schema": null,
"filters": null
}

Delete batch exports

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

  • organization_id
    string

Example request

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

Example response

Status 204 No response body

Create batch exports backfill

Trigger a backfill for a BatchExport.

Note: This endpoint is deprecated. Please use POST /batch_exports/<id>/backfills/ instead.

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

  • organization_id
    string

Request parameters

  • name
    string

    A human-readable name for this BatchExport.

  • model

    Which model this BatchExport is exporting.

    • events - Events
    • persons - Persons
    • sessions - Sessions
  • destination
  • interval
  • paused
    boolean

    Whether this BatchExport is paused or not.

  • last_paused_at
    string

    The timestamp at which this BatchExport was last paused.

  • start_at
    string

    Time before which any Batch Export runs won't be triggered.

  • end_at
    string

    Time after which any Batch Export runs won't be triggered.

  • hogql_query
    string
  • filters

Example request

POST /api/organizations/:organization_id/batch_exports/:id/backfill
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/batch_exports/:id/backfill/\
-d name="string",\
-d destination=undefined,\
-d interval=undefined

Example response

Status 200 No response body
Next page →

Community questions

Questions about this page? or post a community question.