# The cleanup object

A cleanup object is returned as part of the response body of each successful list, retrieve, create or update API call to the `/api/cleanups` endpoint.

## Fields

| Field                            | Type       | Description                                                                                                                                                                                         |
| -------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**                         | `string`   | `cleanups`                                                                                                                                                                                          |
| **id**                           | `string`   | The cleanup unique identifier                                                                                                                                                                       |
| links.**self**                   | `string`   | The cleanup endpoint URL                                                                                                                                                                            |
| attributes.**resource\_type**    | `string`   | The type of resource being cleaned.                                                                                                                                                                 |
| attributes.**status**            | `string`   | The cleanup job status. One of 'pending' (default), 'in\_progress', 'interrupted', or 'completed'.                                                                                                  |
| attributes.**started\_at**       | `datetime` | Time at which the cleanup was started.                                                                                                                                                              |
| attributes.**completed\_at**     | `datetime` | Time at which the cleanup was completed.                                                                                                                                                            |
| attributes.**interrupted\_at**   | `datetime` | Time at which the cleanup was interrupted.                                                                                                                                                          |
| attributes.**filters**           | `object`   | The filters used to select the records to be cleaned.                                                                                                                                               |
| attributes.**records\_count**    | `integer`  | Indicates the number of records to be cleaned.                                                                                                                                                      |
| attributes.**errors\_count**     | `integer`  | Indicates the number of cleanup errors, if any.                                                                                                                                                     |
| attributes.**processed\_count**  | `integer`  | Indicates the number of records that have been cleaned.                                                                                                                                             |
| attributes.**errors\_log**       | `object`   | Contains the cleanup errors, if any.                                                                                                                                                                |
| attributes.**\_interrupt**       | `boolean`  | Send this attribute if you want to mark status as 'interrupted'.                                                                                                                                    |
| attributes.**created\_at**       | `datetime` | Time at which the resource was created.                                                                                                                                                             |
| attributes.**updated\_at**       | `datetime` | Time at which the resource was last updated.                                                                                                                                                        |
| attributes.**reference**         | `string`   | A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. |
| attributes.**reference\_origin** | `string`   | Any identifier of the third party system that defines the reference code.                                                                                                                           |
| attributes.**metadata**          | `object`   | Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.                                        |
| relationships.**events**         | `array`    | The associated events.                                                                                                                                                                              |
| relationships.**versions**       | `array`    | The associated changes.                                                                                                                                                                             |
| relationships.**event\_stores**  | `array`    | The associated event stores.                                                                                                                                                                        |
| meta.**mode**                    | `string`   | The resource environment (can be one of `test` or `live`)                                                                                                                                           |
