A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.github.com/en/enterprise-cloud@latest/rest/users/emails below:

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.

Set primary email visibility for the authenticated user Code samples for "Set primary email visibility for the authenticated user"

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Request example

patch/user/email/visibility

Copy to clipboard curl request example

curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/email/visibility \ -d '{"visibility":"private"}'

Response

Status: 200

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

List email addresses for the authenticated user Code samples for "List email addresses for the authenticated user"

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Request example

Copy to clipboard curl request example

curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/emails

Response

Status: 200

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

Add an email address for the authenticated user Code samples for "Add an email address for the authenticated user"

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Request example

Copy to clipboard curl request example

curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/emails \ -d '{"emails":["octocat@github.com","mona@github.com","octocat@octocat.org"]}'

Response

Status: 201

[ { "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 } ]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4