# List Users

> Retrieve a paginated list of workspace members

## Query Parameters

<ParamField query="limit" type="integer" default="50">
  Maximum number of results to return (max: 100)
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Number of results to skip for pagination
</ParamField>

<ParamField query="role" type="string">
  Filter users by role (e.g., "admin", "member", "viewer")
</ParamField>

## Response

<ResponseField name="data" type="array">
  Array of workspace user objects
  
  <Expandable title="User Object">
    <ResponseField name="id" type="string">
      Unique identifier for the user
    </ResponseField>
    
    <ResponseField name="email" type="string">
      User's email address
    </ResponseField>
    
    <ResponseField name="name" type="string">
      User's full name
    </ResponseField>
    
    <ResponseField name="avatar" type="string">
      URL to user's avatar image
    </ResponseField>
    
    <ResponseField name="username" type="string">
      User's username
    </ResponseField>
    
    <ResponseField name="language" type="string">
      User's preferred language
    </ResponseField>
    
    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of user account creation
    </ResponseField>
    
    <ResponseField name="workspace_role" type="string">
      User's role in the workspace
    </ResponseField>
    
    <ResponseField name="joined_at" type="string">
      ISO 8601 timestamp when user joined the workspace
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination information
  
  <Expandable title="Pagination Object">
    <ResponseField name="limit" type="integer">
      Number of results per page
    </ResponseField>
    
    <ResponseField name="offset" type="integer">
      Current offset
    </ResponseField>
    
    <ResponseField name="total" type="integer">
      Total number of users in the workspace
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>

```bash cURL
curl -X GET "https://api.orwel.io/api/v1/users?limit=10" \
  -H "Authorization: Bearer orwel_sk_YOUR_KEY"
```

```javascript JavaScript
const response = await fetch(
  'https://api.orwel.io/api/v1/users?limit=10',
  {
    headers: {
      'Authorization': 'Bearer orwel_sk_YOUR_KEY'
    }
  }
);

const data = await response.json();
console.log(data);
```

```python Python
import requests

headers = {
    'Authorization': 'Bearer orwel_sk_YOUR_KEY'
}

params = {
    'limit': 10
}

response = requests.get(
    'https://api.orwel.io/api/v1/users',
    headers=headers,
    params=params
)

data = response.json()
print(data)
```

</RequestExample>

<ResponseExample>

```json Response
{
  "data": [
    {
      "id": "cc0e8400-e29b-41d4-a716-446655440007",
      "email": "john@example.com",
      "name": "John Doe",
      "avatar": "https://example.com/avatar.jpg",
      "username": "johndoe",
      "language": "en",
      "created_at": "2024-06-15T10:30:00Z",
      "workspace_role": "admin",
      "joined_at": "2024-06-15T10:30:00Z"
    },
    {
      "id": "dd0e8400-e29b-41d4-a716-446655440008",
      "email": "jane@example.com",
      "name": "Jane Smith",
      "avatar": "https://example.com/avatar2.jpg",
      "username": "janesmith",
      "language": "en",
      "created_at": "2024-07-20T14:20:00Z",
      "workspace_role": "member",
      "joined_at": "2024-07-20T14:20:00Z"
    }
  ],
  "pagination": {
    "limit": 10,
    "offset": 0,
    "total": 5
  }
}
```

</ResponseExample>
