Skip to main content
dmittman
Nov 10, 2026 7:43 PM UTC
Question

API Credential: the app's "key name" field is username in the CLI

The first field of an API Credential item is labeled key name in the 1Password app (8.x for Mac). In op (2.41.1) and in the item JSON, the same field is "id": "username", "label": "username", and op item template get "API Credential" lists it as username. Nothing in the app tells you that, and I couldn't find it in the CLI docs.

I write API Credential items from scripts. I put the token's owner (a GitHub login) in username, which looked right from the CLI side, and added a custom field for the token's name on the issuing site. In the app, that showed the owner as the key name. I moved the owner to a custom field and the token's name into username once I noticed.

To reproduce:

  1. Create an API Credential item in the app and fill in key name.
  2. Run op item get <item> --format json | jq '.fields[] | {id, label, value}'.
  3. The value you typed is in the field with id and label username.

Requests:

  • Use one name for the field in both places, or document the mapping on the item-fields page of the CLI docs.
  • Say what "key name" is meant to hold. I took it to mean the token's name on the site that issued it (for example a GitHub token's note).