palbaseDocs

Palbase Machines · API

POST/machines/{name}/builds

Build and roll out the branch's head

Asks for a build of the head of the machine's branch now (a manual deploy): the build is queued, and rolled out beside the version serving once it succeeds. A head built before is built again — its build failed on something passing, or what it pulls in changed. Asked again before the build starts, it is that one build. The machine's build_requested is true until the build is queued; its newest build is then the one asked for. The project's builds a day hold for it as for a push. A machine read with tokens (source.access token) is built from the commit its caller names — its branch's head when it names none — read with the token the deploy gives (MachineDeploy): checked with GitHub now (it must reach the machine's repository and nothing else), the build queued with it at once, and the answer's build_requested false. A commit named must be the branch's head (409 commit_not_head when a newer push moved it); one the machine runs already is not built again.

Called by your server, with the project's secret key.

Path

namestring · requiredThe machine's name: lowercase letters, digits and dashes, starting with a letter and not ending with a dash, 32 at most.

Request body

commitstring · optionalThe commit to build, its full SHA — the branch's head, as GitHub has it now (409 commit_not_head otherwise: a newer push moved the branch); left out, the head. For a machine read with tokens alone.
git_access_tokenstring · optionalA GitHub App installation's token (ghs_…) for the machine's repository alone, read-only: the build reads its source with it once, and it is kept nowhere. One lasts an hour; make one for each deploy. For a machine read with tokens alone.
curl
curl -X POST "https://<your-ref>.palbase.studio/machines/<name>/builds" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"commit":"string","git_access_token":"string"}'

Responses

202The build of the branch's head is asked for: the machine, as it is now

400Validation failed or a required field is missing

401Missing or invalid API key

403Not the project's secret key; or the request requires elevated owner authentication (`owner_only`, `insufficient_user_authentication`).

404The project has no machine of this name

409The project already has a machine of this name, or has as many machines as it may

429Over the project's request limit, or its machine time for this period is used up

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation DeployMachine of machines's contract.