Cleanup

[POST] .../v1/storage/cleanup

Starts asynchronous storage file cleanup by date range and/or entity list Use this workflow method to ask the server to start background cleanup for storage files selected by optional date range and entity list. The method validates non-negative start_date and end_date, requires start_date to be less than or equal to end_date when both are provided, validates every entity enum value, checks that the current request user is the account owner user id 1, starts the cleanup task and returns true when accepted. The request body is required, entities may be omitted or limited to supported storage entity names and the operation changes stored files asynchronously after the response. Missing body, invalid dates, invalid entity values, non-owner access, cleanup startup failures and persistent errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
end_date Int64 Optional Optional. End date as Unix time, inclusive.
entities Array of String Optional Optional. Entities to clean up: chat, report, item, payment_type, contract, retail_customer_document, other. Allowed values: chat, report, item, payment_type, contract, print_form, retail_customer_document, other.
start_date Int64 Optional Optional. Start date as Unix time, inclusive.

Request Example

{
  "start_date": 1704067200,
  "end_date": 1711929600,
  "entities": [
    "chat",
    "report"
  ]
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Boolean Result object.

Response Example

{
  "ok": true,
  "result": true
}