palbaseDocs

Palbase Machines · API

POST/machines/github/installations/share

Share an installation of the organization

Connects an installation of Palbase Cloud that another project of the same organization connected, on the registry's word (X-Palbase-Studio-Share), which Studio asks the registry for an admin of both projects: a program that opens a project for each product connects its own installation to each, with no person's GitHub token. The project reaches the repositories of it the GitHub user who connected it there can push to — and, as with every connection, one created or added to the installation later once that user can push to it (asked when a machine is built from it, and when GitHub says repositories were added). Refused without the registry's word, or when that project has not connected the installation; and when this project connected it otherwise — for other repositories, for all of them where this names some (or some where this names none), or by another GitHub user: linking again never widens, narrows or hands over a connection, so it is disconnected and connected anew. The same share again is as it was.

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

Request body

installation_idinteger (int64) · required
from_projectstring (uuid) · requiredThe project that connected it.
repositoriesstring[] · optionalThe repositories (owner/name) the project reaches of it, and no other: each one the installation reaches and the GitHub user who connected it can push to (refused otherwise, `repository_not_shared`). Shared for them, the project never reaches a repository the installation reaches later. Left out: what that project reaches.
curl
curl -X POST "https://<your-ref>.palbase.studio/machines/github/installations/share" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"installation_id":1,"from_project":"00000000-0000-0000-0000-000000000000"}'

Responses

201The installation, connected

400Validation failed or a required field is missing

401Missing or invalid API key

403No word of the registry's for the share (`studio_word_required`); or not the project's secret key, or the platform's own project (OperatorForbidden)

404That project has not connected the installation (`installation_not_linked`)

409The project connected the installation otherwise (`installation_scoped`: for other repositories, or some alone where this is for all, or all where this is for some; `installation_linked_by_other`: by another GitHub user) — disconnect it, then connect it anew

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