If your GitHub Enterprise Server instance has LDAP Sync enabled and the option to synchronize emails enabled, this API is disabled and will return a 403 response. Users managed in LDAP won't be able to add or delete an email address via the API with these options enabled.
This endpoint is accessible with the user scope.
POST /user/emails
| Name | Type | Description |
|---|---|---|
emails |
array of strings
|
Required. Adds one or more email addresses to your GitHub Enterprise 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. |
{
"emails": ["octocat@github.com", "support@github.com"]
}
Status: 201 Created
[
{
"email": "octocat@octocat.org",
"primary": false,
"verified": false,
"visibility": "public"
},
{
"email": "octocat@github.com",
"primary": false,
"verified": false,
"visibility": null
},
{
"email": "support@github.com",
"primary": false,
"verified": false,
"visibility": null
}
]