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

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.
read_incoming_messagesbooleanNoEnable the option to automatically mark messages as read when they are received.
auto_reject_callsbooleanNoEnable automatic rejection of incoming calls.
ignore_groupsbooleanNoignore all webhook events from groups.
ignore_channelsbooleanNoignore all webhook events from channels (newsletters).
ignore_broadcastsbooleanNoignore all webhook events from broadcast lists.
proxy_urlstringNoAllowed protocols: http, https, socks5. Use a public domain only (IP addresses and local/private networks are blocked).
always_onlinebooleanNoWhen enabled, your session will always appear online to your contacts, even when you're not actively using WhatsApp.

Code Examples

curl -X PUT "https://www.wasenderapi.com/api/whatsapp-sessions/{whatsappSession}"
  -H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN"
  -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": [
        "messages.received",
        "session.status",
        "messages.update"
      ]
  }'

Response Examples

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Business WhatsApp",
    "phone_number": "+1234567890",
    "status": "connected",
    "account_protection": true,
    "log_messages": true,
    "read_incoming_messages": true,
    "webhook_url": "https://example.com/webhook",
    "webhook_enabled": true,
    "webhook_events": [
      "messages.received",
      "session.status",
      "messages.update"
    ],
    "api_key": "75075a7bf6417bff59e76fb7205382c2dc74cf1769e76f382c2dc74cf176c0bf",
    "webhook_secret": "fb61be92ddb7935e0cedcec58e470f6c",
    "created_at": "2025-04-01T12:00:00Z",
    "updated_at": "2025-05-08T15:30:00Z"
  }
}