API

PhoneNumber

A user's phone number.

Operations

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

Method Route SDK operation Returns
POST /application/users/{userId}/phone-numbers create OK

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:

created, err := client.PhoneNumber(nil).Create(map[string]any{"user_id": 1}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

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

local created, err = client:PhoneNumber():create({ user_id = 1 })

PHP

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

$created = $client->PhoneNumber()->create(["user_id" => 1]);

Python

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

created = client.PhoneNumber().create({ "user_id": 1 })

Ruby

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

created = client.PhoneNumber.create({ "user_id" => 1 })

TypeScript

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

const created = await client.PhoneNumber().create({ user_id: 1 })

Fields

Field Type Required Description
clientId string No Client ID of which this phone number belongs to.
id integer No ID of the phone number.
phoneNumber string No A text representation of phone number.
type string No Type of phone number when used in authentication.
verified boolean No Indicator if phone number is verified.

create

POST /application/users/{userId}/phone-numbers

Operation ID: userSecurityPhoneNumberCreate.

Authentication: bearer token (ClientCredentialsToken).

Parameters

Parameter In Type Required Description
userId path integer (int64) Yes 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
phoneNumber string No A valid phone number in string.

Responses

200: OK

application/json

Property Type Required Description
clientId string No Client ID of which this phone number belongs to.
id integer (int64) No ID of the phone number.
phoneNumber string No A text representation of phone number.
type string No Type of phone number when used in authentication. Only PRIMARY is supported at the moment.
verified boolean No Indicator if phone number is verified.
422: The phone number is already associated with another account

application/json

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

Example response:

{
  "errors": [
    {
      "code": "phone.number.repeated",
      "message": "It's linked to an account with the email ****@wise.com"
    }
  ]
}
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.