Documentation
API Reference
haas-lab exposes a REST API for programmatic firmware testing. Sign in to generate a Personal Access Token.
Authentication
All API requests require a Personal Access Token (PAT) in the Authorization header. Generate one at /dashboard/tokens after signing in.
# All requests require:
Authorization: Bearer pat_<your-token>Validate a restricted module
Upload a .wasm module (max 128 KiB). This validates policy only; public hardware queueing opens after trusted-runtime provisioning.
curl -X POST \
-H "Authorization: Bearer $PAT" \
-F [email protected] \
https://haas-lab.com/api/v1/sandbox/validateAdministrator native jobs
The native .bin job endpoint is reserved for trusted administrators. Public clients receive 403 unless an operator explicitly enables the unsafe compatibility mode.
# Administrator-only compatibility endpoint:
POST https://haas-lab.com/api/v1/jobsList your jobs
Returns a paginated list of your jobs, newest first.
curl \
-H "Authorization: Bearer $PAT" \
"https://haas-lab.com/api/v1/jobs?page=1&limit=20"Get job status
Poll for job status. Status progresses: QUEUED → FLASHING → RUNNING → COMPLETED.
curl \
-H "Authorization: Bearer $PAT" \
https://haas-lab.com/api/v1/jobs/<job-id>Stream live serial output
Connect to the SSE stream for a running job. Each event contains one line of serial output.
curl -N \
-H "Authorization: Bearer $PAT" \
-H "Accept: text/event-stream" \
https://haas-lab.com/api/v1/jobs/<job-id>/streamGet archived serial log
After a job completes, retrieve the full serial log as plain text.
curl \
-H "Authorization: Bearer $PAT" \
https://haas-lab.com/api/v1/jobs/<job-id>/serialManage API tokens
Create, list, and revoke Personal Access Tokens.
# Create a new token
curl -X POST \
-H "Authorization: Bearer $PAT" \
-H "Content-Type: application/json" \
-d '{"name":"ci-token"}' \
https://haas-lab.com/api/v1/tokens
# List tokens (plaintext never returned after creation)
curl -H "Authorization: Bearer $PAT" https://haas-lab.com/api/v1/tokens
# Revoke a token
curl -X DELETE \
-H "Authorization: Bearer $PAT" \
https://haas-lab.com/api/v1/tokens/<token-id>