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

# Making Your First Request

> Make your first Documents API request to list files from a connected storage provider

This guide walks you through making your first API request to retrieve data from a linked account.

<Tip>
  **Prefer a no-code approach?** Use the [Request Tester](/guides/request-tester) in the dashboard to test API endpoints directly against linked accounts without writing any code.
</Tip>

## Prerequisites

1. [**API Key created in StackOne Dashboard**](/guides/api-keys) and copied to a secure location

2. [**Basic Authentication Setup**](/basic-authentication-with-stackone-api) - Learn how to properly authenticate with StackOne API using your API key

3. Required provider integration enabled

4. Account linked successfully

5. (Optional) Use an [SDK or Postman](/guides/stackone-api-sdks)

## Getting Account ID

<Note>
  **Authentication**: When using `curl -u "$API_KEY:"`, encoding is handled automatically. When setting the `Authorization` header manually, you must base64 encode your API key first. See the [Basic Authentication Guide](/basic-authentication-with-stackone-api) for details.
</Note>

1. List your linked accounts to find the account ID:

```bash theme={null}
curl --request GET \
     --url https://api.stackone.com/accounts \
     --header 'accept: application/json' \
     --header 'authorization: Basic {base64_encoded_api_key}'
```

2. From the response, copy the `id` value for your desired provider account.

<Tip>
  Filter by provider using the `providers` query parameter:

  ```bash theme={null}
  curl --request GET \
       --url 'https://api.stackone.com/accounts?providers={provider_name}' \
       --header 'accept: application/json' \
       --header 'authorization: Basic {base64_encoded_api_key}'
  ```
</Tip>

## Making Your First Request

Now you're ready to make your first Documents API call. Let's list the drives available in the connected storage provider:

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl --request GET \
      --url 'https://api.stackone.com/unified/documents/drives' \
      --header 'accept: application/json' \
      --header 'authorization: Basic {base64_encoded_api_key}' \
      --header 'x-account-id: {account_id}'
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import { StackOne } from "@stackone/stackone-client-ts";

    const client = new StackOne({ apiKey: "YOUR_API_KEY" });

    const response = await client.documents.listDrives({
      xAccountId: "your-account-id"
    });

    console.log(response.drives);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from stackone_client import StackOne

    client = StackOne(api_key="YOUR_API_KEY")

    response = client.documents.list_drives(
        x_account_id="your-account-id"
    )

    print(response.drives)
    ```
  </Tab>
</Tabs>

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "drive_123",
      "remote_id": "abc123",
      "name": "My Drive",
      "description": "Personal storage",
      "url": "https://drive.google.com/drive/..."
    }
  ]
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="List Files" icon="file" href="/documents/api-reference/files/list-files">
    Retrieve files from a specific folder or drive
  </Card>

  <Card title="File Picker" icon="hand-pointer" href="/documents/file-Picker">
    Let users select files with the embedded picker
  </Card>

  <Card title="Pagination" icon="arrow-right" href="/documents/common-guide/pagination">
    Handle large result sets efficiently
  </Card>

  <Card title="Webhooks" icon="bell" href="/guides/webhooks">
    Get notified when files change
  </Card>
</CardGroup>

## References

* [Basic Authentication with API Keys](/basic-authentication-with-stackone-api)
* [List Accounts](/platform/api-reference/accounts/list-accounts)
* [Libraries & SDKs](/guides/stackone-api-sdks)
* [Auth Configs](https://app.stackone.com/auth_configs)
