Skip to main content

social_accounts

Creates, updates, deletes, gets or lists a social_accounts resource.

Overview​

Namesocial_accounts
TypeResource
Idgithub.users.social_accounts

Fields​

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
providerstring (example: linkedin)
urlstring (example: https://www.linkedin.com/company/github/)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_social_accounts_for_userselectusernameper_page, pageLists social media accounts for a user. This endpoint is accessible by anyone.
list_social_accounts_for_authenticated_userselectper_page, pageLists all of your social accounts.
add_social_account_for_authenticated_userinsertaccount_urlsAdd one or more social accounts to the authenticated user's profile.

OAuth app tokens and personal access tokens (classic) need the user scope to use this endpoint.
delete_social_account_for_authenticated_userdeleteDeletes one or more social accounts from the authenticated user's profile.

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.

NameDatatypeDescription
usernamestringThe handle for the GitHub user account.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples​

Lists social media accounts for a user. This endpoint is accessible by anyone.

SELECT
provider,
url
FROM github.users.social_accounts
WHERE username = '{{ username }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

INSERT examples​

Add one or more social accounts to the authenticated user's profile.

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

INSERT INTO github.users.social_accounts (
account_urls
)
SELECT
'{{ account_urls }}' /* required */
RETURNING
provider,
url
;

DELETE examples​

Deletes one or more social accounts from the authenticated user's profile.

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

DELETE FROM github.users.social_accounts
;