orgs_for_user
Creates, updates, deletes, gets or lists an orgs_for_user resource.
Overview
| Name | orgs_for_user |
| Type | Resource |
| Id | github.orgs.orgs_for_user |
Fields
The following fields are returned by SELECT queries:
- list_for_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
node_id | string | (example: MDEyOk9yZ2FuaXphdGlvbjE=) |
avatar_url | string | (example: https://github.com/images/error/octocat_happy.gif) |
description | string | (example: A great organization) |
events_url | string (uri) | (example: https://api.github.com/orgs/github/events) |
hooks_url | string | (example: https://api.github.com/orgs/github/hooks) |
issues_url | string | (example: https://api.github.com/orgs/github/issues) |
login | string | (example: github) |
members_url | string | (example: https://api.github.com/orgs/github/members{/member}) |
public_members_url | string | (example: https://api.github.com/orgs/github/public_members{/member}) |
repos_url | string (uri) | (example: https://api.github.com/orgs/github/repos) |
url | string (uri) | (example: https://api.github.com/orgs/github) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_for_authenticated_user | select | per_page, page | 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. |
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_for_authenticated_user
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 }}'
;