Skip to content

A fleet API key's usage

GET
/api/nss/keys/{id}/usage
curl --request GET \
--url https://example.com/api/nss/keys/example/usage \
--header 'X-Ssoossh-Key-Secret: <X-Ssoossh-Key-Secret>'

Lookups and misses per source address, secret generation and UTC day, newest day first, kept for nss.usage_retention. Counts are written once a minute, so the newest minute is not in them yet. Whoever may view the key.

id
required
string

Key id

after
string

Next_cursor of the previous page

limit
integer

Page size, 1 to 100 (default 25)

One page of usage

Media typeapplication/json
object
data
required
object
next_cursor

NextCursor is the after for the following page, absent on the last.

string
rows
required
Array<object>
object
day
required

Day is midnight UTC of the day counted.

string
first_seen
required
string
generation
required
integer
last_seen
required
string
lookups
required
integer
misses
required
integer
source_ip
required
string
total
required

Total counts every retained row for the key, across all pages.

integer
error
string

Example generated

{
"data": {
"next_cursor": "example",
"rows": [
{
"day": "example",
"first_seen": "example",
"generation": 1,
"last_seen": "example",
"lookups": 1,
"misses": 1,
"source_ip": "example"
}
],
"total": 1
},
"error": "example"
}

A malformed limit or an unknown cursor

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

No valid session

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

No such key the caller may view, or nss_disabled

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}