Delete a pending unscheduled task

Deletes a pending unscheduled task (trigger_description = 'NO_SCHEDULE_TASK') by its id_task_todo, reusing the existing cascade-delete logic.


Required add-on

The company must have the API Advanced add-on enabled. Without it, the endpoint returns 403.

DELETE https://app.fracttal.com/api/tasks_nonscheduled

Authentication

This endpoint does not carry an auth object in the body. Authentication is only Authorization: Bearer <token>; the gateway resolves id_company internally.

Input parameters — Required

Sent in the request body.

ParameterTypeRequiredDescription
id_task_todointegerYesPK of tasks.tasks_todo (the task occurrence, not the master task's id_task).
user_codestringYesEmployee code with an active account and remove permission on Pending Tasks (module 5, submodule 3).

Input parameters — Optional

None.


Output parameters

ParameterTypeDescription
successbooleantrue if the deletion was successful.
messagestring"200" on success; error code/message otherwise.
totalintegerNumber of records deleted (1 on success).
dataobject{ id_task_todo, id_task, description } of the deleted task (or { ERROR: "..." } on failure).

Errors

CodeCause
400id_task_todo is required — not sent or not a valid integer.
400id_task_todo was not found — does not exist for that company. Also occurs when retrying on an already-deleted id (idempotent behavior).
400Only unscheduled tasks can be deletedtrigger_description is different from NO_SCHEDULE_TASK.
400TASK_NO_DELETE_BY_WO_PENDING — the task has an active work order with id_status_work_order < 3.
400user_code does not have permission to delete pending tasks.
401Invalid or missing token (INVALID_TOKEN).
403The company does not have the API Advanced add-on enabled.
500Unhandled internal server error.

Idempotency

Retrying the DELETE on an already-deleted id_task_todo returns 400 with "id_task_todo was not found" — the same error as a nonexistent ID. This is expected behavior, not a failure.


Example

Request body

{
  "id_task_todo": 48408311,
  "user_code": "RH-001"
}

Response 200

{
  "success": true,
  "message": "200",
  "data": {
    "id_task_todo": 48408311,
    "id_task": 20456,
    "description": "ALEJANDRO STABILITY TEST"
  },
  "total": "1"
}

Response — error, scheduled task (400)

{
  "success": false,
  "message": "400",
  "data": { "ERROR": "Only unscheduled tasks can be deleted" },
  "total": 0
}

Response — retry on already-deleted id (400, idempotency)

{
  "success": false,
  "message": "400",
  "data": { "ERROR": "id_task_todo was not found" },
  "total": 0
}
Response
200
Language
LoadingLoading…