Skip to content

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​

https://spacestate.pixelbar.nlProduction
http://localhost:3000Local development (`just dev`)

State​

Whether the space is open or closed right now, and changing it.


Get the current space state​

GET
/api/v1/state

Responses​

Current state.

application/json
JSON
{
  
"state": "open",
  
"since": "2026-10-18T19:04:11.000Z"
}

Playground​

Samples​


Change the space state​

POST
/api/v1/state

Requires an API key with the write role.

Authorizations​

bearerAuth

An API key issued by the Pixelbar board. A read key can fetch history; a write key can also change the state.

Type
HTTP (bearer)

Request Body​

application/json
JSON
{
  
"state": "open",
  
"user": "your-name",
  
"method": "button"
}

Responses​

State changed.

application/json
JSON
{
  
"state": "open",
  
"recordedAt": "2026-10-18T19:04:11.000Z"
}

Playground​

Server
Authorization
Body

Samples​


History​

Every past open/close, newest first, as a paged list.


List state changes, newest first​

GET
/api/v1/history

Requires an API key with the read or write role.

Authorizations​

bearerAuth

An API key issued by the Pixelbar board. A read key can fetch history; a write key can also change the state.

Type
HTTP (bearer)

Parameters​

Query Parameters

from

Only entries at or after this time.

Type
string
Format
"date-time"
to

Only entries at or before this time.

Type
string
Format
"date-time"
device

Only entries from this legacy device shortname.

Type
string
limit

Page size. Values above 200 are clamped to 200.

Type
integer
Minimum
1
Default
50
Maximum
200
continuationToken

Opaque token from a previous page's continuationToken.

Type
string

Responses​

A page of history.

application/json
JSON
{
  
"items": [
  
  
{
  
  
  
"state": "open",
  
  
  
"user": "your-name",
  
  
  
"method": "button",
  
  
  
"deviceShortname": "frontdoor",
  
  
  
"source": "api",
  
  
  
"changedAt": "2026-10-18T19:04:11.000Z"
  
  
}
  
],
  
"continuationToken": "1!52!RGF0ZQ--"
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


SpaceAPI​

The space's SpaceAPI document — the shared format hackerspace status tools read to show whether we're open.


SpaceAPI 0.13 document​

GET
/api/v1/spaceapi

The configured SpaceAPI document with the live open / state.open
fields filled in from current state. See https://spaceapi.io/docs/.

Responses​

SpaceAPI document.

application/json
JSON
{
  
"api": "0.13",
  
"space": "Pixelbar",
  
"url": "https://pixelbar.nl",
  
"logo": "string",
  
"location": {
  
  
"additionalProperties": "string"
  
},
  
"contact": {
  
  
"additionalProperties": "string"
  
},
  
"state": {
  
  
"open": true,
  
  
"lastchange": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Samples​


Operations​

Health checks for the service itself.

Operations​


Liveness probe​

GET
/healthz

Process-only; does not touch storage.

Responses​

Alive.

application/json
JSON
{
  
"status": "ok"
}

Playground​

Samples​


Legacy​

The pre-rewrite URLs, kept working for hardware and consumers that haven't migrated. Deprecated — don't build against these.


Deprecated

SpaceAPI document (legacy address)​

GET
/

Same response as /api/v1/spaceapi; the old public address of the document.

Responses​

SpaceAPI document.

application/json
JSON
{
  
"api": "0.13",
  
"space": "Pixelbar",
  
"url": "https://pixelbar.nl",
  
"logo": "string",
  
"location": {
  
  
"additionalProperties": "string"
  
},
  
"contact": {
  
  
"additionalProperties": "string"
  
},
  
"state": {
  
  
"open": true,
  
  
"lastchange": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Samples​


Deprecated

SpaceAPI document (legacy address)​

GET
/index.php

Same response as /api/v1/spaceapi.

Responses​

SpaceAPI document.

application/json
JSON
{
  
"api": "0.13",
  
"space": "Pixelbar",
  
"url": "https://pixelbar.nl",
  
"logo": "string",
  
"location": {
  
  
"additionalProperties": "string"
  
},
  
"contact": {
  
  
"additionalProperties": "string"
  
},
  
"state": {
  
  
"open": true,
  
  
"lastchange": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Samples​


Deprecated

Current state (legacy shape)​

GET
/spacestate.php

Responses​

Current state.

application/json
JSON
{
  
"state": "open"
}

Playground​

Samples​


Deprecated

Change state (legacy token + IP auth)​

GET
/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​

legacyToken

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.

Type
API Key (query: token)

Parameters​

Query Parameters

token*

The device's token, issued by the Pixelbar board.

Type
string
Required
Min Length
1
user*
Type
string
Required
Example"your-name"
Min Length
1
state*
Type
string
Required
Valid values
"open""closed"
Example"open"

Responses​

Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).

text/plain
JSON
"SUCCESS"

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Deprecated

Change state (legacy token + IP auth)​

POST
/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​

legacyToken

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.

Type
API Key (query: token)

Parameters​

Query Parameters

token*

The device's token, issued by the Pixelbar board.

Type
string
Required
Min Length
1
user*
Type
string
Required
Example"your-name"
Min Length
1
state*
Type
string
Required
Valid values
"open""closed"
Example"open"

Responses​

Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).

text/plain
JSON
"SUCCESS"

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Deprecated

Change state (legacy, alias of /togglestate.php)​

GET
/togglebaker.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​

legacyToken

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.

Type
API Key (query: token)

Parameters​

Query Parameters

token*

The device's token, issued by the Pixelbar board.

Type
string
Required
Min Length
1
user*
Type
string
Required
Example"your-name"
Min Length
1
state*
Type
string
Required
Valid values
"open""closed"
Example"open"

Responses​

Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).

text/plain
JSON
"SUCCESS"

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Deprecated

Change state (legacy, alias of /togglestate.php)​

POST
/togglebaker.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​

legacyToken

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.

Type
API Key (query: token)

Parameters​

Query Parameters

token*

The device's token, issued by the Pixelbar board.

Type
string
Required
Min Length
1
user*
Type
string
Required
Example"your-name"
Min Length
1
state*
Type
string
Required
Valid values
"open""closed"
Example"open"

Responses​

Plain text. SUCCESS if the state changed, otherwise
ALLREADY TOGGLED TO THIS STATE (sic — the typo is preserved on purpose).

text/plain
JSON
"SUCCESS"

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Powered by VitePress OpenAPI

Rendered with vitepress-openapi · themed after pixelbar.nl/pixel