Update WhatsApp Number Details

PUT Method

The Update WhatsApp Number Details API is used to update the approved WhatsApp number details. This API is an extension to the User Interface feature of Editing WA Number Details.

You can edit the following details of your number via an API using:

  • Incoming URL (“incoming_url“)
  • Image ("display_image")
  • Address ("address")
  • Business Description ("business_description")
  • Business Category - Exact String match accepted Case insensitive ("business_catregory")
  • Contact Email ("contact_email")
  • Website ("website")
  • About ("about")

📘

Notes:

  • All the fields are optional and any field added to the API will be automatically updated.
  • The wa_number is a mandatory field. You can address at least one editable field.
  • You cannot leave the display_image field, empty and the rest of the fields need to be automatically updated.

Base URL

https://api.kaleyra.io/v1/

To update WhatsApp number details, perform the following steps:

1. Signup or Login to Kaleyra.io and create your API key.

Before you get started, sign up for a Kaleyra.io account for free and create an API key.

📘

Note:

After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in Kaleyra.io.

Prerequisite:

  • A WhatsApp business number.
  • An associated profile with the business number.
  • A WhatsApp verified and approved profile.

For more details, read what WhatsApp has to say about creating a business account.

2. API command to Update WhatsApp Number Details.

Request Format - PUT

To update WhatsApp number details, use the /whatsapp/number endpoints.

curl --location --request PUT '{url}/v1/{SID}/whatsapp/number' \
--header "api-key: <API_KEY>" \
--header "Content-Type: <CONTENT_TYPE>" \
--data-raw '{
    "wa_number":<WA_NUMBER>",
      "address":<ADDRESS>",
    "incoming_url":<INCOMING_URL>",
    "display_image":<DISPLAY_IMAGE>",
    "business_description":<BUSINESS_DESCRIPTION>",
    "business_category":<BUSINESS_CATEGORY>",
    "contact_email":<CONTACT_EMAIL>",
    "website":<WEBSITE>",
    "about":<ABOUT>"
}'

📘

Note:

Replace the placeholders above with relevant values as mentioned below.

Parameters and Variables

The following table displays the parameter and variables used:

Parameter

Variable

Description

Example

Mandatory

SID

String

Account SID (Security Identifier). Generated by Kaleyra.io while creating an API key.

HXXXXXXX071US

True

API_KEY

String

Your API Key generated by Kaleyra.io.

Ac4XXXXX21f

True

CONTENT_TYPE

Alphanumeric

Indicates the format of the content the API will be processing.

application/JSON

True

WA_NUMBER

String

Specifies the registered WhatsApp number in E164 format.

+91XXXXXXXXX2

True

ADDRESS

String

Specifies registered WhatsApp number address.

#567, "Test", 2nd Phase, Bangalore.

False

INCOMING_URL

String

Specifies the URL for which you receive the incoming callback.

https://webhook.site/#!/7aXXXXXX-e1df-4f59-8ddc-55abdaXXXXXX/test

False

DISPLAY_IMAGE

String

Specifies registered WhatsApp display image.

https://s3.ap-south-1.amazonaws.com/stage-hexa/docs/1620380334flower-729512__340.jpg

False

BUSINESS_DESCRIPTION

String

Specifies registered WhatsApp number business description.

Brief description about the Company.

False

BUSINESS_CATEGORY

String

Specifies the registered WhatsApp number business category.
The following are the values accepted for Business Category:
a) Automotive
b) Beauty, Spa, and Salon
c) Clothing and Apparel
d) Education
e)Entertainment
f) Event Planning and Service
g) Finance and Banking
h) Food and Grocery
i) Public Service
j) Hotel and Lodging
k) Medical and Health
l) Non-profit
m)Professional Services
n) Shopping and Retail
o) Travel and Transportation
p) Restaurant
q) Other

Education

False

CONTACT_EMAIL

String

Specifies the registered WhatsApp number contact Email.

[email protected]

False

WEBSITE

String

Specifies the business website.

https://www.kaleyra.com

False

ABOUT

String

Specifies the brief description.

About testing information.

False

Response Format

Success Response

This section provides you the successful JSON response format.

{
    "status": 200,
    "message": "WA Phone number update successfully.",
    "data": [],
    "error": {}
}

Failure Response

The wa_number is a mandatory field and cannot be empty. Pass the wa_number key and value.

{
    "error": {
        "code": "E413",
        "type": "VALIDATION_ERROR",
        "parameter": "wa_number",
        "message": "wa_number field is required and cannot be empty.",
        "reference": ""
    }
}

The display_image cannot be empty. Pass the appropriate value, else do not pass the key.

{
    "error": {
        "code": "E962",
        "type": "VALIDATION_ERROR",
        "parameter": "display_image",
        "message": "display_image cannot be empty",
        "reference": ""
    }
}

Sample Request

The following code is a sample request:

curl --location --request PUT '{url}/v1/{HXXXXXXX071US}/whatsapp/number' \
--header 'api-key: {Ac4XXXXX21f}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "wa_number":"+91XXXXXXXXXX",
      "address":"updated address details",
    "incoming_url":"https://webhook.site/#!/7aXXXXXX-e1df-XXXX-8ddc-55abdaXXXXXX/test",
    "display_image":"https://s3.ap-south-1.amazonaws.com/stage-hexa/docs/1XXXXXXXXXflower-729512__340.jpg",
    "business_description":"testing business description final",
    "business_category":"Medical and Health",
    "contact_email":"[email protected]",
    "website":"https://google.com/testing",
    "about":"about testing info"
}'

Error Codes

The following table provides information about the error codes you would receive when executing the Update WhatsApp Number Details API.

Error Code

Description

E413

wa_number field is required and cannot be empty.

E413

business_description can be a maximum of 139 characters.

E962

display_image cannot be empty.


Did this page help you?