Skip to main content
POST
/
api
/
adm
/
backgroundProcesses
/
cancel
Cancel Background Process
curl --request POST \
  --url https://localhost:44371/api/adm/backgroundProcesses/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '"<string>"'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Attempts to gracefully cancel a background process that is currently running or pending. The process will be signaled to stop and transition to Cancelled status. Processes that have already completed or failed cannot be cancelled.

Input

  • Body: id (guid, required) — Unique identifier of the background process to cancel.

Output

Returns a BaseResponse indicating whether the cancellation was successful.

Example Request

POST /api/admin/backgroundProcesses/cancel
Content-Type: application/json
Authorization: Bearer {token}

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Errors

  • 400 Bad Request — Process is already completed, failed, or cancelled.
  • 401 Unauthorized — Missing or invalid authentication token.
  • 403 Forbidden — User does not have permission to cancel this process.
  • 404 Not Found — No background process exists with the specified ID.

Notes

  • Only Running or Pending processes can be cancelled.
  • Cancellation may not be immediate; the process will stop at the next safe checkpoint.
  • Partial work completed before cancellation may remain in the system.
  • Cancelled processes cannot be restarted; create a new process instead.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

The unique identifier of the background process to cancel.

The body is of type string<guid>.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null