Interact with and view information about users and also current user.
47 endpoints tagged users, each listing its
parameters and possible responses. Search or scroll the index below to
jump to a specific endpoint.
No endpoints match your search.
GET /user
OAuth app tokens and personal access tokens (classic) need the user scope in order for the response to include private profile information.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
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.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /user/blocks
List the users you've blocked on your personal account.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/blocks/{username}
Returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | If the user is blocked | no |
| 404 | If the user is not blocked | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
PUT /user/blocks/{username}
Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
DELETE /user/blocks/{username}
Unblocks the given user and returns a 204.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
| 404 | Resource not found | yes |
PATCH /user/email/visibility
Sets the visibility for your primary email addresses.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /user/emails
Lists all of your email addresses, and specifies which one is visible
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
POST /user/emails
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
DELETE /user/emails
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /user/followers
Lists the people following the authenticated user.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/following
Lists the people who the authenticated user follows.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/following/{username}
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | if the person is followed by the authenticated user | no |
| 404 | if the person is not followed by the authenticated user | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
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."
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
DELETE /user/following/{username}
OAuth app tokens and personal access tokens (classic) need the user:follow scope to use this endpoint.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/gpg_keys
Lists the current user's GPG keys.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
POST /user/gpg_keys
Adds a GPG key to the authenticated user's GitHub account.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/gpg_keys/{gpg_key_id}
View extended details for a single GPG key.
| Name | In | Required | Description |
|---|---|---|---|
gpg_key_id | path | yes | The unique identifier of the GPG key. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
DELETE /user/gpg_keys/{gpg_key_id}
Removes a GPG key from the authenticated user's GitHub account.
| Name | In | Required | Description |
|---|---|---|---|
gpg_key_id | path | yes | The unique identifier of the GPG key. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 404 | Resource not found | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/keys
Lists the public SSH keys for the authenticated user's GitHub account.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
POST /user/keys
Adds a public SSH key to the authenticated user's GitHub account.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/keys/{key_id}
View extended details for a single public SSH key.
| Name | In | Required | Description |
|---|---|---|---|
key_id | path | yes | The unique identifier of the key. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
DELETE /user/keys/{key_id}
Removes a public SSH key from the authenticated user's GitHub account.
| Name | In | Required | Description |
|---|---|---|---|
key_id | path | yes | The unique identifier of the key. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/public_emails
Lists your publicly visible email address, which you can set with the
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/ssh_signing_keys
Lists the SSH signing keys for the authenticated user's GitHub account.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
POST /user/ssh_signing_keys
Creates an SSH signing key for the authenticated user's GitHub account.
No parameters.
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/ssh_signing_keys/{ssh_signing_key_id}
Gets extended details for an SSH signing key.
| Name | In | Required | Description |
|---|---|---|---|
ssh_signing_key_id | path | yes | The unique identifier of the SSH signing key. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
DELETE /user/ssh_signing_keys/{ssh_signing_key_id}
Deletes an SSH signing key from the authenticated user's GitHub account.
| Name | In | Required | Description |
|---|---|---|---|
ssh_signing_key_id | path | yes | The unique identifier of the SSH signing key. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 304 | Not modified | no |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 401 | Requires authentication | yes |
GET /user/{account_id}
Provides publicly available information about someone with a GitHub account. This method takes their durable user ID instead of their login, which can change over time.
| Name | In | Required | Description |
|---|---|---|---|
account_id | path | yes | account_id parameter |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
GET /users
Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.
| Name | In | Required | Description |
|---|---|---|---|
since | query | no | A user ID. Only return users with an ID greater than this ID. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
GET /users/{username}
Provides publicly available information about someone with a GitHub account.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
POST /users/{username}/attestations/bulk-list
List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
before | query | no | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after | query | no | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
POST /users/{username}/attestations/delete-request
Delete artifact attestations in bulk by either subject digests or unique ID.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | no |
| 404 | Resource not found | yes |
DELETE /users/{username}/attestations/digest/{subject_digest}
Delete an artifact attestation by subject digest.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
subject_digest | path | yes | Subject Digest |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | no |
| 204 | Response | no |
| 404 | Resource not found | yes |
DELETE /users/{username}/attestations/{attestation_id}
Delete an artifact attestation by unique ID that is associated with a repository owned by a user.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
attestation_id | path | yes | Attestation ID |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | no |
| 204 | Response | no |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /users/{username}/attestations/{subject_digest}
List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.
| Name | In | Required | Description |
|---|---|---|---|
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
before | query | no | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after | query | no | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
username | path | yes | The handle for the GitHub user account. |
subject_digest | path | yes | Subject Digest |
predicate_type | query | no | Optional filter for fetching attestations with a given predicate type. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 201 | Response | yes |
| 204 | Response | no |
| 404 | Resource not found | yes |
GET /users/{username}/followers
Lists the people following the specified user.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /users/{username}/following
Lists the people who the specified user follows.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /users/{username}/following/{target_user}
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
target_user | path | yes |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | if the user follows the target user | no |
| 404 | if the user does not follow the target user | no |
GET /users/{username}/gpg_keys
Lists the GPG keys for a user. This information is accessible by anyone.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /users/{username}/hovercard
Provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
subject_type | query | no | Identifies which additional information you'd like to receive about the person's hovercard. Can be organization, repository, issue, pull_request. Required when using subject_id. |
subject_id | query | no | Uses the ID for the subject_type you specified. Required when using subject_type. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
GET /users/{username}/keys
Lists the _verified_ public SSH keys for a user. This is accessible by anyone.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /users/{username}/ssh_signing_keys
Lists the SSH signing keys for a user. This operation is accessible by anyone.
| Name | In | Required | Description |
|---|---|---|---|
username | path | yes | The handle for the GitHub user account. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
page | query | no | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |