Skip to content
PacSpace
Talk to us

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

http
GET https://app.pacspace.io/dashboard/environments/environment-status

Every 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.

bash
curl https://app.pacspace.io/dashboard/environments/environment-status \
  -b pacspace-dashboard-cookies.txt

Answer 200 OK

json
{
  "success": true,
  "data": {
    "sandbox": { "status": "active", "contract": { "...": "..." } },
    "production": { "status": "none" }
  }
}
StatusMeaning
activeReady. Writes with this environment's key are taken.
activatingBeing set up. This usually takes a minute or two.
awaiting_governanceSet up, with a last step on PacSpace's side still to finish. It takes writes once it shows active.
failedSetup did not finish. Activate it again.
noneNot 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.

bash
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

json
{ "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

bash
curl https://app.pacspace.io/dashboard/environments \
  -b pacspace-dashboard-cookies.txt

Answers 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.

bash
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

  1. Register. Sandbox starts setting up on its own.
  2. Read GET /dashboard/environments/environment-status until Sandbox is active.
  3. Make a Sandbox key and write your first entries with it, for example a test run of your evaluation harness.
  4. Move the workspace to a paid plan.
  5. Activate Production with POST /dashboard/environments/provision.
  6. Read the status until Production is active.
  7. Make a Production key and switch the dashboard to Production.

Routes

EndpointMethodRoleDescription
/dashboard/environments/environment-statusGETany memberStatus of Sandbox and Production
/dashboard/environments/provisionPOSTadmin, managerActivate an environment
/dashboard/environmentsGETany memberThe environments set up so far
/dashboard/auth/preferencesPATCHany memberThe dashboard's preferred environment