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

# Update Parking Spot

> Update parking spot details

## Overview

This endpoint allows spot owners to update their parking spot details.

## Authentication

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

## Path Parameters

<ParamField path="id" type="string" required>
  Unique identifier of the parking spot to update
</ParamField>

## Request Body

<ParamField body="spot_number" type="string" optional>
  Updated spot number or identifier
</ParamField>

<ParamField body="building_section" type="string" optional>
  Updated building section or location description
</ParamField>

## Response

<ResponseField name="spot" type="object" required>
  Updated parking spot object

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

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://harbor-parking.vercel.app/api/parking-spots/123e4567-e89b-12d3-a456-426614174000" \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "spot_number": "A-16",
      "building_section": "Level 3 Parking Garage"
    }'
  ```

  ```javascript JavaScript theme={null}
  const spotId = "123e4567-e89b-12d3-a456-426614174000";
  const response = await fetch(`https://harbor-parking.vercel.app/api/parking-spots/${spotId}`, {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${yourJwtToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      spot_number: "A-16",
      building_section: "Level 3 Parking Garage"
    })
  });

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

## Example Response

<ResponseExample>
  ```json Success Response theme={null}
  {
    "spot": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "spot_number": "A-16",
      "owner_id": "456e7890-e89b-12d3-a456-426614174001",
      "building_section": "Level 3 Parking Garage",
      "is_verified": true,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-16T11:45:00Z"
    }
  }
  ```
</ResponseExample>
