Skip to content

SP4T Endpoints

These endpoints are available on SP4T switch hardware. States are zero-based and there is no "all open" state — exactly one throw is routed at all times.

GET /api/sp4t

Returns the currently routed throw.

Response:

{
  "state": 0
}
State Description
0 COM routed to RF0
1 COM routed to RF1
2 COM routed to RF2
3 COM routed to RF3

POST /api/sp4t

Sets the routed throw.

Request:

{
  "state": 2
}

Response:

{
  "state": 2
}

Errors:

  • 400 — Invalid state value (must be 0–3)
  • 500 — Failed to set SP4T state

Example:

# Route COM to RF2
curl -X POST -H "Content-Type: application/json" \
  -d '{"state": 2}' \
  http://<device-ip>/api/sp4t

# Query the current throw
curl http://<device-ip>/api/sp4t

Deprecated /api/switch Alias

On SP4T hardware, /api/switch is a deprecated alias for /api/sp4t and carries the same 0–3 state range. Existing bench scripts and saved automation that predate the rename keep working; new automation should use /api/sp4t.

For the two-throw variant see SPDT Endpoints.