Delete a task
curl --request DELETE \
--url https://tasksocial-production.up.railway.app/api/v1/tasks/{id} \
--cookie tokenName=import requests
url = "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
headers = {"cookie": "tokenName="}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {cookie: 'tokenName='}};
fetch('https://tasksocial-production.up.railway.app/api/v1/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_COOKIE => "tokenName=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("cookie", "tokenName=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
.header("cookie", "tokenName=")
.asString();require 'uri'
require 'net/http'
url = URI("https://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["cookie"] = 'tokenName='
response = http.request(request)
puts response.read_body{
"message": "Task deleted successfully"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Tasks
Delete a task
Deletes a task owned by the authenticated user.
DELETE
/
api
/
v1
/
tasks
/
{id}
Delete a task
curl --request DELETE \
--url https://tasksocial-production.up.railway.app/api/v1/tasks/{id} \
--cookie tokenName=import requests
url = "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
headers = {"cookie": "tokenName="}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {cookie: 'tokenName='}};
fetch('https://tasksocial-production.up.railway.app/api/v1/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_COOKIE => "tokenName=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tasksocial-production.up.railway.app/api/v1/tasks/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("cookie", "tokenName=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
.header("cookie", "tokenName=")
.asString();require 'uri'
require 'net/http'
url = URI("https://tasksocial-production.up.railway.app/api/v1/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["cookie"] = 'tokenName='
response = http.request(request)
puts response.read_body{
"message": "Task deleted successfully"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
JWT authentication cookie. The server sets this cookie after a successful login. You do not need to generate or provide an API key manually. Use the login endpoint first, then the browser or HTTP client sends this cookie with protected requests.
Path Parameters
MongoDB ObjectId of the task.
Response
Task deleted successfully.