# Create single operation keys

`POST https://api.parklio.com/v2/operation-keys/single`

This endpoint allows the user to create single operation keys

**Auth:** none (public)

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `start_time` | string | yes |  |
| `end_time` | string | no |  |
| `product_id` | number | yes |  |
| `receiver_email` | string | yes |  |
| `is_unlimited` | number | no |  |

```json
{
  "start_time": "2026-01-15T09:30:00.000Z",
  "end_time": "2026-01-15T09:30:00.000Z",
  "product_id": 1,
  "receiver_email": "john.doe@example.com",
  "is_unlimited": 0
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 0,
    "name": "John Doe",
    "product_id": 1,
    "sender_id": 1,
    "operation_token_id": 0,
    "deleted_at": null,
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "receiver": {
      "id": 2,
      "email": "jane.doe1@example.com",
      "name": "Jane Doe"
    },
    "sender": {
      "id": 1,
      "email": "john.doe@example.com",
      "name": "John Doe"
    },
    "product": {
      "device_id": "B123456",
      "latitude": 43.52652359,
      "longitude": 16.450813293,
      "product_type_id": 1,
      "lot_id": 1,
      "zone_id": 1,
      "id": 1
    },
    "operation_token": {
      "id": 1,
      "product_id": 1,
      "start_time": {},
      "end_time": {},
      "status": "active",
      "used_count": 0,
      "is_unlimited": 1,
      "token_close": {
        "token": "string",
        "status_key": "string",
        "challenge_key": "string"
      },
      "token_open": {
        "token": "string",
        "status_key": "string",
        "challenge_key": "string"
      },
      "token_status": {
        "token": "string",
        "status_key": "string",
        "challenge_key": "string"
      },
      "deleted_at": null,
      "created_at": {},
      "updated_at": {}
    }
  }
}
```

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

