Skip to main content
PATCH
/
users
/
{user_id}
/
phones
/
{phone_id}
Update phone number
curl --request PATCH \
  --url https://api.wacht.dev/users/{user_id}/phones/{phone_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone_number": "9876543210",
  "country_code": "+1",
  "verified": true,
  "is_primary": true
}
'
{
  "id": "1111111111",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "user_id": "1234567890",
  "phone_number": "1234567890",
  "country_code": "+1",
  "verified": true,
  "verified_at": "2024-01-15T10:36:00Z"
}

Authorizations

Authorization
string
header
required

API key authentication (Bearer token)

Path Parameters

user_id
string
required

User ID (integer as string)

phone_id
string
required

Phone ID (integer as string)

Body

application/json
phone_number
string

Phone number (without country code)

Example:

"9876543210"

country_code
string

Country code (with +)

Example:

"+1"

verified
boolean

Whether the phone number is verified

Example:

true

is_primary
boolean

Set as primary phone number

Example:

true

Response

Phone number updated successfully

id
string
required

Phone ID (integer serialized as string)

Example:

"1111111111"

created_at
string<date-time>
required

Creation timestamp

Example:

"2024-01-15T10:30:00Z"

updated_at
string<date-time>
required

Last update timestamp

Example:

"2024-01-15T10:30:00Z"

user_id
string
required

User ID (integer serialized as string)

Example:

"1234567890"

phone_number
string
required

Phone number (without country code)

Example:

"1234567890"

country_code
string
required

Country code (with +)

Example:

"+1"

verified
boolean
required

Whether the phone has been verified

Example:

true

verified_at
string<date-time>
required

Verification timestamp

Example:

"2024-01-15T10:36:00Z"