Update a WhatsApp Number Details

PUT Method

The Update a 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/><SID>

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, Create an API Key. To view the API Key and the SID, see View API Key and SID.

📘

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.

  1. 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:

ParameterVariableDescription ExampleMandatory
SIDStringAccount SID (Security Identifier). Generated by Kaleyra.io while creating an API key.HXXXXXXX071USTrue
API_KEYStringYour API Key generated by Kaleyra.io.Ac4XXXXX21fTrue
CONTENT_TYPEAlphanumericIndicates the format of the content the API will be processing.application/JSONTrue
WA_NUMBERStringSpecifies the registered WhatsApp number in E164 format.+91XXXXXXXXX2True
ADDRESSStringSpecifies registered WhatsApp number address.567, "Test", 2nd Phase, Bangalore.False
INCOMING_URLStringSpecifies the URL for which you receive the incoming callback.https://webhook.site/#!/7aXXXXXX-e1df-4f59-8ddc-55abdaXXXXXX/testFalse
DISPLAY_IMAGEStringSpecifies registered WhatsApp display image.https://s3.ap-south-1.amazonaws.com/stage-hexa/docs/1620380334flower-729512__340.jpgFalse
BUSINESS_DESCRIPTIONStringSpecifies registered WhatsApp number business description.Brief description about the Company.False
BUSINESS_CATEGORYStringSpecifies 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
EducationFalse
CONTACT_EMAILStringSpecifies the registered WhatsApp number contact Email.[email protected]False
WEBSITEStringSpecifies the business website.https://www.kaleyra.comFalse
ABOUTStringSpecifies 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 CodeDescription
E413wa_number field is required and cannot be empty.
E413business_description can be a maximum of 139 characters.
E962display_image cannot be empty.