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

# Get Company Users

> Retrieve all users belonging to a specific company with optional filtering

## Authentication

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://app.journeybee.io/api/v1/users" \
    -H "Authorization: Bearer your-api-key-uuid"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.journeybee.io/api/v1/users', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer your-api-key-uuid'
    }
  });
  ```
</CodeGroup>

## Query Parameters

<ParamField query="indirect" type="string">
  Include disabled/indirect users in the response. Accepts any value to enable.
</ParamField>

## Response Schema

<ResponseField name="users" type="array">
  Array of user objects

  <Expandable title="User Object Properties">
    <ResponseField name="id" type="number">
      Unique identifier for the user
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO timestamp when the user was created
    </ResponseField>

    <ResponseField name="email" type="string">
      User's email address
    </ResponseField>

    <ResponseField name="first_name" type="string">
      User's first name
    </ResponseField>

    <ResponseField name="last_name" type="string">
      User's last name
    </ResponseField>

    <ResponseField name="role" type="string">
      User's role: `admin`, `partnerships`, `partner`, `indirect`
    </ResponseField>

    <ResponseField name="position" type="string">
      User's job title/position
    </ResponseField>

    <ResponseField name="email_verified" type="string">
      ISO timestamp when email was verified, null if unverified
    </ResponseField>

    <ResponseField name="disabled_at" type="string">
      ISO timestamp when user was disabled, null if active
    </ResponseField>

    <ResponseField name="color" type="string">
      Hex color code assigned to the user for UI purposes
    </ResponseField>

    <ResponseField name="profile_image_id" type="number">
      Asset ID of the user's profile image
    </ResponseField>

    <ResponseField name="profile_image_uuid" type="string">
      UUID of the user's profile image asset
    </ResponseField>

    <ResponseField name="country_id" type="number">
      ID of the user's country
    </ResponseField>

    <ResponseField name="country_label" type="string">
      Name of the user's country
    </ResponseField>

    <ResponseField name="country_code" type="string">
      ISO country code for the user's country
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://app.journeybee.io/api/v1/users" \
    -H "Authorization: Bearer jb_api_1234567890abcdef"
  ```

  ```bash cURL (with disabled users) theme={null}
  curl -X GET "https://app.journeybee.io/api/v1/users?indirect=true" \
    -H "Authorization: Bearer jb_api_1234567890abcdef"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.journeybee.io/api/v1/users', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer jb_api_1234567890abcdef'
    }
  });

  const users = await response.json();
  ```

  ```javascript JavaScript (with disabled users) theme={null}
  const response = await fetch('https://app.journeybee.io/api/v1/users?indirect=true', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer jb_api_1234567890abcdef'
    }
  });

  const allUsers = await response.json();
  ```
</CodeGroup>

## Example Response

<ResponseExample>
  ```json 200 OK theme={null}
  [
    {
      "id": 456,
      "created_at": "2024-01-10T09:15:00Z",
      "email": "john.smith@company.com",
      "first_name": "John",
      "last_name": "Smith",
      "role": "admin",
      "position": "Partnership Manager",
      "email_verified": "2024-01-10T09:30:00Z",
      "disabled_at": null,
      "color": "#4F46E5",
      "profile_image_id": 789,
      "profile_image_uuid": "profile-uuid-789",
      "country_id": 1,
      "country_label": "United States",
      "country_code": "US"
    },
    {
      "id": 457,
      "created_at": "2024-01-12T14:20:00Z",
      "email": "sarah.johnson@company.com",
      "first_name": "Sarah",
      "last_name": "Johnson",
      "role": "partnerships",
      "position": "Business Development",
      "email_verified": "2024-01-12T14:45:00Z",
      "disabled_at": null,
      "color": "#059669",
      "profile_image_id": null,
      "profile_image_uuid": null,
      "country_id": 1,
      "country_label": "United States",
      "country_code": "US"
    }
  ]
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 401 Unauthorized theme={null}
  {
    "error": "Invalid API key or insufficient permissions"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 403 Forbidden theme={null}
  {
    "error": "Access denied to company users"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 404 Not Found theme={null}
  {
    "error": "Company not found"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 500 Internal Server Error theme={null}
  {
    "error": "Failed to retrieve company users"
  }
  ```
</ResponseExample>

## Notes

* Requires API key with `read_access` permission
* Only returns users from the specified company (company-scoped access)
* Disabled users are excluded by default unless explicitly requested
