Link a GitHub organization or team (admin)
const url = 'https://example.com/v1/orgs/example/github';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"github_org":"example","team":"example","role":"viewer"}'};
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/v1/orgs/example/github \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "github_org": "example", "team": "example", "role": "viewer" }'People who sign in with GitHub and are active members of the GitHub organization (or team) join with the given role. When they leave on GitHub, they lose access at their next GitHub sign-in. Invited members are never removed by this.
The caller must be signed in with GitHub (a browser session), and GitHub must
have said at that sign-in that they are an admin of the GitHub organization;
otherwise 403 github.adminRequired. The link stores the organization’s
numeric ID (github_org_id) and GitHub’s spelling of its name; sign-in
matches by the ID. A github_org_id in the request is ignored.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization (tenant) slug, e.g. alpenrobotik
Request Bodyrequired
Section titled “Request Bodyrequired”object
GitHub organization name
GitHub’s numeric ID of the organization, set when an admin of it saves the link. Missing on links saved before verification existed: those grant nothing until an admin of the GitHub organization saves them again.
Team slug; members of only this team get access. Empty: the whole organization.
Role given to people who join through GitHub (never owner)
Responses
Section titled “Responses”Linked
object
GitHub organization name
GitHub’s numeric ID of the organization, set when an admin of it saves the link. Missing on links saved before verification existed: those grant nothing until an admin of the GitHub organization saves them again.
Team slug; members of only this team get access. Empty: the whole organization.
Role given to people who join through GitHub (never owner)
Example
{ "role": "viewer"}Invalid organization
Caller is not an admin, or not signed in with GitHub as an admin of that GitHub organization (github.adminRequired)
Over the operation’s rate-limit budget (x-affectra-budget): code request.rateLimited with params.budget. Wait Retry-After seconds before trying again.
Every error answer, Content-Type
application/problem+json. The web app and integrations translate code; detail is English,
for people reading curl output or CI logs, and may change wording at
any time. Match on code, never on detail.
object
The HTTP status
Stable error codes. A code is never renamed; new ones may be added, so
a client falls back to detail for a code it doesn’t know. Another
organization’s object answers notFound, the same as a missing one.
What went wrong
Values the code’s message needs, e.g. {“field”: “version”}. Only values the caller sent or may see. Empty when the message needs none.
object
Example
{ "code": "notFound"}Headers
Section titled “Headers”Seconds until a request would be allowed again, at least 1