Skip to main content
GET
/
api
/
claims
List Claims
curl --request GET \
  --url https://harbor-parking.vercel.app/api/claims
{
  "claims": [
    {
      "id": "abc123de-e89b-12d3-a456-426614174003",
      "availability_id": "789e0123-e89b-12d3-a456-426614174002",
      "claimer_id": "456e7890-e89b-12d3-a456-426614174001",
      "start_time": "2024-01-16T09:00:00Z",
      "end_time": "2024-01-16T17:00:00Z",
      "status": "active",
      "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 claims with optional filtering capabilities.

Authentication

Query Parameters

claimer_id
string
Filter claims by claimer (user) ID
spot_id
string
Filter claims by specific parking spot ID
status
string
Filter claims by status (active, completed, cancelled)
start_date
string
Filter claims starting from this date (ISO 8601)
end_date
string
Filter claims ending before this date (ISO 8601)
limit
number
default:"50"
Maximum number of claims to return
offset
number
default:"0"
Number of claims to skip for pagination

Response

claims
array
required
Array of claim objects
total
number
required
Total number of claims matching the filters

Example Request

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

Example Response

{
  "claims": [
    {
      "id": "abc123de-e89b-12d3-a456-426614174003",
      "availability_id": "789e0123-e89b-12d3-a456-426614174002",
      "claimer_id": "456e7890-e89b-12d3-a456-426614174001",
      "start_time": "2024-01-16T09:00:00Z",
      "end_time": "2024-01-16T17:00:00Z",
      "status": "active",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 1
}