Delete a task
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
Deletes a task. The creator or an admin can delete one. Needs write:tasks.
Request example
curl --request DELETE \ --url 'https://public-api.sessionboard.com/v1/tasks/{taskId}' \ --header 'x-access-token: <api-token>'const response = await fetch('https://public-api.sessionboard.com/v1/tasks/{taskId}', { method: 'DELETE', headers: { "x-access-token": "<api-token>" },});
const data = await response.json();console.log(data);import requests
response = requests.request( "DELETE", "https://public-api.sessionboard.com/v1/tasks/{taskId}", headers={ "x-access-token": "<api-token>" },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/tasks/{taskId}", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => [ "x-access-token: <api-token>", ],]);
$response = curl_exec($curl);curl_close($curl);
echo $response;package main
import ( "fmt" "io" "net/http")
func main() { req, _ := http.NewRequest("DELETE", "https://public-api.sessionboard.com/v1/tasks/{taskId}", nil) req.Header.Add("x-access-token", "<api-token>")
res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://public-api.sessionboard.com/v1/tasks/{taskId}")) .header("x-access-token", "<api-token>") .method("DELETE", HttpRequest.BodyPublishers.noBody()) .build();
HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Try it
Response headers
Authorizations
x-access-tokenstringheaderOrganization API token. Generate from Organization Settings → API Tokens.
AuthorizationBearer <token>headerorOAuth 2.1 access token. Obtained via the OAuth PKCE flow at
/oauth/token.
Send one of these. See Authentication.
Path parameters
taskIdstring<uuid>pathrequiredThe task's
id.
Responses
200application/json
Deleted
dataobjectShow child attributes
idstringdeletedboolean
401
Unauthorized
403application/json
TASKS_PLATFORM_ONLY: the organization uses a self-serve Sessionboard product; Tasks are part of Sessionboard Platform.SCOPE_REQUIRED: the key lacksread:tasks(reads) orwrite:tasks(writes). Legacy keys with no scopes can read but not write.ORG_WIDE_TOKEN_REQUIRED: the key is restricted to particular events; Tasks need a key without an event restriction.FORBIDDEN: the key's user can read this task but not change it (only the assignee, the creator, a follower or an admin can; only the creator or an admin can delete), or cannot use Tasks (reviewers and portal users).
errorstringVALIDATION_ERROR,USER_REQUIRED,FORBIDDEN,NOT_FOUND,TASKS_PLATFORM_ONLY,SCOPE_REQUIRED,ORG_WIDE_TOKEN_REQUIREDorINTERNAL_ERROR.messagestring
404
No such task, or the key's user cannot read it (NOT_FOUND).
Response examples
{ "data": { "id": "7d1c2b8e-4f0a-4c3e-9b1d-2a6f8e0c41a1", "deleted": true }}{ "error": "TASKS_PLATFORM_ONLY", "message": "Tasks are part of Sessionboard Platform."}{ "error": "SCOPE_REQUIRED", "message": "Token missing required scope: write:tasks"}