> ## Documentation Index
> Fetch the complete documentation index at: https://docs.macroscope.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List team memberships

> Teams in the workspace and the members who belonged to each for the whole reporting period.

Returns every team in the workspace with the members whose membership spans the entire reporting period. Disabled teams and teams with no matching members are included. Secret teams are omitted for API keys.

Requires workspace Read, not Productivity. Deleted teams are excluded. There is no pagination or silent truncation: an oversized result fails without partial data, and retrying unchanged does not resolve it.

## Authorization

**Authorization** `string` *required*

`Bearer <key>`. See [Authentication](https://docs.macroscope.com/api#authentication).

## Path parameters

**workspaceType** `string` *required*

`GITHUB_ORGANIZATION` or `GITHUB_USER`.

**workspaceId** `string` *required*

Numeric GitHub ID of the organization or user.

## Query parameters

**from** `string`

Inclusive start (RFC 3339). If `from` or `to` is omitted, both are ignored and the latest complete interval of the current reporting period is used, or the previous period if none is available.

**to** `string`

Exclusive end (RFC 3339). Explicit intervals must span at least one microsecond; neither timestamp may equal `0001-01-01T00:00:00Z`. A member is included only if their membership covers all of `[from, to)`; a membership ending exactly at `to` qualifies.

## Response

**teams** `Team[]`

Teams in no particular order. There is no pagination.

**properties**

**id** `string`

GitHub team ID.

**slug** `string`

GitHub team slug.

**displayName** `string`

Current team name.

**description** `string`

Team description, when set.

**privacy** `string`

GitHub team visibility, `closed` or `secret`.

**enabled** `boolean`

Whether the team is enabled in Macroscope. Omitted when `false`.

**nodeId** `string`

GitHub GraphQL node ID.

**members** `Member[]`

Members for the whole period, in no particular order. Includes members excluded from productivity reporting. Omitted when empty.

**from** `string`

Start of the effective period (RFC 3339).

**to** `string`

End of the effective period (RFC 3339).

**timezone** `string`

Workspace IANA timezone. Omitted when unset, in which case UTC is used.

### Member

**id** `string`

GitHub user ID.

**login** `string`

GitHub username.

**displayName** `string`

GitHub display name. Omitted when not set; fall back to `login`.

**avatarUrl** `string`

GitHub avatar URL.

**nodeId** `string`

GitHub GraphQL node ID.

```bash cURL theme={null}
curl --get https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/teams/memberships \
  -H "Authorization: Bearer $MACROSCOPE_API_KEY" \
  --data-urlencode "from=2026-09-14T00:00:00Z" \
  --data-urlencode "to=2026-09-21T00:00:00Z"
```

```python Python theme={null}
import os, requests

r = requests.get(
    "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/teams/memberships",
    headers={"Authorization": f"Bearer {os.environ['MACROSCOPE_API_KEY']}"},
    params={"from": "2026-09-14T00:00:00Z", "to": "2026-09-21T00:00:00Z"},
)
print(r.json())
```

```javascript JavaScript theme={null}
const params = new URLSearchParams({
  from: "2026-09-14T00:00:00Z",
  to: "2026-09-21T00:00:00Z",
});
const res = await fetch(
  `https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/teams/memberships?${params}`,
  { headers: { Authorization: `Bearer ${process.env.MACROSCOPE_API_KEY}` } }
);
console.log(await res.json());
```

```json 200 theme={null}
{
  "teams": [
    {
      "id": "2001",
      "nodeId": "T_platform",
      "slug": "platform",
      "displayName": "platform",
      "privacy": "closed",
      "enabled": true,
      "members": [
        {
          "id": "1001",
          "login": "alice",
          "displayName": "Alice",
          "avatarUrl": "https://avatars.githubusercontent.com/u/1001?v=4",
          "nodeId": "U_alice"
        },
        {
          "id": "1002",
          "login": "bob",
          "avatarUrl": "https://avatars.githubusercontent.com/u/1002?v=4",
          "nodeId": "U_bob"
        }
      ]
    },
    {
      "id": "2002",
      "nodeId": "T_web",
      "slug": "web",
      "displayName": "web",
      "privacy": "closed"
    }
  ],
  "from": "2026-09-14T00:00:00Z",
  "to": "2026-09-21T00:00:00Z",
  "timezone": "America/Los_Angeles"
}
```

```json 401 theme={null}
{ "code": 16, "message": "unauthenticated" }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.