Send Signal
POST /api/signals/send
Sends a signal to an existing data source.
Tip
Step-by-step guide with complete code examples: Import Data from Python & MATLAB
Request
POST /api/signals/send HTTP/1.1Host: localhost:5678Content-Type: application/jsonJSON Inline
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Signal name |
y | array | Yes | Y values (amplitude) |
x | array | No | X values (time/frequency). Auto-generated if not provided |
z | array/2D-array | No | Z values for trace lines (1D) or spectrograms (2D) |
y_unit | string | No | Unit of the Y axis (e.g. "V", "A") |
x_unit | string | No | Unit of the X axis (e.g. "s", "Hz") |
z_unit | string | No | Unit of the Z axis (e.g. "dB", "°C") |
target_source_id | string | Yes | ID of the target data source |
Example: Simple Signal
{ "name": "Sine 5Hz", "y": [0, 0.841, 0.909, 0.141, ...], "x": [0, 0.1, 0.2, 0.3, ...], "y_unit": "V", "x_unit": "s", "target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"}Example: Trace Line (1D Z axis)
{ "name": "Colored Sine", "y": [0, 0.841, 0.909, ...], "x": [0, 0.1, 0.2, ...], "z": [0.5, 0.7, 0.9, ...], "y_unit": "V", "x_unit": "s", "z_unit": "°C", "target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"}Example: Spectrogram (2D Z Matrix)
{ "name": "Spectrogram", "y": [0, 10, 20, ...], "x": [0, 0.1, 0.2, ...], "z": [[0.1, 0.2, ...], [0.3, 0.4, ...], ...], "y_unit": "Hz", "x_unit": "s", "z_unit": "dB", "target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"}Info
Z axis format:
- 1D array (length = length of x and y): trace line with color coding
- 2D matrix (shape:
[len(y), len(x)]): spectrogram/heatmap
File Reference
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Signal name |
file | string | Yes | Absolute path to a .npz or .mat file |
y_unit | string | No | Unit of the Y axis |
x_unit | string | No | Unit of the X axis |
z_unit | string | No | Unit of the Z axis |
target_source_id | string | Yes | ID of the target data source |
Example
{ "name": "Large Signal", "file": "/home/user/data/signal.npz", "y_unit": "V", "x_unit": "s", "target_source_id": "937896ff-f856-4b20-8888-e5127f0835b5"}File format
- NumPy (.npz): Must contain an array named
y. Optional:xandz. - MATLAB (.mat): Must contain a variable named
y. Optional:xandz.
Files created automatically by the ScryLab Python client in ~/.cache/scrylab/transport/ are deleted after a successful import. Files at any other path are left untouched.
Linux Flatpak
/tmp/ is not shared with the host inside the Flatpak sandbox. Use ~/.cache/scrylab/transport/ or another path under ~/ as a temporary location.
Response
Status Code: 200 OK
Body:
{ "status": "ok", "result": { "signal_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "name": "Sine 5Hz", "sample_count": 1000 }}Response Fields
| Field | Type | Description |
|---|---|---|
result.signal_id | string | ID of the imported signal |
result.name | string | Actual name of the signal |
result.sample_count | integer | Number of imported samples |
Errors
| Status | Meaning |
|---|---|
400 | Invalid parameters or malformed file (e.g. missing y array) |
404 | target_source_id not found |
500 | Server error (e.g. file not readable) |
Example:
{ "status": "error", "error": "No handler found for source ID: 937896ff-..."}