Rotate a business account's flow encryption key
Rotate a business account's flow encryption key. Request: POST /v1/whatsapp/flows/encryption-key/rotate. Scope: templates:update.
POST
Replaces the key WhatsApp encrypts data-exchange requests with on the business account of the named number, or of the default number, and uploads it to each of the account's numbers. The replaced key keeps decrypting for a day while clients fetch the new one.
apiKeyheader
x-api-key<token>application/json- body
businessAccountId?WhatsAppBusinessAccountIdMatch
^waba_[0-9a-hjkmnp-tv-z]{16,24}$WhatsAppFlowEncryptionKey
application/json- response
wabaId*stringpublicKey*stringphoneNumberIds*array<string>createdAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.whatsappFlows.rotateEncryptionKey({});Example Response
{
"wabaId": "string",
"publicKey": "string",
"phoneNumberIds": [
"string"
],
"createdAt": "string"
}