List API Tokens
GET
/api/v1/sectors/{sectorID}/tokens
const url = 'https://api.spartanauth.com/api/v1/sectors/example/tokens';const options = {method: 'GET'};
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://api.spartanauth.com/api/v1/sectors/example/tokensLists the stored API tokens for a sector, including metadata such as name, prefix, and last-used timestamp. Requires a valid bearer token and sector-admin or default-sector-admin access.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” sectorID
required
string
Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
tokens
Array<object>
API Token messagesobject
id
string
name
string
sectorID
string
prefix
first 8 chars of the token for identification
string
createdAt
string format: int64
lastUsedAt
string format: int64
Example generated
{ "tokens": [ { "id": "example", "name": "example", "sectorID": "example", "prefix": "example", "createdAt": "example", "lastUsedAt": "example" } ]}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}