Update WABA settings
PATCH
/
whatsapp
/
business_accounts
/
{id}
/
settings
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const setting = await client.whatsapp.businessAccounts.settings.update('id');
console.log(setting.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
setting = client.whatsapp.business_accounts.settings.update(
id="id",
)
print(setting.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
setting, err := client.Whatsapp.BusinessAccounts.Settings.Update(
context.TODO(),
"id",
telnyx.WhatsappBusinessAccountSettingUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", setting.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.whatsapp.businessaccounts.settings.SettingUpdateParams;
import com.telnyx.sdk.models.whatsapp.businessaccounts.settings.SettingUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SettingUpdateResponse setting = client.whatsapp().businessAccounts().settings().update("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
setting = telnyx.whatsapp.business_accounts.settings.update("id")
puts(setting)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$setting = $client->whatsapp->businessAccounts->settings->update(
'id',
name: 'name',
timezone: 'America/New_York',
webhookEnabled: true,
webhookEvents: ['string'],
webhookFailoverURL: 'webhook_failover_url',
webhookURL: 'webhook_url',
);
var_dump($setting);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx whatsapp:business-accounts:settings update \
--api-key 'My API Key' \
--id idcurl --request PATCH \
--url https://api.telnyx.com/v2/whatsapp/business_accounts/{id}/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"timezone": "America/New_York",
"webhook_url": "<string>",
"webhook_failover_url": "<string>",
"webhook_enabled": true,
"webhook_events": [
"<string>"
]
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"record_type": "whatsapp_business_account_settings",
"name": "<string>",
"timezone": "America/Chicago",
"webhook_url": "<string>",
"webhook_failover_url": "<string>",
"webhook_enabled": true,
"webhook_events": [
"<string>"
],
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Whatsapp Business Account ID
Body
application/json
IANA timezone identifier
Example:
"America/New_York"
URL to send Whatsapp events
Failover URL to send Whatsapp events
Enable/disable receiving Whatsapp events
Whatsapp event to subscribe to
Response
Updated settings
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const setting = await client.whatsapp.businessAccounts.settings.update('id');
console.log(setting.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
setting = client.whatsapp.business_accounts.settings.update(
id="id",
)
print(setting.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
setting, err := client.Whatsapp.BusinessAccounts.Settings.Update(
context.TODO(),
"id",
telnyx.WhatsappBusinessAccountSettingUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", setting.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.whatsapp.businessaccounts.settings.SettingUpdateParams;
import com.telnyx.sdk.models.whatsapp.businessaccounts.settings.SettingUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SettingUpdateResponse setting = client.whatsapp().businessAccounts().settings().update("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
setting = telnyx.whatsapp.business_accounts.settings.update("id")
puts(setting)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$setting = $client->whatsapp->businessAccounts->settings->update(
'id',
name: 'name',
timezone: 'America/New_York',
webhookEnabled: true,
webhookEvents: ['string'],
webhookFailoverURL: 'webhook_failover_url',
webhookURL: 'webhook_url',
);
var_dump($setting);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx whatsapp:business-accounts:settings update \
--api-key 'My API Key' \
--id idcurl --request PATCH \
--url https://api.telnyx.com/v2/whatsapp/business_accounts/{id}/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"timezone": "America/New_York",
"webhook_url": "<string>",
"webhook_failover_url": "<string>",
"webhook_enabled": true,
"webhook_events": [
"<string>"
]
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"record_type": "whatsapp_business_account_settings",
"name": "<string>",
"timezone": "America/Chicago",
"webhook_url": "<string>",
"webhook_failover_url": "<string>",
"webhook_enabled": true,
"webhook_events": [
"<string>"
],
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}