Set the fine-grained personal access token that reads repos and opens pull requests.
PUT
/admin/github
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”Media typeapplication/json
object
token
required
string
api_url
The GitHub API. The default is https://api.github.com. GitHub Enterprise Server uses https://
string
Examplegenerated
{ "token": "example", "api_url": "example"}Responses
Section titled “ Responses ”The connection, after a check with GitHub.
Media typeapplication/json
object
configured
required
boolean
token_last4
string
api_url
required
string
login
The GitHub account of the token, from the last check.
string
Examplegenerated
{ "configured": true, "token_last4": "example", "api_url": "example", "login": "example"}default
Section titled “default”An error.
Media typeapplication/problem+json
RFC 9457 problem details with a stable code.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
code
required
A stable machine-readable error code.
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": "example"}