curl -X POST "https://app.runtm.com/api/github-app/authorize" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{
"code": "abc123def456",
"redirect_uri": "https://app.runtm.com/api/github/callback"
}'
import requests
resp = requests.post(
"https://app.runtm.com/api/github-app/authorize",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"code": "abc123def456",
"redirect_uri": "https://app.runtm.com/api/github/callback",
},
)
print(resp.json())
const resp = await fetch("https://app.runtm.com/api/github-app/authorize", {
method: "POST",
headers: {
Authorization: "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
code: "abc123def456",
redirect_uri: "https://app.runtm.com/api/github/callback",
}),
});
const data = await resp.json();
{
"username": "octocat",
"avatar_url": "https://avatars.githubusercontent.com/u/583231",
"email": "[email protected]"
}
GitHub User Tokens
Authorize
Exchange an OAuth code for a GitHub user token.
POST
/
api
/
github-app
/
authorize
curl -X POST "https://app.runtm.com/api/github-app/authorize" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{
"code": "abc123def456",
"redirect_uri": "https://app.runtm.com/api/github/callback"
}'
import requests
resp = requests.post(
"https://app.runtm.com/api/github-app/authorize",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"code": "abc123def456",
"redirect_uri": "https://app.runtm.com/api/github/callback",
},
)
print(resp.json())
const resp = await fetch("https://app.runtm.com/api/github-app/authorize", {
method: "POST",
headers: {
Authorization: "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
code: "abc123def456",
redirect_uri: "https://app.runtm.com/api/github/callback",
}),
});
const data = await resp.json();
{
"username": "octocat",
"avatar_url": "https://avatars.githubusercontent.com/u/583231",
"email": "[email protected]"
}
Exchanges a GitHub OAuth authorization code for user-level access and refresh tokens. The tokens are encrypted and stored server-side. Returns the authenticated GitHub user’s profile info.
Required scope:
integrations:write
string
required
OAuth authorization code from the GitHub callback.
string
required
The redirect URI used in the OAuth flow.
string
required
GitHub username.
string
GitHub avatar URL.
string
GitHub email address.
curl -X POST "https://app.runtm.com/api/github-app/authorize" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{
"code": "abc123def456",
"redirect_uri": "https://app.runtm.com/api/github/callback"
}'
import requests
resp = requests.post(
"https://app.runtm.com/api/github-app/authorize",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"code": "abc123def456",
"redirect_uri": "https://app.runtm.com/api/github/callback",
},
)
print(resp.json())
const resp = await fetch("https://app.runtm.com/api/github-app/authorize", {
method: "POST",
headers: {
Authorization: "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
code: "abc123def456",
redirect_uri: "https://app.runtm.com/api/github/callback",
}),
});
const data = await resp.json();
{
"username": "octocat",
"avatar_url": "https://avatars.githubusercontent.com/u/583231",
"email": "[email protected]"
}