---
title: "Task Completed"
method: POST
path: "task.completed"
tags: ["Tasks Events"]
---

# Task Completed

`POST task.completed` (webhook)

This event is triggered when a task is completed in the system.

## Payload

- TaskCompletedEvent — Event emitted when a task is completed
  - `id` string, required — The id of the event
  - `timestamp` string, required — The timestamp of the moment when the event was created in ISO 8601 format
  - `type` 'task.completed', required — The type of the event
  - `data` union, required — The data of the event
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'apply-effect', required
      - `result` object, required
        - `generated_files` ImageFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'image/png' | 'image/jpeg' | 'image/webp', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the image in bytes
            - `width` number, required — The width of the image in pixels
            - `height` number, required — The height of the image in pixels
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'detect-documents', required
      - `result` object, required
        - `documents` object[], required — The list of documents detected in the image
          - `file_id` string, required — The ID of the file containing the document
          - `vertices` object[], required — The coordinates of the vertex inside the image
            - `x` number, required — The x coordinate of the vertex inside the image in pixels
            - `y` number, required — The y coordinate of the vertex inside the image in pixels
          - `bounding_box` BoundingBox, required — The rectangle that contains the document in the image
            - `top` number, required — The position of the top-left corner of the bounding box inside the image in pixels
            - `left` number, required — The position of the top-left corner of the bounding box inside the image in pixels
            - `width` number, required — The width of the bounding box inside the image in pixels
            - `height` number, required — The height of the bounding box inside the image in pixels
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'warp', required
      - `result` object, required
        - `generated_files` ImageFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'image/png' | 'image/jpeg' | 'image/webp', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the image in bytes
            - `width` number, required — The width of the image in pixels
            - `height` number, required — The height of the image in pixels
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'extract-text', required
      - `result` object, required
        - `format` 'plain' | 'markdown' | 'html' | 'json', required
        - `content` string, required
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'convert', required
      - `result` object, required
        - `generated_files` ImageFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'image/png' | 'image/jpeg' | 'image/webp', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the image in bytes
            - `width` number, required — The width of the image in pixels
            - `height` number, required — The height of the image in pixels
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'render', required
      - `result` object, required
        - `generated_files` ImageFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'image/png' | 'image/jpeg' | 'image/webp', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the image in bytes
            - `width` number, required — The width of the image in pixels
            - `height` number, required — The height of the image in pixels
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'split', required
      - `result` object, required
        - `generated_files` DocumentFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'application/pdf', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the document in bytes
            - `page_count` number, required — The number of pages in the document
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'merge', required
      - `result` object, required
        - `generated_files` DocumentFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'application/pdf', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the document in bytes
            - `page_count` number, required — The number of pages in the document
    - object — Task Event Data
      - `id` string, required — The ID of the task
      - `operation` 'extract-pages', required
      - `result` object, required
        - `generated_files` DocumentFromTaskResponse[], required
          - `id` string, required — The id of the file
          - `name` string, required — The name of the file
          - `task_id` string, required — The id of the task that generated this file
          - `created_at` string, required — The creation date of the file in ISO format
          - `type` 'application/pdf', required — The MIME type of the file
          - `properties` object, required
            - `size` number, required — The size of the document in bytes
            - `page_count` number, required — The number of pages in the document

## Acknowledgement `2XX`

Webhook received successfully

---

[API](https://skmtc.dev/scan-documents/apis/scan-documents-api.md) · [All operations](https://skmtc.dev/scan-documents/apis/scan-documents-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scan-documents/scan-documents-api/revisions/42f9aa9c3b27/schema)
