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

# 获取账户

> 列出与某个用户关联的所有 Fluz 账户。

```javascript theme={null}
import { GraphQLClient, gql } from 'graphql-request';

const API_URL = 'https://transactional-graph.staging.fluzapp.com/api/v1/graphql';
const API_KEY = 'your-api-key-here';
const USER_ID = 'user-id-uuid-here';

const GET_ACCOUNTS = gql`
  query getAccountsByUserId($userId: UUID!) {
    getAccountsByUserId(userId: $userId) {
      accountId
      type
      accountName
    }
  }
`;

const client = new GraphQLClient(API_URL, {
  headers: {
    Authorization: `Basic ${API_KEY}`,
    'Content-Type': 'application/json',
  },
});

const data = await client.request(GET_ACCOUNTS, { userId: USER_ID });
console.log(JSON.stringify(data, null, 2));
```
