Skip to content

ts api-keys

List the API keys issued on this server.

Usage

text
ts api-keys

Description

API keys authenticate automation — build agents, scripts, and anything else that needs to reach the API without a person signing in. ts api-keys lists them with who owns each one and when it expires.

The key values themselves are never shown. They are displayed once at creation and not stored in a form the server can hand back, so a key that has been lost has to be revoked and reissued rather than looked up. What you see here is enough to identify a key — its name, owner, and expiry — and nothing that would let you use it.

Use this to find keys that have outlived their purpose. A key with no expiry belonging to a departed contractor is the thing worth looking for.

To create or revoke one, use ts api-key. This command only lists.

Options

FlagDescriptionDefault/ValuesNotes
--csvTab-separated, untruncated.For piping into other tools.
--no-truncDo not truncate columns.

Examples

bash
# Every key
ts api-keys

# Feed them somewhere else
ts api-keys --csv

# As data
ts api-keys --format=json

Exit Codes

0 on success. -4 when no account is signed in. -5 when the account is not a Server Administrator.

  • ts user — The accounts keys belong to.
  • ts audit — When keys were created and revoked, and by whom.