> ## Documentation Index
> Fetch the complete documentation index at: https://lapscher.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Parking Spots

> Get parking spots with filtering options

## Overview

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

## Authentication

<Snippet file="auth-required.mdx" />

## Query Parameters

<ParamField query="owner_id" type="string" optional>
  Filter spots by owner ID
</ParamField>

<ParamField query="building_section" type="string" optional>
  Filter spots by building section
</ParamField>

<ParamField query="is_verified" type="boolean" optional>
  Filter by verification status
</ParamField>

<ParamField query="limit" type="number" optional default="50">
  Maximum number of spots to return
</ParamField>

<ParamField query="offset" type="number" optional default="0">
  Number of spots to skip for pagination
</ParamField>

## Response

<ResponseField name="spots" type="array" required>
  Array of parking spot objects

  <Expandable title="Spot Object">
    <ResponseField name="id" type="string" required>
      Unique spot identifier (UUID)
    </ResponseField>

    <ResponseField name="spot_number" type="string" required>
      Spot number or identifier
    </ResponseField>

    <ResponseField name="owner_id" type="string" required>
      ID of the spot owner
    </ResponseField>

    <ResponseField name="building_section" type="string" required>
      Building section or location
    </ResponseField>

    <ResponseField name="is_verified" type="boolean" required>
      Whether the spot has been verified by admin
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      Spot creation timestamp (ISO 8601)
    </ResponseField>

    <ResponseField name="updated_at" type="string" required>
      Spot last update timestamp (ISO 8601)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="number" required>
  Total number of spots matching the filters
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  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"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://harbor-parking.vercel.app/api/parking-spots?limit=10&is_verified=true', {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${yourJwtToken}`,
      'Content-Type': 'application/json'
    }
  });

  const spotsData = await response.json();
  ```
</CodeGroup>

## Example Response

<ResponseExample>
  ```json Success Response theme={null}
  {
    "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
  }
  ```
</ResponseExample>
