Forum Discussion
Unable to create new item with empty password with cli
I believe I figured out what's happened here. I just ran into this today with an item created using the latest version of the MacOS desktop client (1Password for Mac 8.10.56 (81056028)). I create a Password-type item, pasted some text into the password, saved it, and subsequently removed the password value - I intended to store a multi-value secret where there was no one "password" but a few distinct fields.
I found this post and figured I'd inspect the actual JSON and it became obvious once I did op item get --format=json .... The password field has no value, but is present and shows the previous value in the history. I suspect the CLI validation is simply inconsistent with how the 1Password apps validate/format this, and it also looks like it's probably for UX such as for retaining history.
Here's what the JSON looked like (just those CONCEALED extra fields removed and things stripped out for ....
```
{
"id": "...",
"title": "...",
"version": "...",
"vault": {
"id": "...",
"name": "..."
},
"category": "PASSWORD",
"last_edited_by": "...",
"created_at": "2025-01-18T08:36:08Z",
"updated_at": "2025-01-18T20:04:58Z",
"additional_information": "2025-01-18 12:36 AM",
"sections": [
{
"id": "add more"
}
],
"fields": [
{
"id": "password",
"type": "CONCEALED",
"purpose": "PASSWORD",
"label": "password",
"reference": "op://.../.../password",
"password_details": {
"history": ["... some previous value"]
}
},
{
"id": "notesPlain",
"type": "STRING",
"purpose": "NOTES",
"label": "notesPlain",
"value": "...",
"reference": "op://.../.../notesPlain"
}
// additional fields ...
]
}
```