Batch

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

Delete batch exports destroy

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

  • 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

DELETE /api/projects/:project_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/projects/:project_id/batch_exports/:id/

Response

Status 204 No response body

Create batch exports backfill create

Trigger a backfill for a BatchExport.

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

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

Request

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

Response

Status 200 No response body

Retrieve batch exports logs retrieve

Path parameters

  • id
    string

    A UUID string identifying this batch export.

  • 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

GET /api/projects/:project_id/batch_exports/:id/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/batch_exports/:id/logs/

Response

Status 200 No response body

Create batch exports pause create

Pause a BatchExport.

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

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

Request

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

Response

Status 200 No response body

Create batch exports unpause create

Unpause a BatchExport.

Required API key scopes

batch_export:write

Path parameters

  • id
    string

    A UUID string identifying this batch export.

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

Request

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

Response

Status 200 No response body

Questions?

Was this page useful?