KKonsol Developers

Register devices in bulk

POST
/integration/v1/devices/batch

Registers up to 1100 devices of one vendor and model in one request. Each serial becomes a device as POST /integration/v1/devices would make it.

Some serials can fail while others succeed, and the response is still 200:

  • added: the devices created.
  • already_exists: serials a device already has; skipped.
  • rejected: serials not added, with a reason. failed means Konsol could not write that part of the batch.

Sending the same body again is safe. Serials added the first time come back in already_exists, so resend to retry the failed ones.

Authorization

integrationKey
headerAuthorizationBearer <token>

Your integration key, sent as Authorization: Bearer nik_<prefix>_<secret>. Konsol issues it.

Header Parameters

Idempotency-Key?string

A unique value per logical request, such as a UUID. Within 24 hours a repeat with the same key, path and body returns the first response; the same key with a different path or body is a 409.

Length1 <= length <= 255

Request Body

application/json
  1. body
vendor_id*string

The vendor that supplied every device in the batch.

Formatuuid
model_id*string

The model of every device in the batch. It must belong to vendor_id.

Formatuuid
serials*array<>

Each becomes a device's device_identifier. Identifiers are unique in your organisation, ignoring letter case. A serial must match ^[A-Za-z0-9][A-Za-z0-9._-]{3,31}$ or it is rejected as invalid_serial; a repeat of an earlier serial in this list is rejected as duplicate_in_batch.

Items1 <= items <= 1100

Response Body

What was added, what already existed, and what was not added

application/json
  1. response
requested*integer

How many serials the body carried, repeats included.

added*array<>
already_exists*array<string>

Serials a device already has; skipped.

rejected*array<>
Example Request
curl -X POST 'https://api.konsol.my/integration/v1/devices/batch' \  -H 'Content-Type: application/json' \  -d '{  "vendor_id": "98232994-9d54-43ee-a280-d7c895362d0c",  "model_id": "f8ff2fb8-4acc-4e48-bd83-cbdac23e1224",  "serials": [    "string"  ]}'
Example Response
{  "requested": 5,  "added": [    {      "serial": "PAX0012346",      "device_id": "01a15ef6-b96f-7838-bdf7-8c94db441bf6"    },    {      "serial": "PAX0012347",      "device_id": "01a15ef6-b96f-783a-a5d2-f82ea39f655b"    }  ],  "already_exists": [    "PAX0012345"  ],  "rejected": [    {      "serial": "PAX0012346",      "reason": "duplicate_in_batch"    },    {      "serial": "x",      "reason": "invalid_serial"    }  ]}