> ## 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.

# Get Dashboard

> Retrieve user dashboard with comprehensive stats, spots, and claims data

## Overview

This endpoint retrieves comprehensive dashboard data for the authenticated user, including statistics, parking spots, recent claims, and availability information.

## Authentication

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

## Response

<ResponseField name="stats" type="object" required>
  Dashboard statistics

  <Expandable title="Stats Object">
    <ResponseField name="total_spots" type="number" required>
      Total number of parking spots owned by the user
    </ResponseField>

    <ResponseField name="active_spots" type="number" required>
      Number of currently active/available spots
    </ResponseField>

    <ResponseField name="total_claims" type="number" required>
      Total number of claims made by the user
    </ResponseField>

    <ResponseField name="active_claims" type="number" required>
      Number of currently active claims
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="recent_spots" type="array" required>
  Array of user's most recent parking spots
</ResponseField>

<ResponseField name="recent_claims" type="array" required>
  Array of user's most recent claims
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://harbor-parking.vercel.app/api/dashboard" \
    -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/dashboard', {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${yourJwtToken}`,
      'Content-Type': 'application/json'
    }
  });

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

## Example Response

<ResponseExample>
  ```json Success Response theme={null}
  {
    "stats": {
      "total_spots": 2,
      "active_spots": 1,
      "total_claims": 5,
      "active_claims": 1
    },
    "recent_spots": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "spot_number": "A-15",
        "building_section": "Level 2 Parking Garage",
        "is_verified": true,
        "created_at": "2024-01-15T10:30:00Z"
      }
    ],
    "recent_claims": [
      {
        "id": "456e7890-e89b-12d3-a456-426614174001",
        "spot_id": "123e4567-e89b-12d3-a456-426614174000",
        "start_time": "2024-01-16T09:00:00Z",
        "end_time": "2024-01-16T17:00:00Z",
        "status": "active"
      }
    ]
  }
  ```
</ResponseExample>
