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.
Create a vault
- Go
- JavaScript
- Python
Use the
Vaults().Create() method to create a new vault. This method requires a VaultCreateParams struct with the following fields:Title: The name of the vault.Description: An optional pointer to a string containing the vault’s description.
Vault struct.Get a vault overview
- Go
- JavaScript
- Python
Use the
Vaults().GetOverview() method with the unique identifier (ID) of a vault to retrieve high-level metadata about the vault.The following example gets the overview for the vault you created in the previous step.Get vault details
- Go
- JavaScript
- Python
Use the
Vaults().Get() method with the unique identifier (ID) of a vault to get the vault’s full metadata.The following example gets details for the vault you retrieved in the previous step.Update a vault
- Go
- JavaScript
- Python
Use the
Vaults().Update() method to modify the details of an existing vault. This method requires the following:vaultID: The unique identifier of the vault you want to update.- A
VaultUpdateParamsstruct that contains the new vault details:Title: The new name for the vault.Description: An updated description for the vault.
Vault struct.The following example updates the name and description of the vault you created in the first step.Delete a vault
- Go
- JavaScript
- Python
To delete a vault, use the
Vaults().Delete() method with the unique identifier of the vault you want to delete.The following example deletes the vault you created in the first step.