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 initializedclient instance. For example:
- Go
- JavaScript
- Python
Grant vault permissions
- Go
- JavaScript
- Python
Use the
Vaults().GrantGroupPermissions() method to grant vault permissions to all team members who belong to a specific group. This method requires the following:vaultID: The unique identifier of the vault.- A slice of one or more
GroupAccessstructs that each contain:GroupID: The unique identifier of the group.Permissions: A bitmask of vault permissions to grant to the group. You can combine multiple permissions using the bitwise OR operator (|).
Update vault permissions
- Go
- JavaScript
- Python
Use the
Vaults().UpdateGroupPermissions() method to replace a group’s existing permissions in a vault. This method accepts a slice of one or more GroupVaultAccess structs that each contains:VaultID: The unique identifier of the vault.GroupID: The unique identifier of the group.Permissions: A bitmask of the complete set of updated vault permissions. You can combine multiple permissions using the bitwise OR operator (|).
Revoke vault permissions
- Go
- JavaScript
- Python
Use the
Vaults().RevokeGroupPermissions() method to completely remove a group’s access to a vault. This method requires the following:vaultID: The unique identifier of the vault.groupID: The unique identifier of the group whose permissions you want to revoke.
Appendix: Vault permissions
The permissions available to you depend on your account type: 1Password Business or 1Password Teams.1Password Business vault permissions
In 1Password Business, all vault permissions have a hierarchical relationship in which narrower permissions require broader permissions to be granted alongside them. For example, to grant the narrower permissionDELETE_ITEMS you must also grant the broader permissions EDIT_ITEMS, REVEAL_ITEM_PASSWORD, and READ_ITEMS. This is because you cannot delete items unless you can also view and edit them.
Similarly, to revoke a broader permission like READ_ITEMS, any narrower dependent permissions like DELETE_ITEMS that have already been granted must also be revoked.
1Password Teams vault permissions
1Password Teams includes three broad permission levels made up of collections of the granular vault permissions available in 1Password Business. You’ll need to grant or revoke all the permissions for the desired permission level. The permission levels have a hierarchical relationship. To grantAllow editing, you must also grant the permissions included in Allow viewing.