Interact with and view information about users and also current user.

Get the authenticated user

get /user

If the authenticated user is authenticated with an OAuth token with the user scope, then the response lists public and private profile information.

If the authenticated user is authenticated through OAuth without the user scope, then the response lists only public profile information.

Response

Examples Schema

Response

{
  "login": "octocat",
  "id": 1,
  "node_id": "MDQ6VXNlcjE=",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "octocat@github.com",
  "hireable": false,
  "bio": "There once was...",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z",
  "private_gists": 81,
  "total_private_repos": 100,
  "owned_private_repos": 100,
  "disk_usage": 10000,
  "collaborators": 8,
  "two_factor_authentication": true,
  "plan": {
    "name": "Medium",
    "space": 400,
    "private_repos": 20,
    "collaborators": 0
  }
}
{
  "login": "octocat",
  "id": 1,
  "node_id": "MDQ6VXNlcjE=",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "octocat@github.com",
  "hireable": false,
  "bio": "There once was...",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z"
}

Not modified

Empty response

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

One Of

Private User

object (Private User)

Private User

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

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

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

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

following_url

string

required

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

gists_url

string

required

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

starred_url

string

required

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

subscriptions_url

string

uri

required

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

organizations_url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

required

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

received_events_url

string

uri

required

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

type

string

required

Example
"User"

site_admin

boolean

required

name

string or null

required

Example
"monalisa octocat"

company

string or null

required

Example
"GitHub"

blog

string or null

required

Example
"https://github.com/blog"

location

string or null

required

Example
"San Francisco"

email

string or null

email

required

Example
"octocat@github.com"

hireable

boolean or null

required

bio

string or null

required

Example
"There once was..."

twitter_username

string or null

Example
"monalisa"

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

created_at

string

date-time

required

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

updated_at

string

date-time

required

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

private_gists

int

required

Example
81

total_private_repos

int

required

Example
100

owned_private_repos

int

required

Example
100

disk_usage

int

required

Example
10000

collaborators

int

required

Example
8

two_factor_authentication

boolean

required

Example
true

plan

object (plan)

collaborators

int

required

name

string

required

space

int

required

private_repos

int

required

suspended_at

string or null

date-time

business_plus

boolean

ldap_dn

string

Public User

object (Public User)

Public User

login

string

required

id

int

required

node_id

string

required

avatar_url

string

uri

required

gravatar_id

string or null

required

url

string

uri

required

html_url

string

uri

required

followers_url

string

uri

required

following_url

string

required

gists_url

string

required

starred_url

string

required

subscriptions_url

string

uri

required

organizations_url

string

uri

required

repos_url

string

uri

required

events_url

string

required

received_events_url

string

uri

required

type

string

required

site_admin

boolean

required

name

string or null

required

company

string or null

required

blog

string or null

required

location

string or null

required

email

string or null

email

required

hireable

boolean or null

required

bio

string or null

required

twitter_username

string or null

public_repos

int

required

public_gists

int

required

followers

int

required

following

int

required

created_at

string

date-time

required

updated_at

string

date-time

required

plan

object (plan)

collaborators

int

required

name

string

required

space

int

required

private_repos

int

required

suspended_at

string or null

date-time

private_gists

int

Example
1

total_private_repos

int

Example
2

owned_private_repos

int

Example
2

disk_usage

int

Example
1

collaborators

int

Example
3

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Update the authenticated user

patch /user

Note: If your email is set to private and you send an email parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.

name

string

The new name of the user.

Example
"Omar Jahandar"

email

string

The publicly visible email address of the user.

Example
"omar@example.com"

blog

string

The new blog URL of the user.

Example
"blog.example.com"

twitter_username

string or null

The new Twitter username of the user.

Example
"therealomarj"

company

string

The new company of the user.

Example
"Acme corporation"

location

string

The new location of the user.

Example
"Berlin, Germany"

hireable

boolean

The new hiring availability of the user.

bio

string

The new short biography of the user.

Request

{
  "blog": "https://github.com/blog",
  "name": "monalisa octocat"
}

Response

Examples Schema

Response

{
  "login": "octocat",
  "id": 1,
  "node_id": "MDQ6VXNlcjE=",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "octocat@github.com",
  "hireable": false,
  "bio": "There once was...",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z",
  "private_gists": 81,
  "total_private_repos": 100,
  "owned_private_repos": 100,
  "disk_usage": 10000,
  "collaborators": 8,
  "two_factor_authentication": true,
  "plan": {
    "name": "Medium",
    "space": 400,
    "private_repos": 20,
    "collaborators": 0
  }
}

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

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

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

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

following_url

string

required

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

gists_url

string

required

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

starred_url

string

required

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

subscriptions_url

string

uri

required

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

organizations_url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

required

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

received_events_url

string

uri

required

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

type

string

required

Example
"User"

site_admin

boolean

required

name

string or null

required

Example
"monalisa octocat"

company

string or null

required

Example
"GitHub"

blog

string or null

required

Example
"https://github.com/blog"

location

string or null

required

Example
"San Francisco"

email

string or null

email

required

Example
"octocat@github.com"

hireable

boolean or null

required

bio

string or null

required

Example
"There once was..."

twitter_username

string or null

Example
"monalisa"

public_repos

int

required

Example
2

public_gists

int

required

Example
1

followers

int

required

Example
20

following

int

required

Example
0

created_at

string

date-time

required

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

updated_at

string

date-time

required

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

private_gists

int

required

Example
81

total_private_repos

int

required

Example
100

owned_private_repos

int

required

Example
100

disk_usage

int

required

Example
10000

collaborators

int

required

Example
8

two_factor_authentication

boolean

required

Example
true

plan

object (plan)

collaborators

int

required

name

string

required

space

int

required

private_repos

int

required

suspended_at

string or null

date-time

business_plus

boolean

ldap_dn

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

List email addresses for the authenticated user

get /user/emails

Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the user:email scope.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "email": "octocat@github.com",
    "verified": true,
    "primary": true,
    "visibility": "public"
  }
]

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

array[object (Email)]

Email

object (Email)

Email

email

string

email

required

Example
"octocat@github.com"

primary

boolean

required

Example
true

verified

boolean

required

Example
true

visibility

string or null

required

Example
"public"

Link

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Add an email address for the authenticated user

post /user/emails

This endpoint is accessible with the user scope.

One Of

object

Example
{ "emails": [ "octocat@github.com", "mona@github.com" ] }

emails

array[string]

required

Adds one or more email addresses to your GitHub account. Must contain at least one email address. Note: Alternatively, you can pass a single email address or an array of emails addresses directly, but we recommend that you pass an object using the emails key.

Example
[]

string

Example
"username@example.com"

array[string]

string

Example
"username@example.com"

string

Request

{
  "emails": [
    "octocat@github.com",
    "mona@github.com",
    "octocat@octocat.org"
  ]
}

Response

Examples Schema

Response

[
  {
    "email": "octocat@octocat.org",
    "primary": false,
    "verified": false,
    "visibility": "public"
  },
  {
    "email": "octocat@github.com",
    "primary": false,
    "verified": false,
    "visibility": null
  },
  {
    "email": "mona@github.com",
    "primary": false,
    "verified": false,
    "visibility": null
  }
]

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

array[object (Email)]

Email

object (Email)

Email

email

string

email

required

Example
"octocat@github.com"

primary

boolean

required

Example
true

verified

boolean

required

Example
true

visibility

string or null

required

Example
"public"

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Delete an email address for the authenticated user

delete /user/emails

This endpoint is accessible with the user scope.

One Of

object

Deletes one or more email addresses from your GitHub account. Must contain at least one email address. Note: Alternatively, you can pass a single email address or an array of emails addresses directly, but we recommend that you pass an object using the emails key.

Example
{ "emails": [ "octocat@github.com", "mona@github.com" ] }

emails

array[string]

required

Email addresses associated with the GitHub user account.

string

Example
"username@example.com"

array[string]

string

Example
"username@example.com"

string

Request

{
  "emails": [
    "octocat@github.com",
    "mona@github.com"
  ]
}

Response

Examples Schema

Response

Empty response

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

No schema

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

List followers of the authenticated user

get /user/followers

Lists the people following the authenticated user.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  }
]

Not modified

Empty response

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

array[object (Simple User)]

Simple User

object (Simple User)

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

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

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

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

following_url

string

required

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

gists_url

string

required

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

starred_url

string

required

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

subscriptions_url

string

uri

required

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

organizations_url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

required

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

received_events_url

string

uri

required

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

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

Link

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

List the people the authenticated user follows

get /user/following

Lists the people who the authenticated user follows.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  }
]

Not modified

Empty response

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

array[object (Simple User)]

Simple User

object (Simple User)

A GitHub user.

name

string or null

email

string or null

login

string

required

Example
"octocat"

id

int

required

Example
1

node_id

string

required

Example
"MDQ6VXNlcjE="

avatar_url

string

uri

required

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

gravatar_id

string or null

required

Example
"41d064eb2195891e12d0413f63227ea7"

url

string

uri

required

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

html_url

string

uri

required

Example
"https://github.com/octocat"

followers_url

string

uri

required

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

following_url

string

required

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

gists_url

string

required

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

starred_url

string

required

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

subscriptions_url

string

uri

required

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

organizations_url

string

uri

required

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

repos_url

string

uri

required

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

events_url

string

required

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

received_events_url

string

uri

required

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

type

string

required

Example
"User"

site_admin

boolean

required

starred_at

string

Example
"\"2020-07-09T00:17:55Z\""

Link

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

username

string

required

The handle for the GitHub user account.

Response

Examples Schema

if the person is followed by the authenticated user

Empty response

if the person is not followed by the authenticated user

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Not modified

Empty response

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

No schema

message

string

documentation_url

string

url

string

status

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Follow a user

put /user/following/{username}

Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope.

username

string

required

The handle for the GitHub user account.

Response

Examples Schema

Response

Empty response

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

No schema

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Unfollow a user

delete /user/following/{username}

Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow scope.

username

string

required

The handle for the GitHub user account.

Response

Examples Schema

Response

Empty response

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

No schema

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

List GPG keys for the authenticated user

get /user/gpg_keys

Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least read:gpg_key scope.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "id": 3,
    "name": "Octocat's GPG Key",
    "primary_key_id": 2,
    "key_id": "3262EFF25BA0D270",
    "public_key": "xsBNBFayYZ...",
    "emails": [
      {
        "email": "octocat@users.noreply.github.com",
        "verified": true
      }
    ],
    "subkeys": [
      {
        "id": 4,
        "primary_key_id": 3,
        "key_id": "4A595D4C72EE49C7",
        "public_key": "zsBNBFayYZ...",
        "emails": [],
        "can_sign": false,
        "can_encrypt_comms": true,
        "can_encrypt_storage": true,
        "can_certify": false,
        "created_at": "2016-03-24T11:31:04-06:00",
        "expires_at": "2016-03-24T11:31:04-07:00",
        "revoked": false
      }
    ],
    "can_sign": true,
    "can_encrypt_comms": false,
    "can_encrypt_storage": false,
    "can_certify": true,
    "created_at": "2016-03-24T11:31:04-06:00",
    "expires_at": "2016-03-24T11:31:04-07:00",
    "revoked": false,
    "raw_key": "string"
  }
]

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

array[object (GPG Key)]

GPG Key

object (GPG Key)

A unique encryption key

id

int

required

Example
3

name

string or null

Example
"Octocat's GPG Key"

primary_key_id

int or null

required

key_id

string

required

Example
"3262EFF25BA0D270"

public_key

string

required

Example
"xsBNBFayYZ..."

emails

array[object]

required

Example
[ { "email": "octocat@users.noreply.github.com", "verified": true } ]

object

email

string

verified

boolean

subkeys

array[object]

required

Example
[ { "id": 4, "primary_key_id": 3, "key_id": "4A595D4C72EE49C7", "public_key": "zsBNBFayYZ...", "emails": [], "can_sign": false, "can_encrypt_comms": true, "can_encrypt_storage": true, "can_certify": false, "created_at": "2016-03-24T11:31:04-06:00", "expires_at": null, "revoked": false } ]

object

id

int

primary_key_id

int

key_id

string

public_key

string

emails

array[object]

object

email

string

verified

boolean

subkeys

array[]

can_sign

boolean

can_encrypt_comms

boolean

can_encrypt_storage

boolean

can_certify

boolean

created_at

string

expires_at

string or null

raw_key

string or null

revoked

boolean

can_sign

boolean

required

Example
true

can_encrypt_comms

boolean

required

can_encrypt_storage

boolean

required

can_certify

boolean

required

Example
true

created_at

string

date-time

required

Example
"2016-03-24T11:31:04-06:00"

expires_at

string or null

date-time

required

revoked

boolean

required

Example
true

raw_key

string or null

required

Link

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Create a GPG key for the authenticated user

post /user/gpg_keys

Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least write:gpg_key scope.

name

string

A descriptive name for the new key.

armored_public_key

string

required

A GPG key in ASCII-armored format.

Request

{
  "name": "Octocat's GPG Key",
  "armored_public_key": "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: GnuPG v1\n\nmQINBFnZ2ZIBEADQ2Z7Z7\n-----END PGP PUBLIC KEY BLOCK-----"
}

Response

Examples Schema

Response

{
  "id": 3,
  "name": "Octocat's GPG Key",
  "primary_key_id": 2,
  "key_id": "3262EFF25BA0D270",
  "public_key": "xsBNBFayYZ...",
  "emails": [
    {
      "email": "octocat@users.noreply.github.com",
      "verified": true
    }
  ],
  "subkeys": [
    {
      "id": 4,
      "primary_key_id": 3,
      "key_id": "4A595D4C72EE49C7",
      "public_key": "zsBNBFayYZ...",
      "emails": [],
      "can_sign": false,
      "can_encrypt_comms": true,
      "can_encrypt_storage": true,
      "can_certify": false,
      "created_at": "2016-03-24T11:31:04-06:00",
      "expires_at": "2016-03-24T11:31:04-07:00",
      "revoked": false
    }
  ],
  "can_sign": true,
  "can_encrypt_comms": false,
  "can_encrypt_storage": false,
  "can_certify": true,
  "created_at": "2016-03-24T11:31:04-06:00",
  "expires_at": "2016-03-24T11:31:04-07:00",
  "revoked": false,
  "raw_key": "\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\nVersion: GnuPG v2\\n\\nmQENBFayYZ0BCAC4hScoJXXpyR+MXGcrBxElqw3FzCVvkViuyeko+Jp76QJhg8kr\\nucRTxbnOoHfda/FmilEa/wxf9ch5/PSrrL26FxEoPHhJolp8fnIDLQeITn94NYdB\\nZtnnEKslpPrG97qSUWIchvyqCPtvOb8+8fWvGx9K/ZWcEEdh1X8+WFR2jMENMeoX\\nwxHWQoPnS7LpX/85/M7VUcJxvDVfv+eHsnQupmE5bGarKNih0oMe3L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6sS764vV1rOioTTXkszzhClQqET7hPVnVQjenYgv0EZHNyQH/1f1\\n/CYqvV1vFjM9vJjMbxXsATCkZe6wvBVKD8vLsJAr8N+onKQz+4OPc3kmKq7aESu3\\nCi/iuie5KKVwnuNhr9AzT61vEkKxwHcVFEvHB77F6ZAAInhRvjzmQbD2dlPLLQCC\\nqDj71ODSSAPTEmUy6969bgD9PfWei7kNkBIx7s3eBv8yzytSc2EcuUgopqFazquw\\nFs1+tqGHjBvQfTo6bqbJjp/9Ci2pvde3ElV2rAgUlb3lqXyXjRDqrXosh5GcRPQj\\nK8Nhj1BNhnrCVskE4BP0LYbOHuzgm86uXwGCFsY+w2VOsSm16Jx5GHyG5S5WU3+D\\nIts/HFYRLiFgDLmTlxo=\\n=+OzK\\n-----END PGP PUBLIC KEY BLOCK-----\""
}

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

id

int

required

Example
3

name

string or null

Example
"Octocat's GPG Key"

primary_key_id

int or null

required

key_id

string

required

Example
"3262EFF25BA0D270"

public_key

string

required

Example
"xsBNBFayYZ..."

emails

array[object]

required

Example
[ { "email": "octocat@users.noreply.github.com", "verified": true } ]

object

email

string

verified

boolean

subkeys

array[object]

required

Example
[ { "id": 4, "primary_key_id": 3, "key_id": "4A595D4C72EE49C7", "public_key": "zsBNBFayYZ...", "emails": [], "can_sign": false, "can_encrypt_comms": true, "can_encrypt_storage": true, "can_certify": false, "created_at": "2016-03-24T11:31:04-06:00", "expires_at": null, "revoked": false } ]

object

id

int

primary_key_id

int

key_id

string

public_key

string

emails

array[object]

object

email

string

verified

boolean

subkeys

array[]

can_sign

boolean

can_encrypt_comms

boolean

can_encrypt_storage

boolean

can_certify

boolean

created_at

string

expires_at

string or null

raw_key

string or null

revoked

boolean

can_sign

boolean

required

Example
true

can_encrypt_comms

boolean

required

can_encrypt_storage

boolean

required

can_certify

boolean

required

Example
true

created_at

string

date-time

required

Example
"2016-03-24T11:31:04-06:00"

expires_at

string or null

date-time

required

revoked

boolean

required

Example
true

raw_key

string or null

required

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Get a GPG key for the authenticated user

get /user/gpg_keys/{gpg_key_id}

View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least read:gpg_key scope.

gpg_key_id

int

required

The unique identifier of the GPG key.

Response

Examples Schema

Response

{
  "id": 3,
  "name": "Octocat's GPG Key",
  "primary_key_id": 2,
  "key_id": "3262EFF25BA0D270",
  "public_key": "xsBNBFayYZ...",
  "emails": [
    {
      "email": "octocat@users.noreply.github.com",
      "verified": true
    }
  ],
  "subkeys": [
    {
      "id": 4,
      "primary_key_id": 3,
      "key_id": "4A595D4C72EE49C7",
      "public_key": "zsBNBFayYZ...",
      "emails": [],
      "can_sign": false,
      "can_encrypt_comms": true,
      "can_encrypt_storage": true,
      "can_certify": false,
      "created_at": "2016-03-24T11:31:04-06:00",
      "expires_at": "2016-03-24T11:31:04-07:00",
      "revoked": false
    }
  ],
  "can_sign": true,
  "can_encrypt_comms": false,
  "can_encrypt_storage": false,
  "can_certify": true,
  "created_at": "2016-03-24T11:31:04-06:00",
  "expires_at": "2016-03-24T11:31:04-07:00",
  "revoked": false,
  "raw_key": "\"-----BEGIN PGP PUBLIC KEY BLOCK-----\\nVersion: GnuPG v2\\n\\nmQENBFayYZ0BCAC4hScoJXXpyR+MXGcrB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\naZ3HFpgrFmFwmE10BKT4iQtoxELLM57z0qGOAfTsEjWFQa4sF+6IHAQR/ptkdkkI\\nBUEXiMnAwVwBysLIJiLO8qdjB6qp52QkT074JVrwywT/P+DkMfC2k4r/AfEbf6eF\\ndmPDuPk6KD87+hJZsSa5MaMUBQVvRO/mgEkhJRITVu58eWGaBOcQJ8gqurhCqM5P\\nDfUA4TJ7wiqM6sS764vV1rOioTTXkszzhClQqET7hPVnVQjenYgv0EZHNyQH/1f1\\n/CYqvV1vFjM9vJjMbxXsATCkZe6wvBVKD8vLsJAr8N+onKQz+4OPc3kmKq7aESu3\\nCi/iuie5KKVwnuNhr9AzT61vEkKxwHcVFEvHB77F6ZAAInhRvjzmQbD2dlPLLQCC\\nqDj71ODSSAPTEmUy6969bgD9PfWei7kNkBIx7s3eBv8yzytSc2EcuUgopqFazquw\\nFs1+tqGHjBvQfTo6bqbJjp/9Ci2pvde3ElV2rAgUlb3lqXyXjRDqrXosh5GcRPQj\\nK8Nhj1BNhnrCVskE4BP0LYbOHuzgm86uXwGCFsY+w2VOsSm16Jx5GHyG5S5WU3+D\\nIts/HFYRLiFgDLmTlxo=\\n=+OzK\\n-----END PGP PUBLIC KEY BLOCK-----\""
}

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Not modified

Empty response

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

id

int

required

Example
3

name

string or null

Example
"Octocat's GPG Key"

primary_key_id

int or null

required

key_id

string

required

Example
"3262EFF25BA0D270"

public_key

string

required

Example
"xsBNBFayYZ..."

emails

array[object]

required

Example
[ { "email": "octocat@users.noreply.github.com", "verified": true } ]

object

email

string

verified

boolean

subkeys

array[object]

required

Example
[ { "id": 4, "primary_key_id": 3, "key_id": "4A595D4C72EE49C7", "public_key": "zsBNBFayYZ...", "emails": [], "can_sign": false, "can_encrypt_comms": true, "can_encrypt_storage": true, "can_certify": false, "created_at": "2016-03-24T11:31:04-06:00", "expires_at": null, "revoked": false } ]

object

id

int

primary_key_id

int

key_id

string

public_key

string

emails

array[object]

object

email

string

verified

boolean

subkeys

array[]

can_sign

boolean

can_encrypt_comms

boolean

can_encrypt_storage

boolean

can_certify

boolean

created_at

string

expires_at

string or null

raw_key

string or null

revoked

boolean

can_sign

boolean

required

Example
true

can_encrypt_comms

boolean

required

can_encrypt_storage

boolean

required

can_certify

boolean

required

Example
true

created_at

string

date-time

required

Example
"2016-03-24T11:31:04-06:00"

expires_at

string or null

date-time

required

revoked

boolean

required

Example
true

raw_key

string or null

required

message

string

documentation_url

string

url

string

status

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

Delete a GPG key for the authenticated user

delete /user/gpg_keys/{gpg_key_id}

Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:gpg_key scope.

gpg_key_id

int

required

The unique identifier of the GPG key.

Response

Examples Schema

Response

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Validation failed, or the endpoint has been spammed.

{
  "message": "string",
  "documentation_url": "string",
  "errors": [
    {
      "resource": "string",
      "field": "string",
      "message": "string",
      "code": "string",
      "index": 123,
      "value": "string"
    }
  ]
}

Not modified

Empty response

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

No schema

message

string

documentation_url

string

url

string

status

string

message

string

required

documentation_url

string

required

errors

array[object]

object

resource

string

field

string

message

string

code

string

required

index

int

value

One Of

string or null

int or null

array[string] or null

string

No schema

message

string

documentation_url

string

url

string

status

string

message

string

documentation_url

string

url

string

status

string

List public SSH keys for the authenticated user

get /user/keys

Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least read:public_key scope.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

Examples Schema

Response

[
  {
    "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234",
    "id": 2,
    "url": "https://api.github.com/user/keys/2",
    "title": "ssh-rsa AAAAB3NzaC1yc2EAAA",
    "created_at": "2020-06-11T21:31:57Z",
    "verified": false,
    "read_only": false
  },
  {
    "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJy931234",
    "id": 3,
    "url": "https://api.github.com/user/keys/3",
    "title": "ssh-rsa AAAAB3NzaC1yc2EAAB",
    "created_at": "2020-07-11T21:31:57Z",
    "verified": false,
    "read_only": false
  }
]

Not modified

Empty response

Resource not found

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Forbidden

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",
  "status": "string"
}

Requires authentication

{
  "message": "string",
  "documentation_url": "string",
  "url": "string",