Persist GitHub App installation after portal redirect
const url = 'https://example.com/api/github/app/install/complete';const options = { method: 'POST', headers: { cookie: 'sb-access-token=<sb-access-token>', 'Content-Type': 'application/json' }, body: '{"installation_id":1,"setup_action":"install"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/github/app/install/complete \ --header 'Content-Type: application/json' \ --cookie sb-access-token=<sb-access-token> \ --data '{ "installation_id": 1, "setup_action": "install" }'Called from the SPA with Bearer or cookie session; upserts the installations row.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Responses
Section titled “ Responses ”Installation saved
object
Invalid request
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Not authenticated
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
True if re-linking GitHub may fix the issue
Server error
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)