# Update zones

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

This endpoint allows the user to update zones by id

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

## Path parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | The name of the zone |
| `lot_id` | number | no | The ID of the lot this zone belongs to |
| `description` | string | no | A brief description of the zone |
| `occupied_count` | number | no | The current number of occupied spots in the zone |
| `spot_count` | number | no | The total number of parking spots in the zone |
| `max_levenshtein_distance` | number | no | The maximum Levenshtein distance allowed when fuzzy matching scanned license plates against whitelisted plates |

```json
{
  "name": "Main Entrance Zone",
  "lot_id": 1,
  "description": "Zone covering the main entrance and visitor parking area",
  "occupied_count": 42,
  "spot_count": 100,
  "max_levenshtein_distance": 1
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "account_id": 1,
    "lot_id": 1,
    "name": "Default Zone",
    "description": "Zone covering the main entrance and visitor parking area",
    "spot_count": 10,
    "occupied_count": 0,
    "tariffs": [
      {
        "id": 1,
        "name": "Basic Tariff",
        "order": 1
      }
    ],
    "max_levenshtein_distance": 1,
    "vector_map": "string",
    "deleted_at": null,
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z"
  }
}
```

### 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"
    }
  ]
}
```

