# Encryption

Endpoints for WhatsApp Business encryption features

## Get Business Encryption Public Key

> Retrieve the current business public key and its signature verification status. The public key is used for encrypting message payloads and data channel requests.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.41.0"},"tags":[{"name":"Encryption","description":"Endpoints for WhatsApp Business encryption features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"whatsapp_business_encryption.GetBusinessPublicKeyResponse":{"description":"Response containing business encryption public key information wrapped in a data array","properties":{"data":{"items":{"$ref":"#/components/schemas/whatsapp_business_encryption.BusinessEncryptionInfo"},"type":"array","uniqueItems":false}},"type":"object"},"whatsapp_business_encryption.BusinessEncryptionInfo":{"description":"Business encryption public key information and verification status","properties":{"business_public_key":{"type":"string"},"business_public_key_signature_status":{"enum":["VALID","MISMATCH"],"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/whatsapp_business_encryption":{"get":{"description":"Retrieve the current business public key and its signature verification status. The public key is used for encrypting message payloads and data channel requests.","operationId":"get-business-public-key","parameters":[{"description":"Comma-separated list of fields to include. Available fields: business_public_key, business_public_key_signature_status","in":"query","name":"fields","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/whatsapp_business_encryption.GetBusinessPublicKeyResponse"}}},"description":"Business encryption public key retrieved successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid parameters or malformed request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing API key"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Insufficient permissions to access this phone number"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Not found - Phone Number ID does not exist or is not accessible"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Get Business Encryption Public Key","tags":["Encryption"]}}}}
```

## Set Business Encryption Public Key

> Upload and configure a business public key for message payload encryption. The key must be a valid RSA public key in PEM format. Only one active public key per phone number at a time; previous keys are replaced when a new one is uploaded.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.41.0"},"tags":[{"name":"Encryption","description":"Endpoints for WhatsApp Business encryption features"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"whatsapp_business_encryption.SetBusinessPublicKeyResponse":{"description":"Response after successfully uploading and configuring the business encryption public key","properties":{"success":{"type":"boolean"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/whatsapp_business_encryption":{"post":{"description":"Upload and configure a business public key for message payload encryption. The key must be a valid RSA public key in PEM format. Only one active public key per phone number at a time; previous keys are replaced when a new one is uploaded.","operationId":"set-business-public-key","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"title":"business_public_key","type":"string"}},"multipart/form-data":{"schema":{"type":"object"}}},"description":"The business public key in PEM format to be uploaded and signed","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/whatsapp_business_encryption.SetBusinessPublicKeyResponse"}}},"description":"Public key successfully uploaded and signed"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request - Invalid key format or malformed request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized - Invalid or missing API key"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Forbidden - Insufficient permissions to modify encryption settings"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Not found - Phone Number ID does not exist or is not accessible"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Too many requests - Rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Set Business Encryption Public Key","tags":["Encryption"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.360dialog.com/docs/messaging-api/api-reference/encryption.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
