emails
Creates, updates, deletes, gets or lists an emails resource.
Overview
| Name | emails |
| Type | Resource |
| Id | github.users.emails |
Fields
The following fields are returned by SELECT queries:
- list_emails_for_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
email | string (email) | (example: octocat@github.com) |
primary | boolean | |
verified | boolean | |
visibility | string | (example: public) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_emails_for_authenticated_user | select | per_page, page | 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. | |
add_email_for_authenticated_user | insert | emails | OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint. | |
set_primary_email_visibility_for_authenticated_user | update | visibility | Sets the visibility for your primary email addresses. | |
delete_email_for_authenticated_user | delete | OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_emails_for_authenticated_user
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.
SELECT
email,
primary,
verified,
visibility
FROM github.users.emails
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- add_email_for_authenticated_user
- Manifest
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
INSERT INTO github.users.emails (
emails
)
SELECT
'{{ emails }}' /* required */
RETURNING
email,
primary,
verified,
visibility
;
# Description fields are for documentation purposes
- name: emails
props:
- name: emails
value:
- "{{ emails }}"
description: |
Adds one or more email addresses to your GitHub 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.
UPDATE examples
- set_primary_email_visibility_for_authenticated_user
Sets the visibility for your primary email addresses.
UPDATE github.users.emails
SET
visibility = '{{ visibility }}'
WHERE
visibility = '{{ visibility }}' --required
RETURNING
email,
primary,
verified,
visibility;
DELETE examples
- delete_email_for_authenticated_user
OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
DELETE FROM github.users.emails
;