# Create terminals

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

This endpoint allows the user to create terminals

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `device_id` | string | yes |  |
| `mac` | string | yes |  |
| `public_key` | string | yes |  |
| `type` | string (`entry`, `exit`, `pof`, `lp_pof`, `lp_exit`) | yes |  |
| `is_master` | boolean | yes |  |

```json
{
  "device_id": "92338123",
  "mac": "45:d6:4a:fc:f7:2f",
  "public_key": "Z3ljaTBlem55OG5jZHh0b3FwbmpqejFxdDdxdmk0aDh3bW40NHBmMHBxaWplZTBnOW50eDVpeXhtN21pdTFueTd0c292eW05dHY4cXZjM3M0anMzcTdyYjJjZWI0bW5iN29ubTl3bWhqeXFjbWF4bTY2NGVhMHNqcW9vMGVuemY=",
  "type": "entry",
  "is_master": true
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "zone_id": 1,
    "name": "Terminal",
    "status": "online",
    "device_id": "273827664",
    "ip_address": "192.168.2.223",
    "version": "1.0.1",
    "mac": "AA:BB:CC:11:22:33",
    "is_master": true,
    "type": "exit",
    "pos_serial_number": "23432411233",
    "electronic_device_id": "12331365465",
    "system_currency": "EUR",
    "last_seen": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "created_at": "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"
    }
  ]
}
```

### 503 — the device might not be connected or an internal error happened

```json
{
  "success": false,
  "errors": [
    {
      "code": 40,
      "message": "the message to the remote device timed out"
    }
  ]
}
```

