GitHub v3 REST API

List public keys

get
{protocol}://{hostname}/api/v3/admin/keys

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

directionstring

One of asc (ascending) or desc (descending).

Allowed values:ascdesc

Default:desc

sortstring

Allowed values:createdupdatedaccessed

Default:created

sincestring

Only show public keys accessed after the given time.

Response

200 application/json

Response

idintegerrequired
keystringrequired
user_idinteger | nullrequired
repository_idinteger | nullrequired
urlstringrequired
titlestringrequired
read_onlybooleanrequired
verifiedbooleanrequired
created_atstring(date-time)required
last_usedstring | null(date-time)required
get/admin/keys
 
200 application/json

Delete a public key

delete
{protocol}://{hostname}/api/v3/admin/keys/{key_ids}

Path Parameters

key_idsstringrequired

Response

204

Response

delete/admin/keys/{key_ids}
 
204

Update LDAP mapping for a team

Updates the distinguished name (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the Create a team endpoint to create a team with LDAP mapping.

If you pass the hellcat-preview media type, you can also update the LDAP mapping of a child team.

patch
{protocol}://{hostname}/api/v3/admin/ldap/teams/{team_id}/mapping

Path Parameters

team_idintegerrequired

Body

application/json
ldap_dnstringrequired

The distinguished name (DN) of the LDAP entry to map to a team.

Response

200 application/json

Response

ldap-mapping-team

ldap_dnstring
idinteger
node_idstring
urlstring
html_urlstring
namestring
slugstring
descriptionstring | null
privacystring
permissionstring
members_urlstring
repositories_urlstring
parent
patch/admin/ldap/teams/{team_id}/mapping

Body

{ "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com" }
 
200 application/json

Sync LDAP mapping for a team

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

post
{protocol}://{hostname}/api/v3/admin/ldap/teams/{team_id}/sync

Path Parameters

team_idintegerrequired

Response

201 application/json

Response

statusstring
post/admin/ldap/teams/{team_id}/sync
 
201 application/json

Update LDAP mapping for a user

patch
{protocol}://{hostname}/api/v3/admin/ldap/users/{username}/mapping

Path Parameters

usernamestringrequired

Body

application/json
ldap_dnstringrequired

The distinguished name (DN) of the LDAP entry to map to a team.

Response

200 application/json

Response

Ldap Private User

Ldap Private User

ldap_dnstring
loginstringrequired

Example:octocat

idintegerrequired

Example:1

node_idstringrequired

Example:MDQ6VXNlcjE=

avatar_urlstring(uri)required

Example:https://github.com/images/error/octocat_happy.gif

gravatar_idstring | nullrequired

Example:41d064eb2195891e12d0413f63227ea7

urlstring(uri)required

Example:https://api.github.com/users/octocat

html_urlstring(uri)required

Example:https://github.com/octocat

followers_urlstring(uri)required

Example:https://api.github.com/users/octocat/followers

following_urlstringrequired

Example:https://api.github.com/users/octocat/following{/other_user}

gists_urlstringrequired

Example:https://api.github.com/users/octocat/gists{/gist_id}

starred_urlstringrequired

Example:https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_urlstring(uri)required

Example:https://api.github.com/users/octocat/subscriptions

organizations_urlstring(uri)required

Example:https://api.github.com/users/octocat/orgs

repos_urlstring(uri)required

Example:https://api.github.com/users/octocat/repos

events_urlstringrequired

Example:https://api.github.com/users/octocat/events{/privacy}

received_events_urlstring(uri)required

Example:https://api.github.com/users/octocat/received_events

typestringrequired

Example:User

site_adminbooleanrequired
namestring | nullrequired

Example:monalisa octocat

companystring | nullrequired

Example:GitHub

blogstring | nullrequired

Example:https://github.com/blog

locationstring | nullrequired

Example:San Francisco

emailstring | null(email)required

Example:octocat@github.com

hireableboolean | nullrequired
biostring | nullrequired

Example:There once was...

twitter_usernamestring | null

Example:monalisa

public_reposintegerrequired

Example:2

public_gistsintegerrequired

Example:1

followersintegerrequired

Example:20

followingintegerrequired

Example:0

created_atstring(date-time)required

Example:2008-01-14T04:33:35Z

updated_atstring(date-time)required

Example:2008-01-14T04:33:35Z

private_gistsintegerrequired

Example:81

total_private_reposintegerrequired

Example:100

owned_private_reposintegerrequired

Example:100

disk_usageintegerrequired

Example:10000

collaboratorsintegerrequired

Example:8

two_factor_authenticationbooleanrequired

Example:true

planobject
Show Child Parameters
suspended_atstring | null(date-time)
business_plusboolean
patch/admin/ldap/users/{username}/mapping

Body

{ "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com" }
 
200 application/json