SpaceAPI document and open/closed state for Pixelbar.
The /api/v1 endpoints are the supported API. The legacy endpoints
(/, /index.php, /spacestate.php, /togglestate.php, /togglebaker.php)
are a temporary compatibility shim for hardware and consumers that have not
migrated; do not build new integrations on them.
Authentication
Reading is open to everyone: the current state, the SpaceAPI document and
the health check need no credentials. Two kinds of credential exist for
everything else, and both are issued by the Pixelbar board — ask them if
you need one.
API key
A bearer token, used for reading history and for changing the state. Keys
carry a role: read covers history, write covers history and state
changes.
POST /api/v1/state HTTP/1.1
Host: spacestate.pixelbar.nl
Authorization: Bearer <your-api-key>
Content-Type: application/json
{
"state": "open",
"user": "your-name",
"method": "api"
}
A missing, unknown or under-privileged key gets
401 {"error":"unauthorized"}.
Legacy device token
The deprecated toggle endpoints take a per-device token in the query
string instead, and accept it only from that device's registered IP
address. These exist for hardware that predates the API key scheme; build
new integrations against POST /api/v1/state.
https://spacestate.pixelbar.nl/togglestate.php
?token=<your-device-token>
&user=your-name
&state=open
A bad token, or a good token from an unexpected address, redirects to
https://www.pixelbar.nl/ rather than returning an error status.
Servers
Get the current space state
Change the space state
Requires an API key with the write role.
Authorizations
An API key issued by the Pixelbar board. A read key can fetch history; a write key can also change the state.
Request Body
Responses
State changed.
List state changes, newest first
Requires an API key with the read or write role.
Authorizations
An API key issued by the Pixelbar board. A read key can fetch history; a write key can also change the state.
Parameters
Query Parameters
Only entries at or after this time.
"date-time"Only entries at or before this time.
"date-time"Only entries from this legacy device shortname.
Page size. Values above 200 are clamped to 200.
150200Opaque token from a previous page's continuationToken.
Responses
A page of history.
SpaceAPI
The space's SpaceAPI document — the shared format hackerspace status tools read to show whether we're open.
Operations
SpaceAPI 0.13 document
The configured SpaceAPI document with the live open / state.open
fields filled in from current state. See https://spaceapi.io/docs/.
Responses
SpaceAPI document.
Legacy
The pre-rewrite URLs, kept working for hardware and consumers that haven't migrated. Deprecated — don't build against these.
SpaceAPI document (legacy address)
Same response as /api/v1/spaceapi; the old public address of the document.
Responses
SpaceAPI document.
SpaceAPI document (legacy address)
Same response as /api/v1/spaceapi.
Responses
SpaceAPI document.
Current state (legacy shape)
Change state (legacy token + IP auth)
Authenticated by a per-device token and the caller's IP address
(both must match a configured legacy device). Parameters always come
from the query string; on POST any request body is ignored.
Invalid parameters and failed authentication both respond with a
redirect to https://www.pixelbar.nl/ rather than an error status.
Authorizations
A per-device token issued by the Pixelbar board, accepted only from that device's registered IP address. Failures redirect to https://www.pixelbar.nl/ instead of returning 401.
Parameters
Query Parameters
The device's token, issued by the Pixelbar board.
1"your-name"1"open""closed""open"Responses
Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).
Change state (legacy token + IP auth)
Authenticated by a per-device token and the caller's IP address
(both must match a configured legacy device). Parameters always come
from the query string; on POST any request body is ignored.
Invalid parameters and failed authentication both respond with a
redirect to https://www.pixelbar.nl/ rather than an error status.
Authorizations
A per-device token issued by the Pixelbar board, accepted only from that device's registered IP address. Failures redirect to https://www.pixelbar.nl/ instead of returning 401.
Parameters
Query Parameters
The device's token, issued by the Pixelbar board.
1"your-name"1"open""closed""open"Responses
Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).
Change state (legacy, alias of /togglestate.php)
Authenticated by a per-device token and the caller's IP address
(both must match a configured legacy device). Parameters always come
from the query string; on POST any request body is ignored.
Invalid parameters and failed authentication both respond with a
redirect to https://www.pixelbar.nl/ rather than an error status.
Authorizations
A per-device token issued by the Pixelbar board, accepted only from that device's registered IP address. Failures redirect to https://www.pixelbar.nl/ instead of returning 401.
Parameters
Query Parameters
The device's token, issued by the Pixelbar board.
1"your-name"1"open""closed""open"Responses
Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).
Change state (legacy, alias of /togglestate.php)
Authenticated by a per-device token and the caller's IP address
(both must match a configured legacy device). Parameters always come
from the query string; on POST any request body is ignored.
Invalid parameters and failed authentication both respond with a
redirect to https://www.pixelbar.nl/ rather than an error status.
Authorizations
A per-device token issued by the Pixelbar board, accepted only from that device's registered IP address. Failures redirect to https://www.pixelbar.nl/ instead of returning 401.
Parameters
Query Parameters
The device's token, issued by the Pixelbar board.
1"your-name"1"open""closed""open"Responses
Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).