palbaseDocs

Palbase Machines · API

POST/machines/{name}/previews/{pull_request}/authorize

Authorize a fork's pull request's preview

Builds the preview of a pull request from a fork at the head an admin looked at (fork protection, Vercel's Git Fork Protection: a fork's code runs with the environment's settings and secrets). The head must be the pull request's newest: a push since answers 409 preview_head_moved. Each new push asks 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.
pull_requestinteger · requiredThe pull request's number.

Request body

commitstring · requiredThe pull request's head, as its preview says (Preview.commit).
curl
curl -X POST "https://<your-ref>.palbase.studio/machines/<name>/previews/<pull_request>/authorize" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"commit":"string"}'

Responses

202Authorized: the preview is being built

400Validation failed or a required field is missing

401Missing or invalid API key

403Not the project's secret key

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 AuthorizeMachinePreview of machines's contract.