Skip to content

Cancel an operation

cancelOperation

POST /api/v1/operations/{id}/cancel

Scope, any one of: files.write files.move files.delete files.overwriteRate cost: 2

Ask an operation to stop

One held for an approver is withdrawn at once, nothing changed (its approval then says withdrawn). A queued one is cancelled at once; a running one stops at its next item, and the copy it had made so far is removed (a move’s original is untouched). Answers 204 either way: poll the operation to see it end (409 operation-cancelled). An operation that has already finished cannot be cancelled (409 operation-finished); a copy whose last item is done as the cancel arrives succeeds, and so does a move already removing its originals (phase deleting): stopping it then would leave the item split between two places.

Any one of these scopes is enough; which applies depends on the kind of operation being read.

Terminal window
curl -X POST "$FOLDR/api/v1/operations/$ID/cancel" \
-H "Authorization: Bearer $TOKEN"

$FOLDR is your site’s address (for example https://files.example.com) and $TOKEN is an access token. See Getting access.

NameInTypeRequiredDescription
idpathstringYesThe operation’s id.
StatusMeaningBody
204Cancelled, or asked to stop.none

Every error is an application/problem+json document (ProblemDetails); branch on its type or code. See Errors.

StatusProblem typesWhen
400invalid-requestInvalid request (invalid-request).
401invalid-tokenInvalid token (invalid-token).
403insufficient-scopeInsufficient scope (insufficient-scope).
404not-foundNot found (not-found).
409operation-finishedOperation finished (operation-finished).
429rate-limitedToo many requests (rate-limited).
500internal-errorInternal error (internal-error).