> ## 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 HRIS API request to list employees from a connected HR system

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

## 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 HRIS API call. Let's list employees from the connected HR system:

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl --request GET \
      --url 'https://api.stackone.com/unified/hris/employees' \
      --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.hris.listEmployees({
      xAccountId: "your-account-id"
    });

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

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

    client = StackOne(api_key="YOUR_API_KEY")

    response = client.hris.list_employees(
        x_account_id="your-account-id"
    )

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

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "emp_123",
      "remote_id": "abc123",
      "first_name": "Jane",
      "last_name": "Doe",
      "display_full_name": "Jane Doe",
      "work_email": "jane.doe@company.com",
      "employment_status": "active",
      "department": {
        "id": "dept_456",
        "name": "Engineering"
      },
      "start_date": "2023-01-15"
    }
  ]
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Get Employee" icon="user" href="/hris/api-reference/employees/get-employee">
    Retrieve details for a specific employee
  </Card>

  <Card title="List Departments" icon="building" href="/hris/api-reference/groups/list-department-groups">
    Get organizational structure
  </Card>

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

  <Card title="User Syncing" icon="rotate" href="/hris/use-cases/sync-users">
    Keep your system in sync with HR data
  </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)
* [Connector Profiles](https://app.stackone.com/connector_profiles)
