API

User

A user: create one, check one exists, get one, or set its contact email.

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /user/signup/registration_code create OK - User is created successfully
POST /users/exists create OK - Successfully checked user existence
GET /users/{userId} load OK - Successfully retrieved user
GET /users/{userId}/contact-email load OK - Successfully retrieved contact email address
GET /me load OK - Successfully retrieved user
PUT /users/{userId}/contact-email update OK - Contact email address set successfully

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

user, err := client.User(nil).Load(map[string]any{"id": 1}, nil)
if err != nil {
    panic(err)
}
fmt.Println(user)
created, err := client.User(nil).Create(map[string]any{"email": "example", "registrationCode": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.User(nil).Update(map[string]any{"id": 1, "email": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)

Lua

Construct client as shown in the Lua setup, then call the operations:

local user, err = client:User():load({ id = 1 })
local created, err = client:User():create({ email = "example", registrationCode = "example" })
local updated, err = client:User():update({ id = 1, email = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$user = $client->User()->load(["id" => 1]);
$created = $client->User()->create(["email" => "example", "registrationCode" => "example"]);
$updated = $client->User()->update(["id" => 1, "email" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

user = client.User().load({"id": 1})
created = client.User().create({ "email": "example", "registrationCode": "example" })
updated = client.User().update({"id": 1, "email": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

user = client.User.load({ "id" => 1 })
created = client.User.create({ "email" => "example", "registrationCode" => "example" })
updated = client.User.update({ "id" => 1, "email" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const user = await client.User().load({ id: 1 })
const created = await client.User().create({ email: "example", registrationCode: "example" })
const updated = await client.User().update({ id: 1, email: "example" })

Fields

Field Type Required Description
active boolean No If user is active or not.
details one,object,null No User details.
email string No User's email.
id integer No User ID.
language string No User default language for UI and email communication.
name one,string,null No User's full name.
registrationCode string Yes Randomly generated registration code that is unique to this user and request.

create

POST /user/signup/registration_code

Operation ID: userCreate.

Authentication: bearer token (ClientCredentialsToken).

Parameters

Parameter In Type Required Description
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Request body

application/json

Property Type Required Description
email string (email) Yes New user's email address.
language string No 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.
registrationCode string Yes 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.

Responses

200: OK - User is created successfully

application/json

Property Type Required Description
active boolean No If user is active or not.
details object,null No User details.
details.address object No User's address.
details.address.city string No Address city name.
details.address.countryCode string No Address country code in 2 digits. "US" for example.
details.address.firstLine string No Address first line.
details.address.occupation string No User occupation. Required for US, CA, JP.
details.address.postCode string No Address post code.
details.address.state string No Address state code. Required if country is US, CA, AU, or BR.
details.avatar string No Link to person avatar image.
details.dateOfBirth string (date) No Date of birth (YYYY-MM-DD).
details.firstName string No User's first name.
details.lastName string No User's last name.
details.occupation string No Person's occupation.
details.phoneNumber string No Phone number.
details.primaryAddress integer (int64) No Address object ID to use in addresses endpoints.
email string No User's email.
id integer (int64) No User ID.
name string,null No User's full name.

Example response:

{
  "active": true,
  "details": null,
  "email": "new.user@domain.com",
  "id": 12345,
  "name": null
}
409: Conflict - User already exists

application/json

Property Type Required Description
errors array of object No
errors[].arguments array of string No
errors[].code string No
errors[].message string No
errors[].path string No

Example response:

{
  "errors": [
    {
      "arguments": [
        "email",
        "class com.transferwise.fx.api.ApiRegisterCommand",
        "existing.user@domain.com"
      ],
      "code": "NOT_UNIQUE",
      "message": "You're already a member. Please login",
      "path": "email"
    }
  ]
}
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

POST /users/exists

Operation ID: userCheckExists.

Authentication: bearer token (ClientCredentialsToken).

Parameters

Parameter In Type Required Description
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Request body

application/json

Property Type Required Description
email string (email) Yes User's email address.

Responses

200: OK - Successfully checked user existence

application/json

Property Type Required Description
exists boolean No Whether a user with this email already exists.

Example response:

{
  "exists": true
}
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

load

GET /users/{userId}

Operation ID: userGetById.

Authentication: bearer token (UserToken) or bearer token (PersonalToken).

Parameters

Parameter In Type Required Description
userId path integer (int64) Yes The user ID.
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Responses

200: OK - Successfully retrieved user

application/json

Property Type Required Description
active boolean No If user is active or not.
details object,null No User details.
details.address object No User's address.
details.address.city string No Address city name.
details.address.countryCode string No Address country code in 2 digits. "US" for example.
details.address.firstLine string No Address first line.
details.address.occupation string No User occupation. Required for US, CA, JP.
details.address.postCode string No Address post code.
details.address.state string No Address state code. Required if country is US, CA, AU, or BR.
details.avatar string No Link to person avatar image.
details.dateOfBirth string (date) No Date of birth (YYYY-MM-DD).
details.firstName string No User's first name.
details.lastName string No User's last name.
details.occupation string No Person's occupation.
details.phoneNumber string No Phone number.
details.primaryAddress integer (int64) No Address object ID to use in addresses endpoints.
email string No User's email.
id integer (int64) No User ID.
name string,null No User's full name.
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

GET /users/{userId}/contact-email

Operation ID: userContactEmailGet.

Authentication: bearer token (UserToken).

Parameters

Parameter In Type Required Description
userId path integer (int64) Yes The user ID.
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Responses

200: OK - Successfully retrieved contact email address

application/json

Property Type Required Description
email string (email) No Contact email address.

Example response:

{
  "email": "new-user@email.com"
}
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

GET /me

Operation ID: userGetByToken.

Authentication: bearer token (UserToken) or bearer token (PersonalToken).

Parameters

Parameter In Type Required Description
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Responses

200: OK - Successfully retrieved user

application/json

Property Type Required Description
active boolean No If user is active or not.
details object,null No User details.
details.address object No User's address.
details.address.city string No Address city name.
details.address.countryCode string No Address country code in 2 digits. "US" for example.
details.address.firstLine string No Address first line.
details.address.occupation string No User occupation. Required for US, CA, JP.
details.address.postCode string No Address post code.
details.address.state string No Address state code. Required if country is US, CA, AU, or BR.
details.avatar string No Link to person avatar image.
details.dateOfBirth string (date) No Date of birth (YYYY-MM-DD).
details.firstName string No User's first name.
details.lastName string No User's last name.
details.occupation string No Person's occupation.
details.phoneNumber string No Phone number.
details.primaryAddress integer (int64) No Address object ID to use in addresses endpoints.
email string No User's email.
id integer (int64) No User ID.
name string,null No User's full name.
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

update

PUT /users/{userId}/contact-email

Operation ID: userContactEmailSet.

Authentication: bearer token (UserToken).

Parameters

Parameter In Type Required Description
userId path integer (int64) Yes The user ID.
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Request body

application/json

Property Type Required Description
email string (email) No Contact email address.

Responses

200: OK - Contact email address set successfully

application/json

Property Type Required Description
email string (email) No Contact email address.

Example response:

{
  "email": "new-user@email.com"
}
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.