---
title: "background_task.finished"
method: POST
path: "background_task.finished"
tags: ["Webhook"]
---

# background_task.finished

`POST background_task.finished` (webhook)

Sent when a background task is finished.

## Payload

- BackgroundTaskFinishedEvent — Sent when a background task is finished.
  - `data` BackgroundTaskFinishedEvent2, required
    - `taskId` string, required — The QueueBackgroundTask's ID.
    - `task` 'endpoint.replay' | 'endpoint.recover' | 'application.stats' | 'message.broadcast' | 'sdk.generate' | 'event-type.aggregate' | 'application.purge_content' | 'endpoint.bulk-replay', required
    - `status` 'running' | 'finished' | 'failed', required
    - `data` union, required
      - object
        - `messages_sent` integer, required
        - `endp_id` string, nullable — The Endpoint's ID.
        - `cur_batch_start` string, date-time, nullable
        - `since` string, date-time, nullable
        - `until` string, date-time, nullable
      - object
        - `messages_sent` integer, required
        - `endp_id` string, nullable — The Endpoint's ID.
        - `cur_batch_start` string, date-time, nullable
        - `since` string, date-time, nullable
        - `until` string, date-time, nullable
      - object
        - `app_stats` ApplicationStatsOut[], required
          - `messageDestinations` integer, required
          - `appId` string, required — The Application's ID.
          - `appUid` string, nullable — The Application's UID.
      - object
        - `messages_created` ApplicationMessageIdPair[], required
          - `appId` string, required — The Application's ID.
          - `msgId` string, required — The Message's ID.
        - `messages_failed` ApplicationMessageFailure[], required
          - `appId` string, required — The Application's ID.
          - `reason` string, required
      - object
        - `event_types` AggregatedEventTypes[], required
          - `appId` string, required — The Application's ID.
          - `explicitlySubscribedEventTypes` string[], required
          - `hasCatchAllEndpoint` boolean, required
      - object
        - `messages_purged` integer, required
      - object
        - `messages_sent` integer, required
        - `endp_id` string, nullable — The Endpoint's ID.
        - `cur_batch_start` string, date-time, nullable
        - `since` string, date-time, nullable
        - `until` string, date-time, nullable
  - `type` 'background_task.finished', required

## Acknowledgement `2XX`

Return any 2XX status to indicate that the data was received successfully

---

[API](https://skmtc.net/svix/apis/svix-api.md) · [All operations](https://skmtc.net/svix/apis/svix-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/svix/svix-api/revisions/16dbcc056c48/schema)
