REST API endpoints for emails

Use the REST API to manage email addresses of authenticated users.

About email administration

If a request URL does not include a {username} parameter then the response will be for the signed-in user (and you must pass authentication information with your request). Additional private information, such as whether a user has two-factor authentication enabled, is included when authenticated through OAuth with the user scope.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Set primary email visibility for the authenticated user

PATCH /user/email/visibility

Sets the visibility for your primary email addresses.

Parameters

Headers

Body parameters

HTTP response status codes

Code examples

Example setting the primary email address to private

Request:

curl -L \
  -X PATCH \
  https://api.github.com/user/email/visibility \
  -d '{
  "visibility": "private"
}'

Response schema (Status: 200):

Array of Email:

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.
OAuth app tokens and personal access tokens (classic) need the user:email scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/emails

Response schema (Status: 200):

Same response schema as Set primary email visibility for the authenticated user.

Add an email address for the authenticated user

POST /user/emails

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.

Parameters

Headers

Body parameters

HTTP response status codes

Code examples

Example adding multiple email addresses

Request:

curl -L \
  -X POST \
  https://api.github.com/user/emails \
  -d '{
  "emails": [
    "octocat@github.com",
    "mona@github.com",
    "octocat@octocat.org"
  ]
}'

Response schema (Status: 201):

Same response schema as Set primary email visibility for the authenticated user.

Delete an email address for the authenticated user

DELETE /user/emails

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.

Parameters

Headers

Body parameters

HTTP response status codes

Code examples

Example deleting multiple email accounts

Request:

curl -L \
  -X DELETE \
  https://api.github.com/user/emails \
  -d '{
  "emails": [
    "octocat@github.com",
    "mona@github.com"
  ]
}'

Response schema (Status: 204):

List public email addresses for the authenticated user

GET /user/public_emails

Lists your publicly visible email address, which you can set with the
Set primary email visibility for the authenticated user
endpoint.
OAuth app tokens and personal access tokens (classic) need the user:email scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/public_emails

Response schema (Status: 200):

Same response schema as Set primary email visibility for the authenticated user.