BioStar X introduces a powerful new capability that allows external systems to insert event logs directly into the BioStar X server. This feature enables access events to be sent directgly to BioStar X without database-level integration.
To support this feature, external events must be linked to a Virtual Device—a logical device record created within BioStar X to represent the originating device.
Important:
The BioStar X Event Log API License is required to use this feature.
Overview of the Feature Workflow
Importing external event logs into BioStar X involves two main API operations:
Create a Virtual Device
Import Events Associated With the Virtual Device
This article explains both steps in detail.
1. Creating a Virtual Device
Before importing any external events, you must first define a virtual device that will serve as the source of those events.
Endpoint
POST /api/v2/virtual_devices
Example Request Body
Field Requirements
| Field | Description | Required |
|---|---|---|
| id | Unique identifier for the virtual device. Must be between 100001–999999, and cannot duplicate any existing device ID or device name. | Yes |
| name | Name of the virtual device. | Yes |
| description | Optional description for your reference. | No |
| device_group_id | Device group to which this virtual device belongs. | Yes |
Once the virtual device is successfully created, it can be used as the event source for all imported event logs.
2. Importing Events
BioStar X allows batch import of two specific event types generated by a virtual device:
4088 — Access Granted
6400 — Access Denied
Endpoint
POST /api/events/import
Example Request Body
Field Requirements
| Field | Description | Required |
|---|---|---|
| packet_device_id | ID of the virtual device. Must match all events[].dev_id values. | Yes |
| is_virtual_device | Must be set to true for event imports. | Yes |
| events | Array of event objects to import. | Yes |
Within each event object
| Field | Description | Required |
|---|---|---|
| dev_id | ID of the virtual device. Must match packet_device_id. | Yes |
| evt | Event type (4088 for Access Granted, 6400 for Access Denied). | Yes |
| datetime | Timestamp in UTC. | Yes |
| user_id | User ID associated with the event. | Yes |
| tna_key | Optional transaction key or reference identifier. | No |
Viewing Imported Event Logs
After completing the import, you can retrieve and verify the event logs via:
/api/events/search
For detailed guidance on searching event history, please refer to the following article:
[BioStar 2 API] How To Retrieve Events Logs
Additional Resources
BioStar X API Documentation
If an API you are looking for does not appear in this documentation, it is not yet available for public use.
Need Help?
If you have questions regarding BioStar X API, please submit a ticket through our support page:
Suprema Support Page