Skip to main content

Data Models

This document describes the core data structures used throughout the Instinct API. Understanding these models will help you interact with the API more effectively.

Stream Models

Stream

A Stream represents a data processing pipeline that processes signal data through a series of nodes connected by pipes.

{
"id": "string",
"name": "string",
"description": "string",
"nodes": [Node],
"pipes": [Pipe],
"created_at": "ISO8601 timestamp",
"updated_at": "ISO8601 timestamp",
"status": "string"
}
FieldTypeDescription
idstringUnique identifier for the stream
namestringHuman-readable name for the stream
descriptionstringOptional description of the stream's purpose
nodesarrayArray of Node objects that make up the stream
pipesarrayArray of Pipe objects that connect the nodes
created_atstringISO8601 timestamp of when the stream was created
updated_atstringISO8601 timestamp of when the stream was last updated
statusstringCurrent status of the stream (e.g., "stopped", "running")

Node

A Node represents a processing unit within a stream that performs operations on data.

{
"id": "string",
"type": "string",
"name": "string",
"config": {
// Node-specific configuration
},
"position": {
"x": number,
"y": number
}
}
FieldTypeDescription
idstringUnique identifier for the node within the stream
typestringType of the node (e.g., "source", "filter", "transformer")
namestringHuman-readable name for the node
configobjectNode-specific configuration parameters
positionobjectX and Y coordinates for visual representation

Pipe

A Pipe connects two nodes in a stream, defining how data flows from one node to another.

{
"id": "string",
"source_node": "string",
"source_port": "string",
"target_node": "string",
"target_port": "string"
}
FieldTypeDescription
idstringUnique identifier for the pipe within the stream
source_nodestringID of the node where data originates
source_portstringOutput port name on the source node
target_nodestringID of the node where data is sent
target_portstringInput port name on the target node

EEG Models

EEG Configuration

Defines the configuration for EEG acquisition.

{
"sampling_rate": number,
"gain": number,
"enabled_electrodes": [string],
"input_type": "string",
"bias": boolean
}
FieldTypeDescription
sampling_ratenumberSampling rate in Hz (e.g., 250, 500, 1000)
gainnumberAmplification level for the signals
enabled_electrodesarrayList of electrode identifiers to enable
input_typestringInput type (e.g., "normal", "shorted", "bias")
biasbooleanWhether to enable bias

Electrode

Represents an individual electrode on the headset.

{
"id": "string",
"name": "string",
"location": "string",
"status": "string"
}
FieldTypeDescription
idstringUnique identifier for the electrode
namestringHuman-readable name (e.g., "Fp1", "O2")
locationstringAnatomical location on the scalp
statusstringCurrent status (e.g., "connected", "disconnected")

Impedance Data

Represents impedance measurements for electrodes.

{
"timestamp": "ISO8601 timestamp",
"electrodes": {
"electrode_id": number,
// Additional electrode IDs and their impedance values
}
}
FieldTypeDescription
timestampstringISO8601 timestamp of when the measurement was taken
electrodesobjectMap of electrode IDs to impedance values in kOhms

System Models

System Health

Represents the health status of the headset.

{
"status": "string",
"uptime": number,
"cpu": {
"usage": number,
"temperature": number
},
"memory": {
"total": number,
"used": number,
"free": number
},
"battery": {
"level": number,
"charging": boolean,
"time_remaining": number
},
"storage": {
"total": number,
"used": number,
"free": number
}
}
FieldTypeDescription
statusstringOverall system status (e.g., "healthy", "warning", "critical")
uptimenumberSystem uptime in seconds
cpu.usagenumberCPU usage percentage (0-100)
cpu.temperaturenumberCPU temperature in degrees Celsius
memory.totalnumberTotal memory in bytes
memory.usednumberUsed memory in bytes
memory.freenumberFree memory in bytes
battery.levelnumberBattery level percentage (0-100)
battery.chargingbooleanWhether the battery is currently charging
battery.time_remainingnumberEstimated time remaining in minutes
storage.totalnumberTotal storage in bytes
storage.usednumberUsed storage in bytes
storage.freenumberFree storage in bytes

LED Status

Represents the status of LEDs on the headset.

{
"power": "string",
"status": "string",
"bluetooth": "string",
"custom": [
{
"id": "string",
"status": "string",
"color": "string"
}
]
}
FieldTypeDescription
powerstringPower LED status (e.g., "on", "off", "blinking")
statusstringStatus LED state (e.g., "green", "red", "yellow")
bluetoothstringBluetooth LED status
customarrayArray of custom LED statuses

Motor Position

Represents the position of motors on the headset.

{
"motor_id": {
"current": number,
"target": number,
"moving": boolean
},
// Additional motor IDs and their positions
}
FieldTypeDescription
motor_idobjectMap of motor IDs to their position information
currentnumberCurrent position of the motor
targetnumberTarget position of the motor
movingbooleanWhether the motor is currently moving

Common Structures

Success Response

Standard response format for successful API calls.

{
"success": true,
"data": {
// Response data specific to the API endpoint
}
}
FieldTypeDescription
successbooleanAlways true for successful responses
dataobjectResponse data specific to the API endpoint

Error Response

Standard response format for failed API calls.

{
"success": false,
"error": {
"code": "string",
"message": "string",
"details": {
// Additional context about the error
}
}
}
FieldTypeDescription
successbooleanAlways false for error responses
error.codestringMachine-readable error code
error.messagestringHuman-readable error description
error.detailsobjectOptional object with additional error context

Next Steps