# Create weblinks

`POST https://api.parklio.com/v2/weblinks`

Emails a link that lets the receiver operate products from a browser, through the cloud and a Gateway, during a time window. One weblink is created per product.

- **Parklio always sends the email** to `receiver_email`; you can't send the link yourself.
- `start_time` and `end_time` are both required. `max_uses` defaults to 1; `null` means unlimited.
- Revocation is immediate.

The response has one item per product; check `success` on each. See [Access and keys](/concepts/access-and-keys#weblinks).

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `products` | number[] | yes | List of product IDs to create weblinks for |
| `receiver_email` | string | yes | Email address of the weblink recipient |
| `start_time` | string | yes | ISO 8601 datetime from which the weblink becomes valid |
| `end_time` | string | yes | ISO 8601 datetime at which the weblink expires |
| `max_uses` | number | no | Maximum number of times the weblink can be used. Defaults to 1 if not provided. Set to null for unlimited uses. |

```json
{
  "products": [
    5,
    10,
    15
  ],
  "receiver_email": "john.doe@example.com",
  "start_time": "2026-01-15T09:30:00.000Z",
  "end_time": "2026-01-15T09:30:00.000Z",
  "max_uses": 10
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": [
    {
      "success": true,
      "product_id": 123,
      "receiver_email": "guest@example.com",
      "product_name": "Entrance barrier",
      "url": "<weblink-url>"
    }
  ]
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

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

