Delete a Task

Prev Next

This tutorial demonstrates how to delete a task via RESTful API.

The steps include:

  • Get the task_id from the list of tasks

  • Delete the specific task

The commands are provided in curl and can be run from the command prompt when the Synergy Server is running (or in a batch script)

Additional API documentation

To get a list of most of the API requests available, with the 12d Synergy server running, browse http://synergy.myserver.com/api-docs/ui/index.

(Replace synergy.myserver.com with the external server address and update the port numbers if necessary.)

1.1. Getting the Personal Access Token to access API

The tutorial for getting the PAT is here: Generate PAT in Web client.

1.2. Get the task ID from the list of tasks

To get the task type ID, you can follow the steps here: Get Task Types

Getting the Task ID can be found by following the instructions here: Search Task or Get Task for a Job.

1.3. Get the initial task states

This request can be found in the API Documentation under Tasks marked 'Delete a task'.

Once you have the value for task_id, it should be included as a parameter.

This request should also include a description in the URL.

Sample Request

curl --location 'http://localhost:8080/api/v1/tasks/{task-id-here}/{description-here}' \

--header 'Authorization: Bearer <your-token-here>' \

--header 'Content-Type: application/json' \

Below is a sample response when deleting a task.

Sample Response

true