WasenderApi - Low Cost WhatsApp API for Developers Update WhatsApp Session - API Documentation - WasenderApi - Low Cost WhatsApp API for Developers
WasenderApi API

API Documentation

WasenderApi WhatsApp API

Update WhatsApp Session

Sessions

PUT/api/whatsapp-sessions/{whatsappSession}

Updates details for a specific WhatsApp session. If the session is connected, webhook settings will be synced with the WhatsApp API server.

Update WhatsApp Session

Updates details for a specific WhatsApp session. If the session is connected, webhook settings will be synced with the WhatsApp API server.

This endpoint requires an access token to be included in the Authorization header. You can get the token from here.

Parameters

NameTypeRequiredDescription
whatsappSessionintegerYesID of the WhatsApp session.
namestringNoName of the WhatsApp session.
phone_numberstringNoPhone number in international format.
account_protectionbooleanNoEnable account protection features.
log_messagesbooleanNoEnable message logging.
webhook_urlstringNoURL for receiving webhook notifications.
webhook_enabledbooleanNoEnable webhook notifications.
webhook_eventsarrayNoArray of events to receive webhook notifications for.

Code Examples

curl -X PUT "https://www.wasenderapi.com/api/whatsapp-sessions/{whatsappSession}"
  -H "Authorization: Bearer YOUR_API_KEY"
  -H "Content-Type: application/json"
  -d '{
      "name": "Sample Name",
      "phone_number": "Sample Phone_number",
      "account_protection": true,
      "log_messages": true,
      "webhook_url": "Sample Webhook_url",
      "webhook_enabled": true,
      "webhook_events": [
          "number1",
          "number2"
      ]
  }'

Response Examples

{
    "success": true,
    "data": {
        "id": 1,
        "name": "Updated WhatsApp Session",
        "phone_number": "+1234567890",
        "status": "connected",
        "account_protection": true,
        "log_messages": true,
        "webhook_url": "https:\/\/updated-example.com\/webhook",
        "webhook_enabled": true,
        "webhook_events": [
            "message",
            "status_update"
        ],
        "created_at": "2025-04-01T12:00:00Z",
        "updated_at": "2025-05-09T11:45:00Z"
    }
}