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

# Delete Claim

> Cancel a parking spot claim

## Overview

This endpoint allows users to delete (cancel) their parking spot claims.

<Note>
  Deleting a claim will free up the associated availability for other users to claim.
</Note>

## Authentication

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

## Path Parameters

<ParamField path="id" type="string" required>
  Unique identifier of the claim to delete
</ParamField>

## Response

<ResponseField name="message" type="string" required>
  Confirmation message
</ResponseField>

<ResponseField name="deleted_claim_id" type="string" required>
  ID of the deleted claim
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://harbor-parking.vercel.app/api/claims/abc123de-e89b-12d3-a456-426614174003" \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json"
  ```

  ```javascript JavaScript theme={null}
  const claimId = "abc123de-e89b-12d3-a456-426614174003";
  const response = await fetch(`https://harbor-parking.vercel.app/api/claims/${claimId}`, {
    method: 'DELETE',
    headers: {
      'Authorization': `Bearer ${yourJwtToken}`,
      'Content-Type': 'application/json'
    }
  });

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

## Example Response

<ResponseExample>
  ```json Success Response theme={null}
  {
    "message": "Claim cancelled successfully",
    "deleted_claim_id": "abc123de-e89b-12d3-a456-426614174003"
  }
  ```
</ResponseExample>

## Side Effects

When a claim is deleted:

* The associated availability becomes available for other users to claim
* Any notifications related to this claim are marked as resolved
* The parking spot owner is notified of the cancellation

## Error Responses

<ResponseExample>
  ```json 403 Forbidden theme={null}
  {
    "error": "You can only delete your own claims"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Claim not found"
  }
  ```

  ```json 400 Bad Request - Already Completed theme={null}
  {
    "error": "Cannot delete a completed claim"
  }
  ```
</ResponseExample>
