Delete Objects

Prev Next

Delete Objects

The delete endpoint works by deleting all objects in a list view. This is done by specifying a list view ID and a delete view ID.

Delete API pattern

Call

The following DELETE endpoint should be used.

https://api.team-tracks.com/object/deleteall/{{delete_list_ID}}/{{delete_view_ID}}

Here, {{delete_list_ID}} is the ID of the list from which all objects should be deleted and {{delete_view_ID}} is the ID of a delete view which the API user has access to in the track.

The api should have a role that has access to a delete view in the track.

The call should include the below headers.

Authorization: "Bearer <token>"
tenant: <your_tenent_ID>
Ocp-Apim-Subscription-Key: <your_subscription_key>

The full cURL is below.

curl --location --request DELETE 'https://api.team-tracks.com/object/deleteall/{delete_list_ID}/{delete_view_ID}' \
--header 'tenant: {}tenant' \
--header 'Ocp-Apim-Subscription-Key: {Ocp-Apim-Subscription-Key}' \
--header 'Authorization: Bearer {token}'

Response

The api will respond with a jobId as below and the import job will be processed by the application in its background processor.

{
    "jobId": "24786e69-262a-4242-9d65-c15bf89c930e"
}

Querying Job Status

To query the status of a delete job, use the following GET endpoint.

https://api.team-tracks.com/job/deleteAll/{{jobId}}

Here, {{jobId}} is the the jobId provided by the deleteAll endpoint above when the job was scheduled.

The call should include the below headers.

Authorization: "Bearer <token>"
tenant: <your_tenent_ID>
Ocp-Apim-Subscription-Key: <your_subscription_key>

The response is as below. This is the response while the job is in progress.

{
  "finished": false,
  "dateFinished": 0
}

This is the response while the job is completed.

{
    "finished": true,
    "dateFinished": 1724442508936,
    "errors": []
}

dateFinished

Here, the dateFinished in Unix Epoch time, in milliseconds.