Skip to content

List Users

GET
/api/v1/sectors/{sectorID}/users
curl --request GET \
--url https://api.spartanauth.com/api/v1/sectors/example/users

Returns 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.

sectorID
required
string

Required: The sector to list users from

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)

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
}

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"
}
]
}