Delete Availability
curl --request DELETE \
--url https://harbor-parking.vercel.app/api/availabilities/{id}import requests
url = "https://harbor-parking.vercel.app/api/availabilities/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://harbor-parking.vercel.app/api/availabilities/{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://harbor-parking.vercel.app/api/availabilities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://harbor-parking.vercel.app/api/availabilities/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://harbor-parking.vercel.app/api/availabilities/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/availabilities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "Availability deleted successfully",
"deleted_availability_id": "789e0123-e89b-12d3-a456-426614174002"
}
Availabilities
Delete Availability
Remove an availability window
DELETE
/
api
/
availabilities
/
{id}
Delete Availability
curl --request DELETE \
--url https://harbor-parking.vercel.app/api/availabilities/{id}import requests
url = "https://harbor-parking.vercel.app/api/availabilities/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://harbor-parking.vercel.app/api/availabilities/{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://harbor-parking.vercel.app/api/availabilities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://harbor-parking.vercel.app/api/availabilities/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://harbor-parking.vercel.app/api/availabilities/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harbor-parking.vercel.app/api/availabilities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "Availability deleted successfully",
"deleted_availability_id": "789e0123-e89b-12d3-a456-426614174002"
}
Overview
This endpoint allows parking spot owners to delete their availability windows.You cannot delete an availability that has already been claimed. Cancel the associated claim first.
Authentication
Path Parameters
Unique identifier of the availability to delete
Response
Confirmation message
ID of the deleted availability
Example Request
curl -X DELETE "https://harbor-parking.vercel.app/api/availabilities/789e0123-e89b-12d3-a456-426614174002" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
const availabilityId = "789e0123-e89b-12d3-a456-426614174002";
const response = await fetch(`https://harbor-parking.vercel.app/api/availabilities/${availabilityId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${yourJwtToken}`,
'Content-Type': 'application/json'
}
});
const result = await response.json();
Example Response
{
"message": "Availability deleted successfully",
"deleted_availability_id": "789e0123-e89b-12d3-a456-426614174002"
}
Error Responses
{
"error": "Cannot delete a claimed availability. Cancel the claim first."
}
{
"error": "You can only delete availabilities for your own spots"
}
{
"error": "Availability not found"
}
⌘I