InsionInsion
Swift

Retrieve a user

Fetch a user by its Insion user ID.

retrieveAUser fetches one stored user. Pass the Insion user ID returned by ingestion or a list response; your external clientId is not the path identifier for this operation.

let response = try await client.retrieveAUser(userId: "usr_123")
let user = response.data

print(user.email)
print(user.actionStatus)
print(user.appealUrl)

Signature and result

func retrieveAUser(
    userId: String,
    requestOptions: RequestOptions? = nil
) async throws -> UserResponse

UserResponse.data contains the User model: identifiers, optional profile fields, protected, metadata, timestamps, optional action status and its timestamp, plus the appeal URL state. Profile and state fields can be represented with Nullable<T>; code consuming them must account for an explicit null value.

A non-existent user, invalid token, or inaccessible user produces ApiError.httpError. If all you have is an external identifier or email, first use List users to locate the Insion ID instead of treating clientId as userId.

On this page