Skip to content

DeleteTask API

Deletes an active workflow task by its task ID. All task attachments are also removed as part of the operation.

Endpoint

/srv.asmx/DeleteTask

Methods

  • GET /srv.asmx/DeleteTask?authenticationTicket=...&taskId=...
  • POST /srv.asmx/DeleteTask (form data)
  • SOAP Action: http://tempuri.org/DeleteTask

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser.
taskId integer Yes Unique numeric ID of the task to delete.

Response

Success Response

<response success="true" error="" errorCode="0" />

Error Response

<response success="false" error="Session expired or invalid ticket" errorCode="4010" />

Required Permissions

The calling user must have the Remove Task permission on the document the task is associated with. The user who originally assigned the task is also always permitted to delete it.

Behavior

The exact behavior depends on the relationship between the task and its workflow definition:

Scenario Result
Task belongs to the current workflow definition Task record and all its attachments are permanently deleted.
Ad-hoc task whose workflow definition has since changed Task status is set to Dropped (soft delete); workflow advancement is triggered if it was the last task in its step.
Regular workflow task whose workflow definition has since changed Returns an error -" such tasks cannot be deleted directly.

Example

GET Request

GET /srv.asmx/DeleteTask
    ?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
    &taskId=4812
HTTP/1.1
Host: yourserver

POST Request

POST /srv.asmx/DeleteTask HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded

authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c&taskId=4812

JavaScript

Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and errorCode is the number to report.

async function call(action, params) {
  const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
  const root = new DOMParser()
    .parseFromString(await response.text(), 'text/xml')
    .documentElement;

  if (root.getAttribute('success') !== 'true') {
    throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
  }
  return root;
}

Deletes a task.

await call('DeleteTask', { authenticationTicket: ticket, taskId: 7328 });

Notes

  • The taskId is the unique numeric identifier for the task, available from APIs such as GetTask or getTasks.
  • Deleting a task also removes all workflow attachments associated with it.
  • For ad-hoc tasks in a changed workflow, deletion sets the task to Dropped status rather than physically removing the record. The workflow may automatically advance if that was the last pending task in the step.
  • To obtain a list of tasks for a document or user, use getTasks.

Error Codes

The errorCode values this operation returns, checked against a running server:

errorCode When
4010 the ticket is expired or unknown
4000 no task by that id, or the caller may not delete it