Set the fine-grained personal access token that reads repos and opens pull requests.
const url = 'https://example.com/api/v1/admin/github';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"token":"example","api_url":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/admin/github \ --header 'Content-Type: application/json' \ --data '{ "token": "example", "api_url": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”object
The GitHub API. The default is https://api.github.com. GitHub Enterprise Server uses https://
Examplegenerated
{ "token": "example", "api_url": "example"}Responses
Section titled “ Responses ”The connection, after a check with GitHub.
The one GitHub connection of the workspace, an App or a token, never both (docs/specs/github-app.md).
object
Whether this mode can create a GitHub App. Hosted mode only.
The workspace’s private GitHub App.
object
The org or the personal account that owns the App.
The App’s settings page on GitHub, where its owner deletes it.
The App comes from the SPECCY_GITHUB_APP_ variables, so the UI cannot change it.
What the installation lacks for pull request reviews and the other features, such as “checks: write” or “event issue_comment”. GitHub cannot change an existing App by API, so its owner adds them on the settings page.
The GitHub account of the token, from the last check.
Example
{ "kind": "none"}default
Section titled “default”An error.
RFC 9457 problem details with a stable code.
object
A stable machine-readable error code.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": "example"}