> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/g/github-organizations.md).

# Github Organizations

The Github Organizations adapter finds the organizations your token belongs to and reads their members. It adds profile details such as name, email and account creation date, and the organizations each member belongs to.

## Use cases

* List all members of your GitHub organizations.

```
Adapters = github-organizations
```

* Find GitHub members that have no Active Directory account.

```
Adapters = github-organizations AND NOT Adapters = active-directory
```

## Before you begin

### Network

| Source              | Destination                                          | Port | Protocol |
| ------------------- | ---------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | Host in the URL parameter (default `api.github.com`) | 443  | HTTPS    |

### Required permissions

| Scope or role | Permission                                          | Needed for                          |
| ------------- | --------------------------------------------------- | ----------------------------------- |
| Token         | Read access to organization memberships and members | Organizations and members           |
| Token         | Not verified                                        | Public profile details of each user |

The instruction does not list exact permissions. The fine-grained token for Github Codes uses **Members: Read** at organization level.

## Create credentials in GitHub

{% stepper %}
{% step %}

### Open the token settings

In the upper-right corner of any GitHub page, click your profile photo, then **Settings**. In the left sidebar, click **Developer settings**.
{% endstep %}

{% step %}

### Create a fine-grained token

Under **Personal access tokens**, click **Fine-grained tokens**, then **Generate new token**. Fill in the required fields.
{% endstep %}

{% step %}

### Copy the token

Copy the access token.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter    | Required | Type             | Default                  | Description                                                   |
| ------------ | -------- | ---------------- | ------------------------ | ------------------------------------------------------------- |
| Url          | No       | Text             | `https://api.github.com` | Base URL of the GitHub API.                                   |
| Access token | Yes      | Text (sensitive) | None                     | The token.                                                    |
| Proxy        | No       | Text             | Empty                    | Proxy URL.                                                    |
| Thread count | No       | Integer          | 32                       | Parallel threads for profile requests. Minimum 1, maximum 32. |
| Sleep time   | No       | Integer          | None                     | Seconds between enrichment requests to ease rate limiting.    |
| Timeout      | No       | Integer          | 30                       | Seconds to wait for API responses.                            |

## Troubleshooting

| Error message                    | Cause                                                  | Fix                                                    |
| -------------------------------- | ------------------------------------------------------ | ------------------------------------------------------ |
| `Forbidden: <url>`               | The API answered HTTP 403 and it was not a rate limit. | Check the token permissions and organization approval. |
| `Max retries exceeded for <url>` | The API kept answering with rate limit responses.      | Increase Sleep time or lower Thread count.             |

## Change history

{% hint style="info" %}
Available starting from version 5.3.0.
{% endhint %}
