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>Run firmware on a board
Upload a .bin (max 4 MB) and it is queued for the next free board matching the profile. The response carries the job id, and while the job is QUEUED it also carries queuePosition, so you know how many are ahead of you without polling for it.
curl -X POST \
-H "Authorization: Bearer $PAT" \
-F firmware=@blink.bin \
-F profile_key=esp32c3-mini-v1 \
https://haas-lab.com/api/v1/jobsList your jobs
Returns your jobs newest first, 20 to a page. The response's meta carries page, pageSize, total and totalPages; there is no parameter that changes the page size.
curl \
-H "Authorization: Bearer $PAT" \
"https://haas-lab.com/api/v1/jobs?page=1"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>/serialRoadmap: validate a restricted module
Not a way to run anything yet. This checks a .wasm module (max 128 KiB) against the sandbox policy and returns the verdict; queueing a module on hardware opens once the trusted runtime is provisioned. Native .bin jobs above are the way to reach a board today.
curl -X POST \
-H "Authorization: Bearer $PAT" \
-F module=@app.wasm \
https://haas-lab.com/api/v1/sandbox/validateManage 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>