ts.usr.list

Query users with filters.

Query users with filters.

Requires authentication

Description

Lists users with optional filtering and pagination.

Requires authentication. Results are filtered based on the caller’s permissions:

  • Regular users see users in their organizations
  • Admins can see all users

Parameters

NameTypeRequiredDefaultDescription
statusstringFilter by status: active, inactive, suspended
organization_idstringFilter by organization membership
searchstringSearch by name or email (partial match)
limitinteger50Maximum number of results to return
offsetinteger0Number of results to skip (for pagination)

Response

Returns a list of users matching the filters.

{
  "limit": 50,
  "offset": 0,
  "total": 42,
  "users": [
    {
      "email": "smith@example.com",
      "id": "usr_01H8X9ABCDEF",
      "name": "Agent Smith",
      "status": "active"
    },
    {
      "email": "jones@example.com",
      "id": "usr_01H8X9GHIJKL",
      "name": "Agent Jones",
      "status": "active"
    }
  ]
}

Errors

CodeDescription
not_authenticatedNo active login for this session

Examples

List active users

Get all active users.

Request:

{
  "status": "active"
}

Response:

{
  "limit": 50,
  "offset": 0,
  "total": 1,
  "users": [
    {
      "email": "smith@example.com",
      "id": "usr_01H8X9ABCDEF",
      "name": "Agent Smith",
      "status": "active"
    }
  ]
}

Search users

Search for users by name or email.

Request:

{
  "limit": 10,
  "search": "smith"
}

Response:

{
  "limit": 10,
  "offset": 0,
  "total": 1,
  "users": [
    {
      "email": "smith@example.com",
      "id": "usr_01H8X9ABCDEF",
      "name": "Agent Smith",
      "status": "active"
    }
  ]
}