# Update lots

`PATCH https://api.parklio.com/v2/lots/{id}`

This endpoint allows the user to update lots by id

**Auth:** `Authorization: Bearer <token>`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no |  |
| `description` | string | no |  |
| `address` | string | no |  |
| `timezone` | string | no |  |
| `latitude` | number | no |  |
| `longitude` | number | no |  |

```json
{
  "name": "John Doe",
  "description": "Lot description",
  "address": "Lot address",
  "timezone": "Europe/Zagreb",
  "latitude": 43.52652359,
  "longitude": 16.450813293
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "account_id": 1,
    "name": "John Doe",
    "description": "Lot description",
    "address": "Lot address",
    "latitude": 45.14270079621355,
    "longitude": 24.789809374999987,
    "timezone": "Europe/Zagreb",
    "spot_count": 10,
    "occupied_count": 0,
    "detection_status": "string",
    "detection_implementation_status": "string",
    "lot_state_representation_vector": "string",
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "deleted_at": null
  }
}
```

### 400 — You cannot update lot detection parameters without an valid lot detection on the lot. Please add parking detection to the lot first.

```json
{
  "success": false,
  "errors": [
    {
      "code": 304,
      "message": "No Parking detection active for lot."
    }
  ]
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

### 403 — User does not have permission to access requested resource.

```json
{
  "success": false,
  "errors": [
    {
      "code": 4,
      "message": "No permission."
    }
  ]
}
```

### 404 — Resource that has been requested does not exist. User should not try to repeat this request.

```json
{
  "success": false,
  "errors": [
    {
      "code": 6,
      "message": "Resource not found."
    }
  ]
}
```

### 422 — Some of the provided request parameters are missing or are invalid. User should add/change them according to response message.

```json
{
  "success": false,
  "errors": [
    {
      "code": 23,
      "message": "Validation error",
      "field": "field"
    }
  ]
}
```

