Update Phone Number Details
PUT Method
The Update Phone Number DetailsAPI allows you to modify your existing phone number and ensure your contact information remains accurate and up to date.
You can update both the WhatsApp business phone numbers associated with a Kaleyra V1 API WABA and with a Kaleyra V2 API WABA. You can check to which API version your WABA is associated with in the WhatsApp section of your Kaleyra CpaaS account.
Prerequisites
- Know Your Customer (KYC) approval is mandatory. For more information on submission and approval, see Completing the Know Your Customer page.
- For prepaid customers, the credit balance should be sufficient to purchase numbers, make and receive calls, and monthly subscription charges. For more information on balance details, see Adding Credits page.
- You must have Proof of Business/Business Address and Proof of Identification (Individual/Company-Signatory) depending on the regulations of that particular region or country.
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform. - To set up a WhatsApp account on Kaleyra platform, see Manual Signup
and Embedded Signup. - An active WhatsApp for Business API plan that includes:
- A WhatsApp verified and approved profile.
- A WABA ID onboarded on Kaleyra WhatsApp API.
API Domain and Value
| api_domain | Value |
|---|---|
| IN pod | api.in.kaleyra.io |
| SG Pod | api.ap.kaleyra.io |
| EU Pod | api.eu.kaleyra.io |
| NA pod | api.na.kaleyra.io |
API Request to Update Phone Number Details
To update the phone number details, use the https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/number/update endpoint with the following request method:
The following is the request format to update phone number details:
curl --location --request PUT 'http://<api_domain>/v2/<sid>/whatsapp/<waba_id>/number/update' \
-H 'api-key: <api-key>' \
-H 'Content-Type: <content-type>' \
--data-raw '{
"phone_number": "<phone_number>",
"address": "<address>",
"description" : "<description>",
"incoming_url": "<incoming_url>",
"category" : "<category>",
"email": "<email>",
"about": "<about>",
"callback_profile_id": "<callback_profile_id>",
"outgoing_callback_profile_id": "<outgoing_callback_profile_id>"
}'The following is the sample request format to update phone number details:
curl --location --request PUT 'http://<api_domain>/v2/HXAP16XXXXXX97IN/whatsapp/766XXXXXXXXXX/number/update' \
-H 'api-key: AXXXXXXXXXXXXXXXXXXXXXXXXX3' \
-H 'Content-Type: application/json' \
--data-raw '{
"phone_number": "+914846XXXXXX",
"address": "EGL",
"description" : "Beauty Products",
"incoming_url": "https://XXXXXX.free.beeceptor.com",
"category" : "BEAUTY_SPA_SALON",
"email": "[email protected]",
"about": "Body Care (Body Lotion)"
"callback_profile_id": "e5a4f212-b0b0-4c77-9f04-7bXXXXXXd34f",
"outgoing_callback_profile_id": "aasfc4b4-b700-4aec-be15-b6e7XXXXXXXf"
}'URL Parameters and Headers
The following is the list of parameters and headers to send the outgoing message request:
| Parameter / Headers | Data Type | Description | Example | Mandatory? |
|---|---|---|---|---|
sid | String | Account SID (Security Identifier). | HXAP16XXXXXX97IN | Yes |
waba_id | String | The waba_id associated with the WhatsApp Business Account. For more information, see step 1 to step 3 of Adding a new WABA ID. | 766XXXXXXXXXX | Yes |
api-key | String | API key generated from kaleyra.io account. | AXXXXXXXXXXXXXXXXXXXXXXXXX3 | Yes |
Content-Type | String | Indicates the format of the content the API will be processing. | The only allowed value is application/json. | Yes |
The following is the list of attributes to be used in the payload to update phone number details in JSON format:
Parameter | Data Type | Description | Example | Mandatory? |
|---|---|---|---|---|
| String | Phone Number whose details are required to be updated. Numbers must contain country code. | +914846XXXXXX | Yes |
| String | Address of the business. Note: The maximum character limit is set to 256 characters. | EGL | No |
| String | Description about the business. | Beauty Products | No |
| String | Incoming URL on which status updates for incoming message are sent (only applicable for V1 version phone numbers). | No | |
| String | The category of the business. Note: The following are the valid values: AUTOMOTIVE, BEAUTY_SPA_SALON, CLOTHING_APPAREL, EDUCATION, ENTERTAINMENT, EVENT_PLANNING_SERVICE, FINANCE_AND_BANKING, FOOD_GROCERY, PUBLIC_SERVICE, HOTEL_LODGING, MEDICAL_HEALTH, NON_PROFIT, PROFESSIONAL_SERVICES, SHOPPING_RETAIL, TRAVEL_TRANSPORTATION, RESTAURANT, OTHER. | BEAUTY_SPA_SALON | No |
| String | Valid email address. | No | |
| String | About information of the business. Note: The maximum character limit is set to 139 characters. | Body Care (Body Lotion) | No |
| String | Callback profile Id created on Kaleyra platform. (For incoming messages, this applies only to V2 version phone numbers). | e5a4f212-b0b0-4c77-9f04-7bXXXXXXd34f | No |
| String | Outgoing callback profile Id created on Kaleyra platform for outgoing messages. | aasfc4b4-b700-4aec-be15-b6e7XXXXXXXf | No |
Sample Success Response
The following is the sample success response.
{
"code": "WA200",
"message": "Request Processed Successfully",
"data": 1,
"error": {}
} Sample Failure Response
The following are the failure responses:
{
"code": "RBC001",
"message": "Incorrect SID or API key.",
"data": [],
"error": {
"body": "Incorrect SID or API key.",
"error": "record not found"
}
} {
"code": "WA401",
"message": "Waba_id is not present or does not belong to the account.",
"data": {},
"error": {
"waba_id": "Waba_id is not present or does not belong to the account."
}
}{
"code": "E112",
"message": "invalid Phone Number or Phone Number Not Found",
"data": [],
"error": {}
}{
"code": "WA400",
"message": "please provide valid phone_number",
"data": {},
"error": {
"error": "please provide valid phone_number"
}
}{
"code": "WA400",
"message": "invalid email format",
"data": {},
"error": {
"error": "invalid email format"
}
}
{
"code": "WA400",
"message": "description exceeds maximum character limit of 256 characters",
"data": {},
"error": {
"error": "description exceeds maximum character limit of 256 characters"
}
}{
"code": "WA400",
"message": "address exceeds maximum character limit of 256 characters",
"data": {},
"error": {
"error": "address exceeds maximum character limit of 256 characters"
}
}{
"code": "WA400",
"message": "about info exceeds maximum character limit of 139 characters",
"data": {},
"error": {
"error": "about info exceeds maximum character limit of 139 characters"
}
}{
"code": "WA400",
"message": "Refer to correct payload format ",
"data": {},
"error": {
"payload": "Incorrect payload format"
}
}{
"code": "WA400",
"message": "business_catregory value is invalid. Valid values are : AUTOMOTIVE, BEAUTY_SPA_SALON, CLOTHING_APPAREL, EDUCATION, ENTERTAINMENT, EVENT_PLANNING_SERVICE, FINANCE_AND_BANKING, FOOD_GROCERY, PUBLIC_SERVICE, HOTEL_LODGING, MEDICAL_HEALTH, NON_PROFIT, PROFESSIONAL_SERVICES, SHOPPING_RETAIL, TRAVEL_TRANSPORTATION, RESTAURANT, OTHER",
"data": {},
"error": {
"error": "business_catregory value is invalid. Valid values are : AUTOMOTIVE, BEAUTY_SPA_SALON, CLOTHING_APPAREL, EDUCATION, ENTERTAINMENT, EVENT_PLANNING_SERVICE, FINANCE_AND_BANKING, FOOD_GROCERY, PUBLIC_SERVICE, HOTEL_LODGING, MEDICAL_HEALTH, NON_PROFIT, PROFESSIONAL_SERVICES, SHOPPING_RETAIL, TRAVEL_TRANSPORTATION, RESTAURANT, OTHER"
}
}{
"code": "WA500",
"message": "Please try again later",
"data": {},
"error": {
"error": "Internal server error"
}
}Updated about 18 hours ago
