Phone Numbers

Used to interact with the phone numbers of the logged in user.

Get Phone Numbers

Retrieve all phone numbers associated with the current user.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Responses
200

Returns UserPhoneNumbers array.

401

Request was not successful

403

Request was not successful

404

Request was not successful

get/v1/me/phone_numbers
Response samples
application/json
[
  • {
    }
]

Create Phone Number

Add a phone number to the current user. The phone number then needs to be verified using the sms prepare_verification and attempt_verification endpoints.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Request Body schema: application/x-www-form-urlencoded
phone_number
string

The phone number to be added to the user.

Responses
200

Returns the response for Session wrapped Email object.

400

Request was not successful

401

Request was not successful

403

Request was not successful

404

Request was not successful

422

Request was not successful

post/v1/me/phone_numbers
Request samples
application/x-www-form-urlencoded
phone_number=string
Response samples
application/json
{
  • "response": {
    },
  • "client": {
    }
}

Attempt Phone Number Verification

Attempt to verify the given phone number using the code sent during the prepare_verification step.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
path Parameters
phone_number_id
required
string

The phone_number_id.

query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Request Body schema: application/x-www-form-urlencoded
code
string

Strategy used to verify the phone number.

Responses
200

Returns the response for Session wrapped Email object.

400

Request was not successful

401

Request was not successful

403

Request was not successful

404

Request was not successful

422

Request was not successful

429

Request was not successful

post/v1/me/phone_numbers/{phone_number_id}/attempt_verification
Request samples
application/x-www-form-urlencoded
code=string
Response samples
application/json
{
  • "response": {
    },
  • "client": {
    }
}

Prepare Phone Number Verification

Sends an sms to the phone number with the code needed to verify it.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
path Parameters
phone_number_id
required
string

The phone_number_id.

query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Request Body schema: application/x-www-form-urlencoded
strategy
string

Strategy used to verify the phone number.

Value: "phone_code"
Responses
200

Returns the response for Session wrapped Email object.

400

Request was not successful

401

Request was not successful

403

Request was not successful

404

Request was not successful

429

Request was not successful

post/v1/me/phone_numbers/{phone_number_id}/prepare_verification
Request samples
application/x-www-form-urlencoded
strategy=phone_code
Response samples
application/json
{
  • "response": {
    },
  • "client": {
    }
}

Retrieve Phone Number

Retrieve all properties for the given phone number.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
path Parameters
phone_number_id
required
string

The phone_number_id.

query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Responses
200

Returns the response for Session wrapped Email object.

401

Request was not successful

403

Request was not successful

404

Request was not successful

get/v1/me/phone_numbers/{phone_number_id}
Response samples
application/json
{
  • "response": {
    },
  • "client": {
    }
}

Update Phone Number

Update the properties of the given phone number.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
path Parameters
phone_number_id
required
string

The phone_number_id.

query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Request Body schema: application/x-www-form-urlencoded
reserved_for_second_factor
boolean or null

Whether the phone number is reserved for multi-factor authentication.

default_second_factor
boolean or null

Marks the phone number as the default that will be used in multi-factor authentication.

Responses
200

Returns the response for Session wrapped Email object.

400

Request was not successful

401

Request was not successful

403

Request was not successful

404

Request was not successful

patch/v1/me/phone_numbers/{phone_number_id}
Request samples
application/x-www-form-urlencoded
reserved_for_second_factor=true&default_second_factor=true
Response samples
application/json
{
  • "response": {
    },
  • "client": {
    }
}

Delete Phone Number

Deletes the phone number with the given id.

SecurityNone or DevBrowser or ProductionBrowser or ProductionNativeApp and ProductionNativeFlag)
Request
path Parameters
phone_number_id
required
string

The phone_number_id.

query Parameters
_clerk_session_id
string

The session_id associated with the requesting user.

Responses
200

Returns single DeletedPhoneNumber.

400

Request was not successful

401

Request was not successful

403

Request was not successful

404

Request was not successful

delete/v1/me/phone_numbers/{phone_number_id}
Response samples
application/json
{
  • "response": {
    },
  • "client": {
    }
}