# Update key logs

`PATCH https://api.parklio.com/v2/key-logs/{id}`

This endpoint allows the user to update key logs by id

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

## Path parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Change the name of the key log |
| `status` | string (`active`, `reactived`, `blocked`, `invalid`, `deleted`, `depleted`, `expired`) | no | Change the status of the sent key |

```json
{
  "name": "Key Log Name",
  "status": "blocked"
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "product": {
      "product_error": {
        "product": {
          "id": 1,
          "device_id": "B123456",
          "name": "B123456",
          "power_type": "battery",
          "lot_id": 1,
          "zone_id": 1,
          "product_type_id": 1,
          "status": "online"
        },
        "id": 1,
        "error_code": "string",
        "jammed": 1,
        "sensor_dirty": 1,
        "pin_broken": 1,
        "rtcc_invalid": 1,
        "master_key_not_set": 1,
        "deleted_at": null,
        "created_at": {},
        "updated_at": {}
      },
      "id": 1,
      "device_id": "B123456",
      "name": "B123456",
      "power_type": "battery",
      "lot_id": 1,
      "zone_id": 1,
      "product_type_id": 1,
      "hardware_version": "1.0.0",
      "firmware_version": "1.0.0.",
      "latitude": 1,
      "longitude": 1,
      "status": "online",
      "advertisement_data": "string",
      "battery_status": 1,
      "product_error_id": 1,
      "rssi": -80,
      "created_at": {},
      "updated_at": {},
      "barrier": {
        "id": 1,
        "product_id": 1,
        "state": "opened",
        "is_autoclose": 1,
        "is_car_on_top": 0,
        "autoclose_time": 45,
        "created_at": {},
        "updated_at": {}
      },
      "gate": {
        "id": 1,
        "product_id": 2,
        "state": "opened",
        "permanent_position": "disabled",
        "deleted_at": null,
        "created_at": {},
        "updated_at": {}
      },
      "chain": {
        "id": 1,
        "product_id": 3,
        "state": "opened",
        "permanent_position": "disabled",
        "deleted_at": null,
        "created_at": {},
        "updated_at": {}
      },
      "bollard": {
        "id": 1,
        "product_id": 4,
        "state": "opened",
        "permanent_position": "disabled",
        "deleted_at": null,
        "created_at": {},
        "updated_at": {}
      },
      "brain": {
        "id": 1,
        "product_id": 5,
        "state": "opened",
        "permanent_position": "disabled",
        "deleted_at": null,
        "created_at": {},
        "updated_at": {}
      }
    },
    "operation_token": {
      "id": 1,
      "product_id": 1,
      "start_time": {},
      "end_time": {},
      "status": "string",
      "used_count": 1,
      "is_unlimited": 1,
      "token_close": "any",
      "token_open": "any",
      "token_status": "any",
      "deleted_at": null,
      "created_at": {},
      "updated_at": {}
    },
    "sender": {
      "id": 1,
      "account_id": 1,
      "account_user_role_id": 1,
      "email": "john.doe@example.com",
      "name": "John Doe",
      "phone": "string",
      "deleted_at": null,
      "created_at": {},
      "updated_at": {}
    },
    "id": 0,
    "name": "John Doe",
    "sender_id": 0,
    "product_id": 0,
    "operation_token_id": 0,
    "receiver_identifier": "john.doe@example.com",
    "receiver_identifier_type": "email",
    "deleted_at": {
      "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."
    }
  ]
}
```

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

