> ## 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 User Profile

> Update the authenticated user's profile information

## Overview

This endpoint allows authenticated users to update their profile information such as full name, apartment number, and phone number.

## Authentication

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

## Request Body

<ParamField body="full_name" type="string" optional>
  User's full name
</ParamField>

<ParamField body="apartment_number" type="string">
  User's apartment number in the building
</ParamField>

<ParamField body="phone_number" type="string" optional>
  User's phone number
</ParamField>

## Response

<ResponseField name="profile" type="object" required>
  Updated user profile information

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

    <ResponseField name="email" type="string" required>
      User's email address
    </ResponseField>

    <ResponseField name="full_name" type="string">
      User's full name (optional)
    </ResponseField>

    <ResponseField name="apartment_number" type="string" required>
      User's apartment number in the building
    </ResponseField>

    <ResponseField name="phone_number" type="string">
      User's phone number (optional)
    </ResponseField>

    <ResponseField name="is_approved" type="boolean" required>
      Whether the user has been approved by a building administrator
    </ResponseField>

    <ResponseField name="is_admin" type="boolean" required>
      Whether the user has administrator privileges
    </ResponseField>

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

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://harbor-parking.vercel.app/api/profile" \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "full_name": "John Doe",
      "apartment_number": "12A",
      "phone_number": "+1234567890"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://harbor-parking.vercel.app/api/profile', {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${yourJwtToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      full_name: "John Doe",
      apartment_number: "12A",
      phone_number: "+1234567890"
    })
  });

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

## Example Response

<ResponseExample>
  ```json Success Response theme={null}
  {
    "profile": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "email": "john.doe@example.com",
      "full_name": "John Doe",
      "apartment_number": "12A",
      "phone_number": "+1234567890",
      "is_approved": true,
      "is_admin": false,
      "updated_at": "2024-01-15T10:30:00Z"
    }
  }
  ```
</ResponseExample>
