Skip to main content
If you have 1Password Business or 1Password Teams, you can use 1Password SDKs to manage groups.

Before you get started

Before you begin, follow the steps to get started with a 1Password SDK. The examples on this page assume you have an initialized client instance. For example:
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
}

See the examples folder in the 1Password Go, JavaScript, or Python SDK GitHub repository for full example code you can quickly clone and test in your project.

Get a group

To fetch a group, use the Groups().Get() method.Replace groupID with the group’s unique identifier.
// 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)