Skip to main content
GET
/
api
/
parking-spots
List Parking Spots
curl --request GET \
  --url https://harbor-parking.vercel.app/api/parking-spots
{
  "spots": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "spot_number": "A-15",
      "owner_id": "456e7890-e89b-12d3-a456-426614174001",
      "building_section": "Level 2 Parking Garage",
      "is_verified": true,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 1
}

Overview

This endpoint retrieves a list of parking spots with optional filtering capabilities.

Authentication

Query Parameters

owner_id
string
Filter spots by owner ID
building_section
string
Filter spots by building section
is_verified
boolean
Filter by verification status
limit
number
default:"50"
Maximum number of spots to return
offset
number
default:"0"
Number of spots to skip for pagination

Response

spots
array
required
Array of parking spot objects
total
number
required
Total number of spots matching the filters

Example Request

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

Example Response

{
  "spots": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "spot_number": "A-15",
      "owner_id": "456e7890-e89b-12d3-a456-426614174001",
      "building_section": "Level 2 Parking Garage",
      "is_verified": true,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 1
}