> ## 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 an Astro Organization

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

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

## Prerequisites

* Organization Owner permissions.

For more information on user roles, see [Manage user permissions on Astro](/docs/astro/user-permissions).

<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>

## Add a user to an Organization

If your Organization has [configured an identity provider (IdP) with Astro](/docs/astro/configure-idp#configure-your-sso-identity-provider), assign users to Astro from your identity provider. By default, any users that you assign can join your Organization as an Organization Member without an invite. To change this behavior, see [Disable just-in-time provisioning](/docs/astro/configure-idp#configure-just-in-time-provisioning).

You can also manually add users to an Organization. You must manually add users in the following circumstances:

* You don't have an IdP configured.
* You disabled just-in-time provisioning.
* You want to invite a user to an Organization from a domain that you don't own, such as a third party consultant.
* You want to invite someone from your company to Astro as a role other than Organization Member.

<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**.
    2. Click **+ Invite User**.
    3. Enter the user's email.
    4. Select an Organization role for the user. See [Organization roles reference](/docs/astro/user-permissions#organization-roles).
    5. Click **Invite User**.
  </Tab>

  <Tab title="Legacy UI" language="legacy-ui">
    1. In the Astro UI, click **Organization Settings** > **Access Management**.
    2. Click **Invite member**:
    3. Enter the user's email.
    4. Select an Organization role for the user. See [Organization roles reference](/docs/astro/user-permissions#organization-roles).
    5. Click **Invite member**.
  </Tab>
</Tabs>

After you add the user, their information appears in the **Users** tab in **Access Management**. To access Astro, the user needs to accept the invitation sent by email and then create an Astro account.

## Update or remove an Organization user

See [User permissions](/docs/astro/user-permissions) to view the permissions for each available Organization role.

<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**.
    2. Find the user in the **Users** list.
    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, click **Organization Settings** > **Access Management**.
    2. Find the user in the **Users** list. To view or manage the user's Organization, Workspace, and Deployment roles, either click the user's row to open the **User Details** page, or open the action menu (⋯) on the user's row and select **Edit User**.
    3. (Optional) Edit the user's role. See [Organization roles](/docs/astro/user-permissions). If you opened the action menu, you can change the user's Organization role from the **Edit User** option. On the **User Details** page you can view and edit the user's Organization, Workspace, Deployment, and Dag roles.
    4. If you 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>

<Info>To remove yourself from an Organization as an Organization Owner, one or more Organization Owners must be assigned to the Organization. If you're the only Organization Owner for your Organization, you'll need to assign another Organization Owner before removing yourself from the Organization.</Info>

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

You can use the Astro CLI and a shell script to add multiple users to an Organization at once. The shell script reads from a text file which contains user information. You can generate the text file for each new batch of users that need to assigned to an Organization and run the script using 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 an Organization:

   ```text wrap theme={null}
   user1@astronomer.io ORGANIZATION_MEMBER
   user2@astronomer.io ORGANIZATION_OWNER
   user3@astronomer.io ORGANIZATION_BILLING_ADMIN
   user4@astronomer.io ORGANIZATION_OWNER
   ```

3. Create a file named `add-users.sh` and then 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
   # Loop through the file to read each user email address and the role, and use Astro CLI to invite them
   while read line; do
       email=$(echo "$line" | cut -d' ' -f1)
       role=$(echo "$line" | cut -d' ' -f2)
       echo "Inviting $email as $role..."
       astro organization invite "$email" --role "$role"
   done < "$1"
   ```

4. Sign in to the Astro CLI using `astro login`, and then run `astro organization list` to ensure that you're in the same Organization where you want to add the users. If you're not in the right Organization, run `astro organization 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) and specify the environment variable `ASTRO_API_TOKEN=<your-token>` in your CI/CD environment.

## See also

* [Manage Workspace users](/docs/astro/manage-workspace-users)
* [Manage Teams](/docs/astro/manage-teams)
* [Manage user permissions on Astro](/docs/astro/user-permissions)
* [Dag-level access control](/docs/astro/dag-level-access-control)
