# Change barrier settings

`POST https://api.parklio.com/v2/products/{id}/settings`

Changes a barrier's auto-close, through a Gateway. Send **one** setting per call:

- `is_autoclose`: `true` or `false` (a JSON boolean, not `1`/`0`);
- `autoclose_time`: the delay in seconds, 5–60.

If you send both, only `is_autoclose` is applied. An empty body fails.

**Asynchronous**, like [Operate a product](/api/endpoints/products-change-state): the response is an `event_id`, and the result arrives as a realtime `lot_change` or `gateway_error`. In `lot_change`, the barrier block calls these fields `is_auto_close` and `auto_close_time`. Needs the `REMOTE_CONTROL` feature.

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

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The barrier's product `id`. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `is_autoclose` | boolean | no | Turns the barrier autoclose on or off. |
| `autoclose_time` | number | no | Changes the barrier autoclose time. |

```json
{
  "is_autoclose": true,
  "autoclose_time": 15
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "event_id": "a1b2c3d4"
  }
}
```

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

