> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage groups using 1Password SDKs

If you have [1Password Business](https://1password.com/business-security) or [1Password Teams](https://1password.com/product/teams-small-business-password-manager), you can use 1Password SDKs to manage [groups](https://support.1password.com/groups/).

## Before you get started

Before you begin, [follow the steps to get started](/sdks#get-started) with a 1Password SDK. The examples on this page assume you have an initialized `client` instance. For example:

<Tabs groupId="sdks">
  <Tab value="go" title="Go">
    {/* markdownlint-disable MD046 */}

    ```go theme={null}
    package main

    import (
    	"context"

    	"github.com/1password/onepassword-sdk-go"
    )

    func main() {
    	// TODO: Initialize client using your preferred authentication method (see Overview > Get started)
    	client, err := onepassword.NewClient(context.Background(),
    	)
    	if err != nil {
    		panic(err)
    	}

    	// Your code here
    }

    ```
  </Tab>

  <Tab value="js" title="JavaScript">
    {/* markdownlint-disable MD046 */}

    <Tabs groupId="sdk-before-start-js">
      <Tab value="esm" title="ES Modules">
        ```javascript theme={null}
        import sdk from "@1password/sdk";

        async function main() {
          const client = await sdk.createClient({
            // TODO: Initialize client using your preferred authentication method (see Overview > Get started)
          });

          // Your code here
        }

        main().catch(console.error);

        ```
      </Tab>

      <Tab value="cjs" title="CommonJS">
        ```javascript theme={null}
        const sdk = require("@1password/sdk");

        async function main() {
          const client = await sdk.createClient({
            // TODO: Initialize client using your preferred authentication method (see Overview > Get started)
          });

          // Your code here
        }

        main().catch(console.error);

        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab value="python" title="Python">
    {/* markdownlint-disable MD046 */}

    ```python theme={null}
    import asyncio

    from onepassword import Client  # Also import DesktopAuth for desktop app authentication.

    async def main():
        # TODO: Initialize client using your preferred authentication method (see Overview > Get started)
        client = await Client.authenticate(...)

        # Your code here

    asyncio.run(main())

    ```
  </Tab>
</Tabs>

<Tip>
  See the examples folder in the 1Password [Go](https://github.com/1Password/onepassword-sdk-go/tree/main/example), [JavaScript](https://github.com/1Password/onepassword-sdk-js/tree/main/examples), or [Python](https://github.com/1Password/onepassword-sdk-python/tree/main/example) SDK GitHub repository for full example code you can quickly clone and test in your project.
</Tip>

## Get a group

<Tabs groupId="sdks">
  <Tab value="go" title="Go">
    To fetch a group, use the [`Groups().Get()`](https://github.com/1Password/onepassword-sdk-go/blob/main/groups.go#L14) method.

    Replace `groupID` with the group's [unique identifier](/sdks/concepts#unique-identifiers).

    ```go theme={null}
    // Get a group
    group, err := client.Groups().Get(context.Background(), groupID, onepassword.GroupGetParams{})
    if err != nil {
    	panic(err)
    }
    fmt.Printf("Group details: %v\\n", group)
    ```
  </Tab>

  <Tab value="js" title="JavaScript">
    To fetch a group, use the [`groups.get()`](https://github.com/1Password/onepassword-sdk-js/blob/main/client/src/groups.ts#L11) method.

    Replace `groupId` with the group's [unique identifier](/sdks/concepts#unique-identifiers).

    ```js theme={null}
    // Get a group
    const group = await client.groups.get(groupId, { vaultPermissions: false });
    console.log(JSON.stringify(group));
    ```
  </Tab>

  <Tab value="python" title="Python">
    To fetch a group, use the [`groups.get()`](https://github.com/1Password/onepassword-sdk-python/blob/main/src/onepassword/groups.py#L18) method.

    ```python theme={null}
    from onepassword import GroupGetParams

    # Get a group
    group = await client.groups.get("your-group-id", GroupGetParams(vaultPermissions=False))
    print(group)
    ```
  </Tab>
</Tabs>
