Skip to main content
principal_is_not_the_caller means you tried to create an API key that acts as a different user. Read this page if you create keys for other people or for services.

What happened

Route: POST /v1/keys. A key’s principal says who it acts as. The body set principal to {"type": "user", "id": X}, where X is not you. Nobody can mint a key that acts as another person, so no key was created.

How to fix

  • For your own use: omit principal.
  • For a service or pipeline: use a service-account principal, with an id that names the service. Creating one needs members_write, which owners and admins hold.
  • For another person: ask them to create their own key.

Example

Creating a service-account key. The call needs keys_write and members_write.