setWhatsAppEnabled
Requires permission settings:integration:update.
Turns WhatsApp sending on or off for a provider. A connection must have been verified before it can be enabled, and enabling one provider turns the others off, since only one is enabled at a time. Requires permission to update integrations.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SetWhatsAppEnabled($enabled: Boolean!) {
setWhatsAppEnabled(enabled: $enabled) {
id
defaultCountryCode
channelName
displayName
apiKeyLast4
channelId
capabilities {
createTemplate
requiresChannel
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetWhatsAppEnabled($enabled: Boolean!) {\n setWhatsAppEnabled(enabled: $enabled) {\n id\n defaultCountryCode\n channelName\n displayName\n apiKeyLast4\n channelId\n capabilities {\n createTemplate\n requiresChannel\n }\n }\n}",
"variables": {
"enabled": true
}
}
EOF
Variables:
{
"enabled": true
}
Response:
{
"data": {
"setWhatsAppEnabled": {
"id": "id",
"defaultCountryCode": "string",
"channelName": "string",
"displayName": "string",
"apiKeyLast4": "string",
"channelId": "string",
"capabilities": {
"createTemplate": true,
"requiresChannel": true
}
}
}
}
setWhatsAppEnabled(
enabled: Boolean!
provider: WhatsAppProvider
): WhatsAppConfigGql!
Arguments
setWhatsAppEnabled.enabled ● Boolean! non-null scalar
True to turn sending on, false to turn it off.
setWhatsAppEnabled.provider ● WhatsAppProvider enum
The WhatsApp provider to use. Omit it to use the organization's enabled provider, else its most recently edited one.
Type
WhatsAppConfigGql object
The organization's WhatsApp setup. The API key is never returned in full.