Environments

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

Endpoints

GET
GET
GET
GET
GET
POST
GET
POST
GET
POST

Retrieve environments app metrics

Required API key scopes

plugin:read

Path parameters

  • id
    integer

    A unique integer value identifying this plugin config.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

GET /api/environments/:project_id/app_metrics/: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/app_metrics/:id/

Example response

Status 200 No response body

Retrieve environments app metrics

Required API key scopes

plugin:read

Path parameters

  • id
    integer

    A unique integer value identifying this plugin config.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

GET /api/environments/:project_id/app_metrics/: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/app_metrics/:id/

Example response

Status 200 No response body

Retrieve environments app metrics error details

Path parameters

  • id
    integer

    A unique integer value identifying this plugin config.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

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

Example response

Status 200 No response body

Retrieve environments app metrics error details

Path parameters

  • id
    integer

    A unique integer value identifying this plugin config.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

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

Example response

Status 200 No response body

Retrieve environments app metrics historical exports

Required API key scopes

plugin:read

Path parameters

  • plugin_config_id
    string
  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

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

Example response

Status 200 No response body

Retrieve environments app metrics historical exports

Required API key scopes

plugin:read

Path parameters

  • plugin_config_id
    string
  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

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

Example response

Status 200 No response body

Retrieve environments app metrics historical exports retrieve

Required API key scopes

plugin:read

Path parameters

  • id
    string
  • plugin_config_id
    string
  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

GET /api/environments/:project_id/app_metrics/:plugin_config_id/historical_exports/: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/app_metrics/:plugin_config_id/historical_exports/:id/

Example response

Status 200 No response body

Retrieve environments app metrics historical exports retrieve

Required API key scopes

plugin:read

Path parameters

  • id
    string
  • plugin_config_id
    string
  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Example request

GET /api/environments/:project_id/app_metrics/:plugin_config_id/historical_exports/: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/app_metrics/:plugin_config_id/historical_exports/:id/

Example response

Status 200 No response body

List all environments batch exports

Required API key scopes

batch_export:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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/environments/:project_id/batch_exports
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_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
}
]
}

List all environments batch exports

Required API key scopes

batch_export:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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/environments/:project_id/batch_exports
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_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 environments batch exports

Required API key scopes

batch_export:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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/environments/:project_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/environments/:project_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
}

Create environments batch exports

Required API key scopes

batch_export:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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/environments/:project_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/environments/:project_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
}

List all environments batch exports backfills

ViewSet for BatchExportBackfill models.

Allows creating and reading backfills, but not updating or deleting them.

Required API key scopes

batch_export:read

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • cursor
    string

    The pagination cursor value.

  • ordering
    string

    Which field to use when ordering the results.


Response


Example request

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

Example response

Status 200
RESPONSE
{
"next": "http://api.example.org/accounts/?cursor=cD00ODY%3D\"",
"previous": "http://api.example.org/accounts/?cursor=cj0xJnA9NDg3",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"progress": "string",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"status": "Cancelled",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"team": 0,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
}
]
}

List all environments batch exports backfills

ViewSet for BatchExportBackfill models.

Allows creating and reading backfills, but not updating or deleting them.

Required API key scopes

batch_export:read

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • cursor
    string

    The pagination cursor value.

  • ordering
    string

    Which field to use when ordering the results.


Response


Example request

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

Example response

Status 200
RESPONSE
{
"next": "http://api.example.org/accounts/?cursor=cD00ODY%3D\"",
"previous": "http://api.example.org/accounts/?cursor=cj0xJnA9NDg3",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"progress": "string",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"status": "Cancelled",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"team": 0,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
}
]
}

Create environments batch exports backfills

Create a new backfill for a BatchExport.

Required API key scopes

batch_export:write

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • start_at
    string

    The start of the data interval.

  • end_at
    string

    The end of the data interval.

  • status

    The status of this backfill.

    • Cancelled - Cancelled
    • Completed - Completed
    • ContinuedAsNew - Continued As New
    • Failed - Failed
    • FailedRetryable - Failed Retryable
    • Terminated - Terminated
    • TimedOut - Timedout
    • Running - Running
    • Starting - Starting
  • finished_at
    string

    The timestamp at which this BatchExportBackfill finished, successfully or not.

  • team
    integer

    The team this belongs to.

  • batch_export
    string

    The BatchExport this backfill belongs to.


Response


Example request

POST /api/environments/:project_id/batch_exports/:batch_export_id/backfills
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/batch_exports/:batch_export_id/backfills/\
-d status=undefined,\
-d team="integer",\
-d batch_export="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"progress": "string",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"status": "Cancelled",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"team": 0,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
}

Create environments batch exports backfills

Create a new backfill for a BatchExport.

Required API key scopes

batch_export:write

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • start_at
    string

    The start of the data interval.

  • end_at
    string

    The end of the data interval.

  • status

    The status of this backfill.

    • Cancelled - Cancelled
    • Completed - Completed
    • ContinuedAsNew - Continued As New
    • Failed - Failed
    • FailedRetryable - Failed Retryable
    • Terminated - Terminated
    • TimedOut - Timedout
    • Running - Running
    • Starting - Starting
  • finished_at
    string

    The timestamp at which this BatchExportBackfill finished, successfully or not.

  • team
    integer

    The team this belongs to.

  • batch_export
    string

    The BatchExport this backfill belongs to.


Response


Example request

POST /api/environments/:project_id/batch_exports/:batch_export_id/backfills
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/batch_exports/:batch_export_id/backfills/\
-d status=undefined,\
-d team="integer",\
-d batch_export="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"progress": "string",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"status": "Cancelled",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"team": 0,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
}

Retrieve environments batch exports backfills

ViewSet for BatchExportBackfill models.

Allows creating and reading backfills, but not updating or deleting them.

Required API key scopes

batch_export:read

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • id
    string

    A UUID string identifying this batch export backfill.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Response


Example request

GET /api/environments/:project_id/batch_exports/:batch_export_id/backfills/: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/batch_exports/:batch_export_id/backfills/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"progress": "string",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"status": "Cancelled",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"team": 0,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
}

Retrieve environments batch exports backfills

ViewSet for BatchExportBackfill models.

Allows creating and reading backfills, but not updating or deleting them.

Required API key scopes

batch_export:read

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • id
    string

    A UUID string identifying this batch export backfill.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Response


Example request

GET /api/environments/:project_id/batch_exports/:batch_export_id/backfills/: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/batch_exports/:batch_export_id/backfills/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"progress": "string",
"start_at": "2019-08-24T14:15:22Z",
"end_at": "2019-08-24T14:15:22Z",
"status": "Cancelled",
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"last_updated_at": "2019-08-24T14:15:22Z",
"team": 0,
"batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
}

Create environments batch exports backfills cancel

Cancel a batch export backfill.

Required API key scopes

batch_export:write

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • id
    string

    A UUID string identifying this batch export backfill.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • start_at
    string

    The start of the data interval.

  • end_at
    string

    The end of the data interval.

  • status

    The status of this backfill.

    • Cancelled - Cancelled
    • Completed - Completed
    • ContinuedAsNew - Continued As New
    • Failed - Failed
    • FailedRetryable - Failed Retryable
    • Terminated - Terminated
    • TimedOut - Timedout
    • Running - Running
    • Starting - Starting
  • finished_at
    string

    The timestamp at which this BatchExportBackfill finished, successfully or not.

  • team
    integer

    The team this belongs to.

  • batch_export
    string

    The BatchExport this backfill belongs to.


Example request

POST /api/environments/:project_id/batch_exports/:batch_export_id/backfills/: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/batch_exports/:batch_export_id/backfills/:id/cancel/\
-d status=undefined,\
-d team="integer",\
-d batch_export="string"

Example response

Status 200 No response body

Create environments batch exports backfills cancel

Cancel a batch export backfill.

Required API key scopes

batch_export:write

Path parameters

  • batch_export_id
    string

    The BatchExport this backfill belongs to.

  • id
    string

    A UUID string identifying this batch export backfill.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • start_at
    string

    The start of the data interval.

  • end_at
    string

    The end of the data interval.

  • status

    The status of this backfill.

    • Cancelled - Cancelled
    • Completed - Completed
    • ContinuedAsNew - Continued As New
    • Failed - Failed
    • FailedRetryable - Failed Retryable
    • Terminated - Terminated
    • TimedOut - Timedout
    • Running - Running
    • Starting - Starting
  • finished_at
    string

    The timestamp at which this BatchExportBackfill finished, successfully or not.

  • team
    integer

    The team this belongs to.

  • batch_export
    string

    The BatchExport this backfill belongs to.


Example request

POST /api/environments/:project_id/batch_exports/:batch_export_id/backfills/: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/batch_exports/:batch_export_id/backfills/:id/cancel/\
-d status=undefined,\
-d team="integer",\
-d batch_export="string"

Example response

Status 200 No response body
Next page →

Community questions

Questions about this page? or post a community question.