---
title: "POST /DeleteObjectsOnCancel"
method: POST
path: "/DeleteObjectsOnCancel"
---

# POST /DeleteObjectsOnCancel

`POST /DeleteObjectsOnCancel`

For a specific governed table, provides a list of Amazon S3 objects that will be written during the current transaction and that can be automatically deleted if the transaction is canceled. Without this call, no Amazon S3 objects are automatically deleted when a transaction cancels.

The Glue ETL library function `write_dynamic_frame.from_catalog()` includes an option to automatically call `DeleteObjectsOnCancel` before writes. For more information, see [Rolling Back Amazon S3 Writes](https://docs.aws.amazon.com/lake-formation/latest/dg/transactions-data-operations.html#rolling-back-writes).

## Request body

- object
  - `CatalogId` string — The Glue data catalog that contains the governed table. Defaults to the current account ID.
  - `DatabaseName` string, required — The database that contains the governed table.
  - `TableName` string, required — The name of the governed table.
  - `TransactionId` string, required — ID of the transaction that the writes occur in.
  - `Objects` VirtualObject[], required — A list of VirtualObject structures, which indicates the Amazon S3 objects to be deleted if the transaction cancels.
    - `Uri` string, required — The path to the Amazon S3 object. Must start with s3://
    - `ETag` string — The ETag of the Amazon S3 object.

## Response `200`

Success

- DeleteObjectsOnCancelResponse

## Other responses

- `480` — InternalServiceException
- `481` — InvalidInputException
- `482` — OperationTimeoutException
- `483` — EntityNotFoundException
- `484` — TransactionCommittedException
- `485` — TransactionCanceledException
- `486` — ResourceNotReadyException
- `487` — ConcurrentModificationException

---

[API](https://skmtc.net/aws/apis/lakeformation.md) · [All operations](https://skmtc.net/aws/apis/lakeformation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/lakeformation/versions/a7cd69eb107d/schema)
