# Update sessions

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

This endpoint allows the user to update sessions by id

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

## Path parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `discount_time` | number | no |  |
| `license_plate` | string | no |  |

```json
{
  "discount_time": 0,
  "license_plate": "string"
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": "854813550000003054",
    "public_id": "A1B2C3D4E5",
    "ended_at": "2026-01-15T09:30:00.000Z",
    "duration": 10800,
    "discount_time": 15,
    "amount_paid": 20,
    "possibly_exited": false,
    "exit_allowed": true,
    "entry_license_plate": {
      "plate": "DT-PLATE2",
      "id": 1,
      "image_url": "string",
      "cropped_image_url": "string"
    },
    "created_at": "2026-01-15T09:30:00.000Z",
    "zone_id": "2",
    "entry": {
      "type": "attendant",
      "id": 1
    },
    "exit": {
      "type": "attendant",
      "id": 1
    }
  }
}
```

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

