List Users
GET
/api/v1/sectors/{sectorID}/users
const url = 'https://api.spartanauth.com/api/v1/sectors/example/users';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/usersReturns a paginated list of users in a sector with optional search, filtering, and sorting. Requires a valid bearer token and either sector-admin/default-sector-admin access or a sector setting that allows non-admin user reads.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” sectorID
required
string
Required: The sector to list users from
Query Parameters
Section titled “Query Parameters ” pageSize
integer format: int32
Pagination: Number of results per page
page
integer format: int32
Pagination: Page number (1-based)
searchTerm
string
Search by name, email, username
filterEmail
string
Filter by exact email match
filterVerified
string
Filter by verification status (true/false)
sortBy
string
Sort field (name, email, created_at, updated_at)
sortDesc
boolean
Sort direction (true for descending)
Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
users
Array<object>
object
sub
string
email
string
name
string
emailVerified
boolean
phoneVerified
boolean
createdAt
string format: int64
updatedAt
string format: int64
isAdmin
boolean
inviteStatus
Status of invite: "pending", "active", "expired", or empty
string
totalCount
Total number of users matching the query
integer format: int32
totalPages
Total number of pages
integer format: int32
currentPage
Current page number
integer format: int32
Example generated
{ "users": [ { "sub": "example", "email": "example", "name": "example", "emailVerified": true, "phoneVerified": true, "createdAt": "example", "updatedAt": "example", "isAdmin": true, "inviteStatus": "example" } ], "totalCount": 1, "totalPages": 1, "currentPage": 1}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" } ]}