Use the REST API to manage email addresses of authenticated users.
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.
PATCH /user/email/visibility
Sets the visibility for your primary email addresses.
accept (string)application/vnd.github+json is recommended.visibility (string) (required)public, private200 - OK
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PATCH \
https://api.github.com/user/email/visibility \
-d '{
"visibility": "private"
}'
Response schema (Status: 200):
Array of Email:
email: required, string, format: emailprimary: required, booleanverified: required, booleanvisibility: required, string or nullGET /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.
accept (string)application/vnd.github+json is recommended.per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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.
POST /user/emails
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.emails (array of strings) (required)201 - Created
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
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 /user/emails
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.emails (array of strings) (required)204 - No Content
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X DELETE \
https://api.github.com/user/emails \
-d '{
"emails": [
"octocat@github.com",
"mona@github.com"
]
}'
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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.