InsionInsion
Swift

List users

Query organization users with filters and cursor pagination.

listUsers returns users for the authenticated organization. It is asynchronous, throws ApiError on failure, and returns one page at a time.

let page = try await client.listUsers(
    limit: 25,
    email: "member@example.com",
    status: .suspended
)

for user in page.data {
    print(user.id, user.clientId, user.actionStatus)
}

Signature and filters

func listUsers(
    limit: Int? = nil, startingAfter: String? = nil, endingBefore: String? = nil,
    clientId: String? = nil, email: String? = nil,
    status: GetApiV1UsersRequestStatus? = nil, user: String? = nil,
    requestOptions: RequestOptions? = nil
) async throws -> ListUsersResponse
ParameterDescription
limitMaximum users in this page.
startingAfter / endingBeforeForward or backward cursor, using an Insion user ID. Do not combine them.
clientIdFilter by your user identifier.
emailFilter by user email.
status.compliant, .suspended, or .banned.
userFilter by an Insion user ID.

Response and pagination

ListUsersResponse has data: [User] and hasMore. Each user includes its Insion id, your clientId, profile fields, protection flag, metadata, action status, timestamps, and appeal URL state. When hasMore is true, use page.data.last?.id as the next startingAfter cursor with the same filters.

Use the returned Insion id, not clientId, for user, cursors, Retrieve a user, and Create an appeal.

On this page