palbaseDocs

Palbase Machines · API

POST/machines/{name}/hooks

Make a machine deploy hook

Makes a URL that builds the machine's branch head when it is POSTed to (https://deploy-hooks.<domain>/<token>), held to the project's builds as a push is, at most once in five seconds. Its URL is in the answer alone: keep it as a secret, and delete the hook if it leaks. 5 at most (too_many_hooks, 409); a machine read with its caller's tokens has none (409).

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

namestring · requiredWhat calls it: letters, digits, spaces, dots, dashes and underscores, 64 at most.
curl
curl -X POST "https://<your-ref>.palbase.studio/machines/<name>/hooks" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"string"}'

Responses

201The hook, with its URL

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