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

# Create Parking Spot

> Register a new parking spot

## Overview

This endpoint allows users to register a new parking spot in the system.

## Authentication

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

## Request Body

<ParamField body="spot_number" type="string" required>
  Unique spot number or identifier
</ParamField>

<ParamField body="building_section" type="string" required>
  Building section or location description
</ParamField>

## Response

<ResponseField name="spot" type="object" required>
  Created 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 (authenticated user)
    </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 (always false on creation)
    </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 POST "https://harbor-parking.vercel.app/api/parking-spots" \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "spot_number": "A-15",
      "building_section": "Level 2 Parking Garage"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://harbor-parking.vercel.app/api/parking-spots', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${yourJwtToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      spot_number: "A-15",
      building_section: "Level 2 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-15",
      "owner_id": "456e7890-e89b-12d3-a456-426614174001",
      "building_section": "Level 2 Parking Garage",
      "is_verified": false,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  }
  ```
</ResponseExample>
