Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xcoder-es/media-cleaner-pro/llms.txt

Use this file to discover all available pages before exploring further.

The /api/control endpoint lets you change the execution state of a running job without restarting the server. Sending "pause" suspends the pipeline after the current image finishes processing; "resume" continues from where it left off; "cancel" fires a cancellation token that triggers a clean shutdown of the background task. All three actions return the updated is_running and is_paused flags so you can confirm the state transition in a single round trip.
POST /api/control
Content-Type: application/json

Request body

action
string
required
The control action to execute. Must be one of the following values:
ValueEffect
"pause"Sets is_paused to true. The pipeline completes the image it is currently processing and then waits. No data is lost; the job can be resumed at any time.
"resume"Sets is_paused to false. The pipeline immediately continues from the point at which it was paused.
"cancel"Triggers the internal CancellationToken. The background task performs a clean shutdown and sets is_running to false. The job cannot be resumed after cancellation.
Cancellation is irreversible. Once a job is cancelled, its in-memory state is cleared. You must call POST /api/start to begin a new job. Any files already written to dest_dir before the cancellation point are preserved on disk.

Response fields

success
boolean
required
true if the action was recognised and applied. An unrecognised action string is silently ignored and also returns true — validate the action echo field if you need to confirm the action was applied.
action
string
required
Echoes the action string from the request, allowing you to correlate responses when multiple control requests are issued in quick succession.
is_running
boolean
required
Reflects the updated running state after the action was applied. Will be false after a successful "cancel".
is_paused
boolean
required
Reflects the updated paused state after the action was applied. Will be true after "pause" and false after "resume" or "cancel".

Examples

Pause the running job
curl -X POST http://127.0.0.1:8080/api/control \
  -H 'Content-Type: application/json' \
  -d '{"action": "pause"}'
{
  "success": true,
  "action": "pause",
  "is_running": true,
  "is_paused": true
}
Resume a paused job
curl -X POST http://127.0.0.1:8080/api/control \
  -H 'Content-Type: application/json' \
  -d '{"action": "resume"}'
{
  "success": true,
  "action": "resume",
  "is_running": true,
  "is_paused": false
}
Cancel the job entirely
curl -X POST http://127.0.0.1:8080/api/control \
  -H 'Content-Type: application/json' \
  -d '{"action": "cancel"}'
{
  "success": true,
  "action": "cancel",
  "is_running": false,
  "is_paused": false
}

Build docs developers (and LLMs) love