# User In our API, a User serves as the primary entity and can possess multiple Profiles to represent different contexts or settings. Specifically, a User can have one personal Profile and multiple business Profiles. Each [Profile](/api-reference/profile) - whether personal or business - can have its own [multi-currency account](/api-reference/multi-currency-account), enabling transactions across various currencies. This hierarchical structure allows for flexible management of user settings and financial operations, accommodating both personal and business needs. ```mermaid graph TD A[User] --> B[Personal Profile] A[User] --> C[Business Profile] B[Personal Profile] --> D[Multi Currency Account] C[Business Profile] --> E[Multi Currency Account] ``` Operations ## The User resource Fields id userId name User's full name email User's email active If user is active or not details.firstName User's first name details.lastName User's lastname details.phoneNumber Phone number details.dateOfBirth Date of birth details.occupation Person's occupation details.avatar Link to person avatar image. details.primaryAddress Address object ID to use in addresses endpoints details.address.countryCode Address country code in 2 digits. "US" for example details.address.firstLine Address first line details.address.postCode Address post code details.address.city Address city name details.address.state Address state code State code. Required if country is US, CA, AU, BR. details.address.occupation User occupation. Required for US, CA, JP User Object ```json { "id": 101, "name": "Example Person", "email": "person@example.com", "active": true, "details": { "firstName": "Example", "lastName": "Person", "phoneNumber": "+37111111111", "occupation": "", "address": { "city": "Tallinn", "countryCode": "EE", "postCode": "11111", "state": "", "firstLine": "Road 123" }, "dateOfBirth": "1977-01-01", "avatar": "https://lh6.googleusercontent.com/photo.jpg", "primaryAddress": 111 } } ``` ## Retrieve current user by token **`GET /v1/me`** Get authenticated user details for the user's token submitted in the Authorization header. Response includes also personal user's profile info. #### Response Returns a [user object](/api-reference/user#object) Example Request ```bash curl -X GET \ https://api.sandbox.transferwise.tech/v1/me \ -H 'Authorization: Bearer ' ``` ## Retrieve a user by Id **`GET /v1/users/{{userId}}`** Get authenticated user details by user ID. Response includes also personal user's profile info. #### Response Returns a [user object](/api-reference/user#object) Example Request ```bash curl -X GET \ https://api.sandbox.transferwise.tech/v1/users/{{userId}} \ -H 'Authorization: Bearer ' ``` ## Create a user with a registration code **`POST /v1/user/signup/registration_code`** Wise uses email address as unique identifier for users. If email is new (there is no active user already) then new user will be created. When you are submitting an email which already exists amongst our users then you will get a warning that "You’re already a member. Please login". If user already exists then you need to redirect to "Get user authorization" webpage. Request email New user's email address registrationCode Randomly generated registration code that is unique to this user and request. At least 32 characters long. You need to store registration code to obtain access token on behalf of this newly created user in next step. Please apply the same security standards to handling registration code as if it was a password. language (Optional) User default language for UI and email communication. Allowed values EN, US, PT, ES, FR, DE, IT, JA, RU, PL, HU, TR, RO, NL, HK. Default value EN. Response id userId name User full name. Empty. email Customer email active true details User details. Empty. Example Request ```bash curl -X POST \ https://api.sandbox.transferwise.tech/v1/user/signup/registration_code \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "email": "user@email.com", "registrationCode": , "language": "EN" }' ``` Example Response (Success: 200 - User is created successfully) ```json { "id": 12345, "name": null, "email": "new.user@domain.com", "active": true, "details": null } ``` Example Response (Failure: 409 - User already exists) ```json { "errors": [ { "code": "NOT_UNIQUE", "message": "You’re already a member. Please login", "path": "email", "arguments": [ "email", "class com.transferwise.fx.api.ApiRegisterCommand", "existing.user@domain.com" ] } ] } ``` ## Check User Exists **`POST /v1/users/exists`** Wise uses email address as unique identifier for users. If email has already been used by a user, it cannot be reused to create a new user. Note that this uses a `client-credentials-token` and not a `user access_token` for authentication. Request email User's email address Response exists Email has already exist Example Request ```bash curl -X POST \ https://api.sandbox.transferwise.tech/v1/users/exists \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "email": "test@wise.com" }' ``` Example Response (Success: 200 - User is created successfully) ```json { "exists": true } ``` ## Set a contact email address **`PUT /v1/users/{{userId}}/contact-email`** Sets a contact email address. The contact email address is used to send notifications to users who have been registered with a dummy email address. Request email Contact email address Response email Contact email address Example Request ```bash curl -X PUT \ https://api.sandbox.transferwise.tech/v1/users/{{userId}}/contact-email \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "email": "new-user@email.com" }' ``` Example Response ```json { "email": "new-user@email.com" } ``` ## Retrieve a contact email address **`GET /v1/users/{{userId}}/contact-email`** Retrieves a contact email address. #### Response Returns a contact email object. Response email Contact email address Example Request ```bash curl -X GET \ https://api.sandbox.transferwise.tech/v1/users/{{userId}}/contact-email \ -H 'Authorization: Bearer ' ``` Example Response ```json { "email": "new-user@email.com" } ```