SendZen API Documentation
Home
Getting StartedChangelog
Home
Getting StartedChangelog
Visit Website
Sign In
Create an account
  1. Activity Logs
  • Start Guide
    • Getting Started
    • API Reference
  • Messages
    • Template Messages
      • Send Text Message
      • Send Interactive Message
      • Send Media Message
    • Session Messages
      • Send Text Message
      • Send Image Message
      • Send Video Message
      • Send Audio Message
      • Send Document Message
      • Send Interactive Reply Message
    • Incoming Messages
      • Received Text Message
      • Received Message with Reaction
      • Received Media Message with Image
      • Received Callback from a Quick Reply Button Click
    • Other
      • Message Status & Typing Indicator
  • Template
    • List Templates
      GET
    • Create Template
      POST
    • Delete Template
      DELETE
    • Upload Media
      POST
  • Partner
    • Integration Guide
  • Project
    • Create Project
      POST
    • List Projects
      GET
    • Update Project
      PUT
    • Retrieve Project
      GET
  • WABA
    • List WABA
      GET
    • Retrieve WABA Details from Meta
      GET
    • Retrieve WhatsApp Business Profile Detail
      GET
    • Update WhatsApp Business Profile
      POST
    • Upload WhatsApp Business Profile
      POST
  • Activity Logs
    • All Event Logs
      GET
    • Incoming Message Logs
      GET
    • Message Status Logs
      GET
    • Other Event Logs
      GET
    • Multiple Event Types
      GET
  • Knowledge Base
    • Programming Languages
      • Python
      • Node.js
      • PHP
      • Laravel
      • Java
      • C# .NET
    • Product
      • Changelog
  • Schemas
    • Schemas
      • Template Message
      • 401/403 Message Response
      • AccountLoginRequest
      • APIKeyDto
      • ReadTypingIndicatorRequest
      • AccountRegisterRequest
      • TypingIndicator
      • PartnerConfigDto
      • LoginResponse
      • PartnerInfoDto
      • WABASignUp
      • OrderCheckoutDto
      • OrderDto
      • OrderStatusEnum
      • PaymentGatewayDto
    • Knowledge Base
    • Address
    • Account
    • CommonResponse
    • AccountDetailDto
    • CreateOrUpdateProjectRequest
    • Contact
    • Error
    • ContactName
    • Button
    • ErrorResponse
    • CarouselCard
    • Email
    • ClientData
    • Component
    • ProjectDetailDto
    • ProjectWABADetail
    • Interactive
    • WABADetail
    • InteractiveAction
    • WABADto
    • InteractiveBody
    • CreateTemplateRequest
    • InteractiveButton
    • InteractiveFooter
    • CreateWebhookConfigRequest
    • InteractiveHeader
    • InteractiveMedia
    • Example
    • InteractiveProductItem
    • InteractiveProductSection
    • InteractiveReply
    • InteractiveRow
    • InteractiveSection
    • Location
    • Media
    • MessageRequest
    • MessageResponse
    • MessageTemplate
    • Organization
    • LimitedTimeOffer
    • Phone
    • Reaction
    • Response
    • TemplateAction
    • NamedParameter
    • TemplateButtons
    • TemplateCarousel
    • TemplateComponent
    • TemplateCurrency
    • PaginatedWebhookLogsResponse
    • TemplateDateTime
    • PartnerClientSession
    • TemplateLimitedTimeOffer
    • PartnerClientSessionDto
    • TemplateMedia
    • TemplateParameter
    • TemplateProductItem
    • TemplateSection
    • TemplateTapTargetConfiguration
    • SupportedApp
    • Text
    • Url
    • WhatsAppBusinessProfile
    • UploadMedia
    • Webhook
    • WebhookConfigDto
    • WebhookLogDto
Home
Getting StartedChangelog
Home
Getting StartedChangelog
Visit Website
Sign In
Create an account
  1. Activity Logs

All Event Logs

GET
https://api.sendzen.io/v1/logs

Introduction#

The logs endpoint provides comprehensive access to all event types logged by your WhatsApp Business Account. By omitting the eventTypes parameter, you can retrieve a complete view of all activities including incoming messages, message status updates, and other events within your specified time range.
This is particularly useful for comprehensive monitoring, auditing, and building complete activity dashboards.

Key Features#

Complete Event Coverage: Retrieves all event types in a single request
Unified View: See incoming messages, status updates, and other events together
Time-Based Filtering: Filter by date range using Ticks format (optional)
Optional Filters: Narrow results by phone number ID or webhook URL
7-Day Retention: Logs are available for the last 7 days only

Request Parameters#

Optional Parameters#

ParameterTypeDescription
fromDateintegerStart date in Ticks format (100-nanosecond intervals since January 1, 0001 UTC). If omitted, retrieves logs from the beginning of available data.
toDateintegerEnd date in Ticks format. If omitted, retrieves logs up to the current time.
phoneNumberIdstringFilter logs for a specific WhatsApp Business phone number ID
urlstringFilter logs for a specific webhook URL (must be URL encoded)
pageSizeintegerNumber of log entries to return per page. Default: 20, Maximum: 20
nextPageTokenstringToken for pagination to retrieve the next page of results. Use the next_page_token value from the previous response.

Date Format#

The fromDate and toDate parameters use Ticks format, representing 100-nanosecond intervals since January 1, 0001 at 00:00:00 UTC.
Example: 638000000000000000 represents a specific timestamp in this format.

Request Examples#

Basic Request (All Events)#

Retrieve all logs without date filters:
Or with date range:

Filter by Phone Number ID#

Filter by Webhook URL#

Response Example#

{
    "message": "Notification logs retrieved successfully",
    "data": {
        "logs": [
            {
                "project_id": "12345",
                "phone_number_id": "123456789012345",
                "event_type": "Message Status",
                "payload": "{\"object\":\"whatsapp_business_account\",\"entry\":[{\"id\":\"123456789012345\",\"changes\":[{\"field\":\"messages\",\"value\":{\"messaging_product\":\"whatsapp\",\"metadata\":{\"display_phone_number\":\"15551234567\",\"phone_number_id\":\"123456789012345\"},\"statuses\":[{\"id\":\"msg_ABC123XYZ\",\"recipient_id\":\"1234567890\",\"status\":\"failed\",\"timestamp\":\"1704067200\",\"errors\":[{\"code\":132001,\"title\":\"(#132001) Template name does not exist in the translation\",\"message\":\"(#132001) Template name does not exist in the translation\",\"error_data\":{\"details\":\"template name (Appointment Reminders) does not exist in en_US\"}}]}]}}]}]}",
                "created_at": 638500000000000000,
                "direction": 1,
                "flyout_delivery_status": "-",
                "flyout_delivery_response": "-",
                "flyout_delivery_response_code": 0,
                "flyout_url": "-"
            },
            {
                "project_id": "12345",
                "phone_number_id": "123456789012345",
                "event_type": "Incoming Message",
                "payload": "{\"object\":\"whatsapp_business_account\",\"entry\":[{\"id\":\"123456789012345\",\"changes\":[{\"field\":\"messages\",\"value\":{\"messaging_product\":\"whatsapp\",\"metadata\":{\"display_phone_number\":\"15551234567\",\"phone_number_id\":\"123456789012345\"},\"contacts\":[{\"wa_id\":\"1234567890\",\"profile\":{\"name\":\"John Doe\"}}],\"messages\":[{\"from\":\"1234567890\",\"id\":\"wamid.HBgMDEyMzQ1Njc4OTAFQIAEhgWM0VCMDI5NTg3MDU0MDIxQUVCMzA0RgA=\",\"timestamp\":\"1704067200\",\"type\":\"text\",\"text\":{\"body\":\"Hello, this is a test message\"}}]}}]}]}",
                "created_at": 638500000100000000,
                "direction": 1,
                "flyout_delivery_status": "-",
                "flyout_delivery_response": "-",
                "flyout_delivery_response_code": 0,
                "flyout_url": "-"
            }
        ],
        "next_page_token": "eyJQcm9qZWN0SWQiOnsiTiI6IjEyMzQ1In0sIkNyZWF0ZWRBdCI6eyJOOiI2Mzg1MDAwMDAwMDAwMDAwMCJ9fQ=="
    }
}

Response Fields#

Top-Level Fields#

message (string): Success message indicating the operation result
data (object): Container for the response data

Data Object#

data.logs (array): Array of log entries matching the query criteria
data.next_page_token (string): Token for pagination to retrieve the next page

Log Entry Fields#

Each log entry in the logs array contains:
FieldTypeDescription
project_idstringThe project identifier
phone_number_idstringThe WhatsApp Business phone number ID
event_typestringType of event: "Incoming Message", "Message Status", or "Other"
payloadstringJSON string containing the full webhook payload
created_atintegerTimestamp in Ticks format when the log entry was created
directionintegerMessage direction (1 = incoming)
flyout_delivery_statusstringDelivery status for flyout notifications
flyout_delivery_responsestringDelivery response for flyout notifications
flyout_delivery_response_codeintegerHTTP response code for flyout delivery
flyout_urlstringURL for flyout notifications

Event Types Included#

When retrieving all logs, the response may include:
1.
Incoming Message: Messages received by your WhatsApp Business number
2.
Message Status: Status updates for sent messages (sent, delivered, read, failed)
3.
Other: Other event types not covered by the above categories

Pagination#

When there are more results available, the response includes a next_page_token. To retrieve the next page, include the nextPageToken parameter in your request:
Continue this process until no next_page_token is returned in the response.

Error Handling#

400 Bad Request#

{
    "message": "Invalid request parameters",
    "data": null
}

401 Unauthorized#

{
    "message": "Unauthorized"
}

403 Forbidden#

{
    "message": "Forbidden"
}

500 Internal Server Error#

{
    "message": "Internal server error",
    "data": null
}

Important Notes#

⚠️ Log Retention: Logs are only available for the last 7 days
📦 Payload Format: The payload field is a JSON string that must be parsed
🔢 Timestamp Format: All timestamps use Ticks format
🔍 Filtering: Use phoneNumberId or url to narrow results
📄 Pagination: Always check for next_page_token to retrieve all results

Use Cases#

Complete Activity Monitoring: View all events across your WhatsApp Business Account
Audit Trails: Maintain comprehensive logs of all activities
Dashboard Building: Create unified dashboards showing all event types
Troubleshooting: Review all events to identify patterns or issues
Analytics: Analyze complete activity patterns across different event types

Code Example#

Related Endpoints#

Retrieve Incoming Message Logs - Filter for incoming messages only
Retrieve Message Status Logs - Filter for status updates only
Retrieve Other Event Logs - Filter for other event types
Retrieve Multiple Event Types - Filter for specific multiple event types

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params

Responses

🟢200Success
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.sendzen.io/v1/logs?fromDate=ticksTime&toDate=ticksTime' \
--header 'Authorization: Bearer <token>'
Response Response Example
{
    "message": "string",
    "data": {
        "logs": [
            {
                "project_id": "string",
                "phone_number_id": "string",
                "event_type": "string",
                "payload": "string",
                "created_at": 0,
                "direction": 0,
                "flyout_delivery_status": "string",
                "flyout_delivery_response": "string",
                "flyout_delivery_response_code": 0,
                "flyout_url": "string"
            }
        ],
        "next_page_token": "string"
    }
}
Modified at 2025-11-18 10:15:20
Previous
Upload WhatsApp Business Profile
Next
Incoming Message Logs
Built with