## List users for a sub-organization.

`print_mail.sub_organizations.retrieve_users(strid, SubOrganizationRetrieveUsersParams**kwargs)  -> SubOrganizationRetrieveUsersResponse`

**get** `/print-mail/v1/sub_organizations/{id}/users`

List users for a sub-organization.

### Parameters

- `id: str`

- `limit: Optional[int]`

- `search: Optional[str]`

  You can supply any string to help narrow down the list of resources. For example, if you pass `"New York"` (quoted), it will return resources that have that string present somewhere in their response. Alternatively, you can supply a structured search query. See the documentation on `StructuredSearchQuery` for more details.

- `skip: Optional[int]`

### Returns

- `List[SubOrganizationRetrieveUsersResponseItem]`

  - `id: str`

    A unique ID prefixed with `user_`.

  - `email: str`

    The email of the user.

  - `name: str`

    The name of the user.

  - `organization: str`

    A unique ID prefixed with `user_`.

  - `pending_invite: bool`

    Indicates if the user has a pending invite.

  - `roles: List[str]`

    The roles given to the user. Roles can be used to restrict access for
    users.

  - `verified_email: bool`

    Indicates if the user has a verified email or not.

  - `email_preferences: Optional[EmailPreferences]`

    A set of preferences for how a user should receive emails.

    - `order_preview_send_preference: Optional[Literal["do_not_send", "send_live_only", "send_live_and_test"]]`

      The list of preferences for receiving order preview emails.

      - `"do_not_send"`

      - `"send_live_only"`

      - `"send_live_and_test"`

  - `last_login_time: Optional[datetime]`

    The date and time at which the user last logged in.

  - `phone_number: Optional[str]`

    The phone number of the user.

  - `previous_emails: Optional[List[str]]`

    A list of emails the user has previously had. If a user has changed their
    email before, this list will be populated with all of the emails they
    once had.

### Example

```python
import os
from postgrid import PostGrid

client = PostGrid(
    print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"),  # This is the default and can be omitted
)
response = client.print_mail.sub_organizations.retrieve_users(
    id="id",
)
print(response)
```

#### Response

```json
[
  {
    "id": "user_abc123def456ghi6789",
    "pendingInvite": false,
    "organization": "org_abc123def456ghi6789",
    "email": "user@postgrid.com",
    "name": "Calvin",
    "verifiedEmail": true,
    "roles": [
      "role_abc123def456ghi6789"
    ]
  }
]
```
