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

# Discover Connected Users

> Return the users connected to your application through active OAuth grants, with their external reference id and granted scopes.

Returns the users connected to your application through active OAuth grants, with the `externalReferenceId` and granted scopes for each. Use it to see who you can target and what each user has authorized before calling other bulk operations.

Returns identifiers and granted scopes only — **never user tokens**.

## Requirements

* `Authorization: Basic <API_KEY>` (your application API key)
* The **bulk API capability** on your application

## Query

```graphql theme={null}
query GetBulkConnectedOAuthUsers($paginate: BulkPaginationInput) {
  getBulkConnectedOAuthUsers(paginate: $paginate) {
    totalCount
    hasNextPage
    users {
      externalReferenceId
      accountId
      userId
      scopes
      connectedAt
    }
  }
}
```

### Variables

```json theme={null}
{
  "paginate": { "limit": 100, "offset": 0 }
}
```

## Response

```json theme={null}
{
  "data": {
    "getBulkConnectedOAuthUsers": {
      "totalCount": 128,
      "hasNextPage": true,
      "users": [
        {
          "externalReferenceId": "your-user-001",
          "accountId": "8f3c…",
          "userId": "b21a…",
          "scopes": ["LIST_PAYMENT", "LIST_PURCHASES"],
          "connectedAt": "2026-05-01T12:00:00.000Z"
        }
      ]
    }
  }
}
```

## Arguments

| Argument          | Type  | Description                                      |
| ----------------- | ----- | ------------------------------------------------ |
| `paginate.limit`  | `Int` | Users per page. Maximum and default are **100**. |
| `paginate.offset` | `Int` | Number of users to skip. Defaults to `0`.        |

## Response fields

| Field                         | Description                                                                                                                 |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `users[].externalReferenceId` | Your reference id for the user. `null` if none was set at connect time — such users are only reachable via `ALL_CONNECTED`. |
| `users[].accountId`           | The connected user's account id.                                                                                            |
| `users[].userId`              | The connected user's user id.                                                                                               |
| `users[].scopes`              | Scopes the user granted to your application.                                                                                |
| `users[].connectedAt`         | When the user connected.                                                                                                    |
| `totalCount`                  | Total connected users across all pages.                                                                                     |
| `hasNextPage`                 | Whether more users exist beyond this page.                                                                                  |

## Notes

* The bulk API allows larger pages than the rest of the API — up to 100 per page.
* Page with `offset` until `hasNextPage` is `false`.
