(1P/DC) Obtaining UUID references in GUI
Description
In order to utilize the command line or Python SDK to read or write information to items within 1Password, you must either know the exact name (and accounting for special characters, etc) of the vault, item and field to obtain information or use the UUID codes (which are alphanumeric keys) of the vault, item and field.
The following steps provide various ways you can obtain the UUID for the vault, item and/or field.
Table of Contents
Web Based GUI
Using the web-based GUI, there is no explicit way to obtain the UUIDs of the vault and item, so you have to use a work around. Log into the 1Password Web GUI. Select the vault and then the item. In the upper-right corner of the window, you should observe three controls: Share, Edit and three dots (see below). Click the three vertical dots and choose “Copy Link” or “Copy Private Link”. This link contains the the vault and item UUIDs.
The copied link will be a URL in the following format:
https://start.1password.com/open/i?a=ACCOUNT_UUID&v=VAULT_UUID &i=ITEM_UUID &h=my.1password.com
Account, Vault, and Item UUID are always 26 character alphanumeric characters long.
Application GUI
Only tested on the Apple Macintosh 1Password application.
Open and authenticate to the 1Password application. Navigate to the vault, then the item that you want to obtain the UUID.
Vault UUID
Right-click on the vault in the left-column (list of vaults) and choose “Copy Vault UUID”.
Item UUID
Make sure you in the correct vault by clicking the vault. Then navigate to the item you want the UUID. Right-click on the item and choose “Copy Item UUID”.
Field UUID
Within the item, hover with your mouse over top of the field you want the UUID for, and click the small down-arrow to the right of the field. Choose “Copy Secret Reference”.
The secret reference contains both the vault UUID, Item UUID, and the field UUID in the following format:
If you field namehave any special characters within, you will be presented with the UUID. However, in some cases, if the field does not have any special characters, you may see represented by its name.
No special characters:"op://VAULT_UUID/ITEM_UUID/SECTION NAME/FIELD NAME"
Command Line GUI
The following 1Password Command Line Utility (op) commands can be used to obtain the UUID of the vault, item or field.
Vault UUID
Obtain the UUID of the vault, so you can use it in the item and field command below.
Return the UUID for a specific vault name.
op vault get "VAULT NAME" --format json | jq -r '.id'
Return a list of all vaults and their respective UUIDs. Here you can just copy the one you want from the list.
op vault list --format json | jq -r '.[] | "\(.name)\t\(.id)"'
Item UUID
Return a list of item UUIDs for all items within the vault UUID. You need to know the vault UUID from above. Copy the one you want from the list.
op item list --vault VAULT_UUID
If the list is long, use the following command to search for a item name (full or partial name):
op item list --vault VAULT_UUID | grep -i FIELD NAME (PARTIAL OR FULL)
Field UUID
Return a list of all fields and their respective UUIDs. You need to know the vault and items UUID from above. Here you can just copy the one you want from the list.
op item get ITEM_UUID --vault VAULT_UUID --format json \ | jq -r '.fields[] | "\(.label)\t\(.id)\t\(.type // "")\t\(.purpose // "")"'
1Password is goofy here, and if a field UUID is missing, it has to be obtained from the secret reference URL, use this command:op item get ITEM_UUID --vault VAULT_UUID --format json | jq -r '.fields[] | [(.label // ""), (.section.label // "(no section)"), (.id // ""), (.reference // "")] | @tsv'
You should get lines that contain the secret reference:"op://VAULT_UUID/ITEM_UUID/SECTION NAME/FIELD UUID"