Account, keys and webhooks ›
Connect git hub installation
POST
/v1/github/installationsConnect git hub installation.
Requestcurl
- curl -X POST https://agental.io/v1/github/installations \
- -H "Authorization: Bearer $AGENTAL_API_KEY" \
- -H "Content-Type: application/json" \
- -d '{"installationId":1,"code":"…","state":"…"}'
Answer200 OK · GitHubInstallation
- {
- "installationId": integer,
- "account": string,
- "accountType": string,
- "connectedAt": string,
- "repositorySelection": "all" | "selected" | "null" | null,
- "repositories": string[] | null,
- "manageUrl": string,
- }
The installation is the organization's.
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
installationIdrequiredinteger | installation_id, as GitHub sent the browser back with it. |
coderequiredstring | code, the person's GitHub sign-in, as GitHub sent the browser back with it. |
staterequiredstring | state, as POST /v1/github/connect gave it and GitHub sent it back. |
Returns
200 The installation is the organization's.
GitHubInstallation7 fields
installationIdinteger
accountstring
The GitHub user or organization the App is installed on.
accountTypestring
User or Organization.
connectedAtstring
repositorySelectionallselectednullnull
Whether the App may use all the account's repositories or those chosen.
More
Null where GitHub did not say.repositoriesstring[]null
The repositories the App may use, by full name.
More
Null where GitHub did not say.manageUrlstring
Where on GitHub the repositories it may use are changed, or the App uninstalled.
Errors and other answers
| 400 | github_state_invalid the state is not one given to this person, it ran out, or it was used. |
| 400 | github_code_invalid GitHub did not take the sign-in. |
| 403 | session_required, or |
| 403 | forbidden only an owner or an admin. |
| 403 | github_installation_unreachable GitHub says the person who signed in does not reach that installation. |
| 403 | github_not_admin they reach it, but are not the account it is on, or an admin of that GitHub organization. |
| 409 | github_not_available, or |
| 409 | installation_taken it is connected to another organization. |
| 503 | github_unavailable GitHub did not answer. Connect again in a minute. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.