post
https://partner.gupshup.io/partner/app//voice
This API is used to enable/disable voice functionality at app level.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Request Parameters
| Key | Description | Value | Data type | Required/Optional | Constraints |
|---|---|---|---|---|---|
| Authorization | app Token for the application | \{\{APP_TOKEN\} | String | Required | Should be a valid Partner app token |
| appId | App for which the data needs to be updated | \{\{APP_ID\}\} | String | Required | App should be in the account whose api key is being used |
| enable | To enable pass true else pass false. | \{\{ENABLE\}\} | Boolean | Required | enable is true/false. Mandatory fields |
| iconVisibility | * iconVisibility can be used to show/hide call button in the whatsapp app for end users. | Supported Values: (a) DEFAULT Default Value: Default (Call icon will be visible for end user in the chat) | String | ||
| mode | Mode of usage of whatspp voice | Supported Values:- * GS_SIP | |||
| metaData | SIP configuration data when using GS-SIP | JSON Array example: mention below request | Mandatory when using GS-SIP mode | ||
| additionalParams | extra parameters like call_hours | {"call_hours":{"status":"ENABLED","timezone_id":"Asia/Kolkata","weekly_operating_hours":[{"day_of_week":"WEDNESDAY","open_time":"0400","close_time":"1020"},{"day_of_week":"TUESDAY","open_time":"0800","close_time":"1020"}],"holiday_schedule":[{"date":"2026-01-01","start_time":"0000","end_time":"2359"}]},"audio":{"additional_codecs":["PCMA"]}} | Optional | 1. Calling hours with close time earlier than open time is not allowed 2. Holiday given in call_hours cannot be a past date 3. Valid timezone should be used in call_hours 4. weekly_operating_hours in call_hours cannot be empty 5. Date format should be followed 6. More than 2 entries not allowed in weekly_operating_hours schedule in call_hours 7. Overlapping schedule in call_hours is not allowed |
Sample Request
Enablement of voice for an app of a partner (Using WA API)
curl --location '{PARTNER_PORTAL_BASE_URL}/partner/app/{appId}/voice' \
--header 'Authorization: {app_token}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'enable={VOICE_STATUS}' \
--data-urlencode 'iconVisibility={ICON_VISIBILITY}' \
--data-urlencode 'mode={VOICE_MODE}' \
--data-urlencode 'metaData={METADATA_FOR_SIP in JSON}'
--data-urlencode 'additionalParams={{ADDITIONAL_PARAMS}}'
Below is an example of the SIP configuration metadata format
[
{
"user": "911XXXX258312",
"username": "911XXXX258312",
"host": "ip-XX-232-3-XX.ap-XXXXX-1.compute.internal",
"port": "5071",
"secret_key": "XXXXXXXXX18fc94ac1488b86c0XXXXXX",
"force_tcp": false
}
]Sample Response
{
"message": "Whatsapp voice status updated to true",
"status": "success"
}
Status Codes
| Status Code | Response | Comments | |
|---|---|---|---|
| Success | |||
| 200 | { "message": "Whatsapp voice status updated to true", "status": "success" } | ||
| Error | |||
| 401 | { "message": "Authentication Failed", "status": "error" } | When API key authentication fails | |
| 500 | { "message": "Error occurred while updating whatsapp voice status, please try again later.", status": "error" } |
