Skip to main content
DELETE
/
api
/
availabilities
/
{id}
Delete Availability
curl --request DELETE \
  --url https://harbor-parking.vercel.app/api/availabilities/{id}
{
  "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

id
string
required
Unique identifier of the availability to delete

Response

message
string
required
Confirmation message
deleted_availability_id
string
required
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"

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."
}