Begin a GitHub App installation
POST/api/github/app/installations/consent
beginGithubAppConsent
Mints a single-use, 15-minute `state` nonce bound to the calling account and returns the `https://github.com/apps/{slug}/installations/new` URL that carries it. Open `install_url` in a browser — do not fetch it. GitHub redirects back to `GET /api/github/app/installations/callback`, which is where the installation is actually recorded. `return_to` must be an absolute path on this site; an absolute URL, a protocol-relative `//host/path`, a `/\host/path`, or anything carrying a control character is refused with `400`. That validation happens here rather than at the callback, so a hostile value never reaches storage. 404 when this deployment has no GitHub App configured.
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X POST 'https://neosource.dev/api/github/app/installations/consent' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{}'fetch
fetch("https://neosource.dev/api/github/app/installations/consent", {
method: "POST",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});Request bodyrequired
application/json
Responses
200Where to send the browser
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget