Skip to main content
GET
/
api
/
availabilities
List Availabilities
curl --request GET \
  --url https://harbor-parking.vercel.app/api/availabilities
{
  "availabilities": [
    {
      "id": "789e0123-e89b-12d3-a456-426614174002",
      "spot_id": "123e4567-e89b-12d3-a456-426614174000",
      "start_time": "2024-01-16T09:00:00Z",
      "end_time": "2024-01-16T17:00:00Z",
      "is_claimed": false,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 1
}

Overview

This endpoint retrieves a list of parking spot availability windows with optional filtering capabilities.

Authentication

Query Parameters

spot_id
string
Filter availabilities by specific parking spot ID
owner_id
string
Filter availabilities by spot owner ID
start_date
string
Filter availabilities starting from this date (ISO 8601)
end_date
string
Filter availabilities ending before this date (ISO 8601)
limit
number
default:"50"
Maximum number of availabilities to return
offset
number
default:"0"
Number of availabilities to skip for pagination

Response

availabilities
array
required
Array of availability objects
total
number
required
Total number of availabilities matching the filters

Example Request

curl -X GET "https://harbor-parking.vercel.app/api/availabilities?limit=10&is_claimed=false" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

Example Response

{
  "availabilities": [
    {
      "id": "789e0123-e89b-12d3-a456-426614174002",
      "spot_id": "123e4567-e89b-12d3-a456-426614174000",
      "start_time": "2024-01-16T09:00:00Z",
      "end_time": "2024-01-16T17:00:00Z",
      "is_claimed": false,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 1
}