List API keys
GET
/v1/api-keys
const url = 'https://your-machine.your-tailnet.ts.net/v1/api-keys';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://your-machine.your-tailnet.ts.net/v1/api-keys \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Active keys (never the key itself).
Media typeapplication/json
object
apiKeys
Array<object>
object
id
string format: uuid
name
string
prefix
string
createdAt
string format: date-time
lastUsedAt
string format: date-time
Example
{ "apiKeys": [ { "prefix": "gw_9fJ2" } ]}