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
Name | Type | Required | Description |
---|---|---|---|
whatsappSession | integer | Yes | ID of the WhatsApp session. |
name | string | No | Name of the WhatsApp session. |
phone_number | string | No | Phone number in international format. |
account_protection | boolean | No | Enable account protection features. |
log_messages | boolean | No | Enable message logging. |
webhook_url | string | No | URL for receiving webhook notifications. |
webhook_enabled | boolean | No | Enable webhook notifications. |
webhook_events | array | No | Array 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"
}
}