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

# Manage users in your Astro Workspace

As a Workspace Owner or an Organization Owner, you can add new team members to Astro and grant them user roles with permissions for specific actions across your Workspace.

To manage users at the Organization level, see [Manage Organization users](/docs/astro/manage-organization-users). To manage groups of users, see [Manage Teams](/docs/astro/manage-teams).

<Tip>
  **A new Astro UI is here**

  Astronomer has redesigned the Astro UI. Try the new experience and switch your instructions using the **New Astro UI** and **Legacy UI** tabs on this page. Your selection is remembered across the docs.
</Tip>

## Prerequisites

To add, edit, or remove Workspace users from a given Workspace, you need either Organization Owner permissions or Workspace Owner permissions for the Workspace.

<Info>
  **Centralized access management for Organization Owners**

  Organization Owners can also add or update a user or Team for a Workspace from your Organization's access management settings:

  <Tabs>
    <Tab title="New Astro UI" language="astro-next-ui">
      1. In the Astro UI, go to **Settings**, then in the **Access Management** section, click **Users** or **Teams**.
      2. Select the user or Team.
      3. Click the **Workspaces** tab, then click **+ Add Workspace** to add them to a Workspace, or **Edit Role** to change their role for an existing Workspace.
    </Tab>

    <Tab title="Legacy UI" language="legacy-ui">
      1. In the Astro UI, click **Organization Settings** > **Access Management**.
      2. Select the user or team to add or update.
      3. Click the **Workspaces** tab, then click **+ Workspace** to add them to a Workspace, or open the **More actions** menu (⋯) and select **Edit role** next to an existing Workspace to change their role.
    </Tab>
  </Tabs>
</Info>

## Add a user to a Workspace

<Tabs>
  <Tab title="New Astro UI" language="astro-next-ui">
    1. In the Astro UI, go to **Settings** > **Workspaces**.
    2. Select your Workspace, then in the **Access Management** section, click **Users**.
    3. Click **+ Add User**.
    4. In the **User** field, enter the email address of the user you want to invite.
    5. From the dropdown, select the **Invite new user** option for the email you entered.
    6. Choose a **Workspace Role**. See [Workspace roles reference](/docs/astro/user-permissions#workspace-roles).
    7. Click **Invite User to Workspace**.
  </Tab>

  <Tab title="Legacy UI" language="legacy-ui">
    1. In the Astro UI, click **Workspace Settings** > **Access Management**.
    2. In the **Users** tab, click **+ Member**.
    3. Select the user's name and email address in the **Organization Member** list.
    4. Select a role for the user and then click **Add member**. See [Workspace roles reference](/docs/astro/user-permissions#workspace-roles).
  </Tab>
</Tabs>

After you add the user, their information appears in the **Users** tab as a new entry in the **Members** list.

You can also add groups of users to a Workspace through Teams. See [Manage Teams](/docs/astro/manage-teams).

## Update or remove a Workspace user

<Tabs>
  <Tab title="New Astro UI" language="astro-next-ui">
    1. In the Astro UI, go to **Settings** > **Workspaces**.
    2. Select your Workspace, then in the **Access Management** section, click **Users**.
    3. To edit the user's role, click the user's **More actions** menu (⋯), select **Edit User**, change their access type, then click **Update User**.
    4. To remove the user, click the user's **More actions** menu (⋯), select **Remove User…**, then click **Yes, Continue**.
  </Tab>

  <Tab title="Legacy UI" language="legacy-ui">
    1. In the Astro UI, go to **Workspace Settings** > **Access Management**.
    2. Find the user in the **Users** list. To view or manage the user's roles, either click the user's row to open the **User Details** page, or click the **More actions** button on the user's row and select **Edit User**.
    3. (Optional) Edit the user's name and role. See [Workspace roles](/docs/astro/user-permissions).
    4. If you've updated the user's role, click **Update member**. To delete the user, open the action menu and select **Remove user…**, or click **Remove member** on the **User Details** page.
  </Tab>
</Tabs>

## Add a group of users to a Workspace using the Astro CLI

You can use the Astro CLI and a shell script to add multiple users to a Workspace at once. The shell script reads from a text file which contains user information. You can generate a text file for each new batch of users that need to be assigned to a Workspace and run the script with the Astro CLI.

1. Create a text file named `users.txt`.

2. Open the text file. On each line, add a user's email and their role separated by a space. The following is an example of how you can write a list for inviting users to a Workspace:

   ```text wrap theme={null}
   user1@astronomer.io WORKSPACE_MEMBER
   user2@astronomer.io WORKSPACE_OWNER
   user3@astronomer.io WORKSPACE_OPERATOR
   user4@astronomer.io WORKSPACE_OWNER
   ```

3. Create a file named `add-users.sh` and add the following script to it:

   ```bash title="add-users.sh" wrap theme={null}
   #!/bin/bash

   # Check if a file was provided as an argument
   if [ $# -ne 1 ]; then
       echo "Usage: $0 <file>"
       exit 1
   fi

   while read line; do
       email=$(echo "$line" | cut -d' ' -f1)
       role=$(echo "$line" | cut -d' ' -f2)
       echo "Inviting $email as $role..."
       astro workspace user add "$email" --role "$role"
   done < "$1"
   ```

4. Log in to the Astro CLI using `astro login`, then run `astro workspace list` to ensure that you're in the same Workspace where you want to add the users. If you're not in the right Workspace, run `astro workspace switch`.

5. Run the following command to execute the shell script:

   ```sh wrap theme={null}
   sh path/to/add-users.sh path/to/users.txt
   ```

6. (Optional) To use this script as part of a CI/CD pipeline, create an [Organization API token](/docs/astro/organization-api-tokens) or [Workspace API token](/docs/astro/workspace-api-tokens) and specify the environment variable `ASTRO_API_TOKEN=<your-token>` in your CI/CD environment. Note that you can use Workspace API tokens to manage users only at the Workspace level.

## See also

* [Manage Organization users](/docs/astro/manage-organization-users)
* [Manage Teams](/docs/astro/manage-teams)
* [Manage user permissions on Astro](/docs/astro/user-permissions)
