Environments
Check whether Sandbox and Production are ready to take entries, and activate Production.
PacSpace has two environments:
- Sandbox for building and testing, such as wiring an evaluation harness to the record before a real run. A
pk_test_key writes here. - Production for the records you share. A
pk_live_key writes here.
An environment takes entries once it is active. A write to one that is not active yet is refused with 412 RECORDS_CONTRACT_UNAVAILABLE or RECORDS_CONTRACT_NOT_READY, and nothing is queued.
Base URL: https://app.pacspace.io
GET https://app.pacspace.io/dashboard/environments/environment-statusEvery route here needs a dashboard session cookie (-b pacspace-dashboard-cookies.txt). A POST or PATCH made with the cookie also sends X-Pacspace-CSRF: 1 and Origin: https://app.pacspace.io; without them the answer is 403.
Check status
Read the status of both environments.
curl https://app.pacspace.io/dashboard/environments/environment-status \
-b pacspace-dashboard-cookies.txtAnswer 200 OK
{
"success": true,
"data": {
"sandbox": { "status": "active", "contract": { "...": "..." } },
"production": { "status": "none" }
}
}| Status | Meaning |
|---|---|
active | Ready. Writes with this environment's key are taken. |
activating | Being set up. This usually takes a minute or two. |
awaiting_governance | Set up, with a last step on PacSpace's side still to finish. It takes writes once it shows active. |
failed | Setup did not finish. Activate it again. |
none | Not set up yet. |
An environment that is active or awaiting_governance also carries contract, its setup details. Nothing in it is needed to write or check a record.
Activate an environment
Registering starts Sandbox on its own, so this route is mostly for Production.
curl -X POST https://app.pacspace.io/dashboard/environments/provision \
-b pacspace-dashboard-cookies.txt \
-H "X-Pacspace-CSRF: 1" \
-H "Origin: https://app.pacspace.io" \
-H "Content-Type: application/json" \
-d '{ "environment": "production" }'environment is sandbox or production. Takes the admin or manager role.
Answer
{ "success": true, "status": "activating" }Setup runs after the answer; read the status until it shows active. Calling the route again while the environment is activating answers the same, and once it is active it answers "status": "active" with the environment's details in data. Production needs a paid plan, and the route refuses it with 403 until the workspace has one. See Plan and usage.
List environments
curl https://app.pacspace.io/dashboard/environments \
-b pacspace-dashboard-cookies.txtAnswers the environments that have been set up for your workspace, newest first, in data.
Choose the dashboard's environment
The dashboard opens in each person's preferred environment. Changing it changes what the dashboard shows; each key still writes to its own environment.
curl -X PATCH https://app.pacspace.io/dashboard/auth/preferences \
-b pacspace-dashboard-cookies.txt \
-H "X-Pacspace-CSRF: 1" \
-H "Origin: https://app.pacspace.io" \
-H "Content-Type: application/json" \
-d '{ "preferredEnvironment": "production" }'preferredEnvironment is sandbox or production.
From signup to Production
- Register. Sandbox starts setting up on its own.
- Read
GET /dashboard/environments/environment-statusuntil Sandbox isactive. - Make a Sandbox key and write your first entries with it, for example a test run of your evaluation harness.
- Move the workspace to a paid plan.
- Activate Production with
POST /dashboard/environments/provision. - Read the status until Production is
active. - Make a Production key and switch the dashboard to Production.
Routes
| Endpoint | Method | Role | Description |
|---|---|---|---|
/dashboard/environments/environment-status | GET | any member | Status of Sandbox and Production |
/dashboard/environments/provision | POST | admin, manager | Activate an environment |
/dashboard/environments | GET | any member | The environments set up so far |
/dashboard/auth/preferences | PATCH | any member | The dashboard's preferred environment |