# Update weblinks

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

This endpoint allows the user to update weblinks by id

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

## Path parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | string (`active`, `reactived`, `blocked`, `invalid`, `deleted`, `depleted`, `expired`) | yes |  |

```json
{
  "status": "blocked"
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "product_id": 5,
    "sender_id": 3,
    "operation_token_id": 7,
    "receiver_identifier": "jane.doe@example.com",
    "receiver_identifier_type": "email",
    "url": "string",
    "max_uses": 5,
    "used_count": 3,
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "product": {
      "id": 1,
      "device_id": "B123456",
      "name": "Barrier 1",
      "lot_id": 3,
      "zone_id": 2,
      "power_type": "battery",
      "product_type_id": 1,
      "hardware_version": "1.0.0",
      "firmware_version": "2.3.1",
      "latitude": 43.52652359,
      "longitude": 16.450813293,
      "status": "online",
      "advertisement_data": "string",
      "battery_status": 87,
      "product_error_id": null,
      "rssi": -88,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    },
    "sender": {
      "id": 1,
      "account_user_role_id": 2,
      "account_id": 5,
      "email": "john.doe@example.com",
      "name": "John Doe",
      "phone": "+385 555 5555",
      "email_confirmed": 1,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    },
    "operation_token": {
      "id": 1,
      "product_id": 5,
      "start_time": "2026-01-15T09:30:00.000Z",
      "end_time": "2026-01-15T09:30:00.000Z",
      "status": "active",
      "used_count": 3,
      "is_unlimited": 0,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z",
      "token_close": "a1b2c3d4e5f6...",
      "token_open": "f6e5d4c3b2a1...",
      "token_status": "active"
    }
  }
}
```

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

