Set a token-specific label

You can affix a plain-text, user-specific label to tokens you generate with the RBAC v1 API. Token labels help you quickly call a token when working with RBAC API endpoints or when revoking your own token.

To generate a token with a label, use the label key in requests to the POST /auth/token endpoint. The value of the label key becomes the token's label. For example:

{"login": "<YOUR_PE_USER_NAME>",
 "password": "<YOUR_PE_PASSWORD>",
 "label": "My token"}

Labels:

  • Can't have more than 200 characters.
  • Can't contain commas.
  • Can't contain only spaces.

Whitespace is allowed within the label string; however, leading and trailing whitespace is trimmed. For example, " my token label " becomes "my token label".

Token labels are assigned on a per-user basis. This means two users can both have a token labelled my token, but a single user cannot have two tokens both labelled my token.

You cannot use labels to refer to other users’ tokens.