# Update rgb display rules

`PATCH https://api.parklio.com/v2/rgb-display-rules/{id}`

This endpoint allows the user to update rgb display rules 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 rule used to identify it in the list. |
| `operator` | string (`eq`, `lt`, `gt`, `between`) | no | The comparison operator used to evaluate the rule against the available spot count. Supported values: `eq` (equal), `lt` (less than), `gt` (greater than), `between` (inclusive range). |
| `occupied_value` | number | no | The value to compare the occupied spot count against. When operator is `between`, this represents the lower bound of the range. |
| `occupied_value_to` | number | no | The upper bound occupied value used only when operator is `between`. Required when operator is `between`, ignored for all other operators. |
| `display_text` | string | no | The text to display when this rule matches. Supports placeholders: `{free}` (current free spots) and `{total}` (total zone capacity). |
| `start_time` | string | no | The time from which this rule is active. If null the rule is active at all times. Must be used together with `endTime`. |
| `end_time` | string | no | The time until which this rule is active. If null the rule is active at all times. Must be used together with `startTime`. |
| `order` | number | no | The position of this rule in the evaluation order. Rules are evaluated top-to-bottom and the first match wins. If omitted, the existing order is preserved. |

```json
{
  "name": "Low availability",
  "operator": "gt",
  "occupied_value": 5,
  "occupied_value_to": 10,
  "display_text": "{free} FREE",
  "start_time": "2026-01-15T09:30:00.000Z",
  "end_time": "2026-01-15T09:30:00.000Z",
  "order": 0
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Low availability",
    "operator": "gt",
    "occupied_value": 5,
    "occupied_value_to": 10,
    "display_text": "{free} FREE",
    "order": 0,
    "start_time": "2026-01-15T09:30:00.000Z",
    "end_time": "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"
    }
  ]
}
```

