Skip to content
handupbeta
Download

cleanup_start

View as Markdown
POST
/v1/storage/cleanup

Start a background cleanup of resolved requests (never pending ones or files they reference). It runs in small batches, so requests and decisions keep working. Local, and decide scope on paired devices.

Media typeapplication/json

Which resolved requests a cleanup covers (POST /v1/storage/cleanup body, GET /v1/storage/estimate query). Both limits apply together.

object
target
required

What a cleanup removes.

string
Allowed values: history files
older_than_days

Only requests resolved at least this many days ago; 0 = every resolved request.

integer format: int32
keep_newest

Keep the newest this many resolved requests (requests resolved in the same millisecond as the last one kept stay too); 0 = no count limit.

integer format: int32

Started; poll GET /v1/storage/cleanup/{id}

Media typeapplication/json

A background cleanup. The daemon runs one at a time in small batches, so requests and decisions keep working while it runs.

object
id
required
string
target
required

What a cleanup removes.

string
Allowed values: history files
older_than_days
required

0 = every resolved request.

integer format: int32
keep_newest

Newest resolved requests kept; 0 = no count limit.

integer format: int32
state
required
string
Allowed values: running done cancelled failed
total
required

Items to process, counted at the start: requests (history) or files (files).

integer format: int64
done
required

Items processed so far.

integer format: int64
requests_deleted
required
integer format: int64
files_deleted
required
integer format: int64
bytes_freed
required

Bytes freed: removed files plus database pages released by deleted rows.

integer format: int64
compacting
required

Returning freed database pages to the filesystem (incremental vacuum).

boolean
started_at
required

Unix milliseconds.

integer format: int64
finished_at
integer | null format: int64
error

Set when state is failed.

string | null

Remote device without decide scope

A cleanup is already running; job is that cleanup