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
Large data
This endpoint only accepts inline JSON (best for small signals). Transfer large arrays as a binary upload instead – a single signal via POST /api/signals/upload, many signals in one request via POST /api/signals/upload_batch. This avoids the JSON overhead and works inside the Flatpak sandbox too.
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 (e.g. missing y array, or a file field – upload file contents via /api/signals/upload instead) |
404 | target_source_id not found |
500 | Server error |
Example:
{ "status": "error", "error": "No handler found for source ID: 937896ff-..."}