Skip to main content

orgs_for_user

Creates, updates, deletes, gets or lists an orgs_for_user resource.

Overview

Nameorgs_for_user
TypeResource
Idgithub.orgs.orgs_for_user

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
node_idstring (example: MDEyOk9yZ2FuaXphdGlvbjE=)
avatar_urlstring (example: https://github.com/images/error/octocat_happy.gif)
descriptionstring (example: A great organization)
events_urlstring (uri) (example: https://api.github.com/orgs/github/events)
hooks_urlstring (example: https://api.github.com/orgs/github/hooks)
issues_urlstring (example: https://api.github.com/orgs/github/issues)
loginstring (example: github)
members_urlstring (example: https://api.github.com/orgs/github/members{/member})
public_members_urlstring (example: https://api.github.com/orgs/github/public_members{/member})
repos_urlstring (uri) (example: https://api.github.com/orgs/github/repos)
urlstring (uri) (example: https://api.github.com/orgs/github)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_for_authenticated_userselectper_page, pageList organizations for the authenticated user.

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

> [!NOTE]
> Requests using a fine-grained access token will receive a 200 Success response with an empty list.

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
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

List organizations for the authenticated user.

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

> [!NOTE]
> Requests using a fine-grained access token will receive a 200 Success response with an empty list.

SELECT
id,
node_id,
avatar_url,
description,
events_url,
hooks_url,
issues_url,
login,
members_url,
public_members_url,
repos_url,
url
FROM github.orgs.orgs_for_user
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;