Skip to Content

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
/v1/whatsapp/flows/encryption-key/rotate

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.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
businessAccountId?WhatsAppBusinessAccountId
Match^waba_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

WhatsAppFlowEncryptionKey

application/json
  1. response
wabaId*string
publicKey*string
phoneNumberIds*array<string>
createdAt*string
Example Request
import { 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"
}

Related documentation