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

Multiple Event Types

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

Overview#

This endpoint enables you to retrieve logs for multiple specific event types in a single request. Instead of making separate API calls for each event type, you can combine them using multiple eventTypes parameters, allowing you to efficiently filter and retrieve exactly the event types you need.
This is particularly useful when you want to monitor specific combinations of events, such as both incoming messages and their corresponding status updates.

How Multiple Event Types Work#

You can specify multiple eventTypes parameters in your request URL. Each event type will be included in the results, giving you a filtered view of only the event types you're interested in.
Supported Event Types:
Incoming%20Message - Incoming text messages
Message%20Status - Message delivery status updates
Other - Other event types

Request Parameters#

Required Parameters#

ParameterTypeDescription
eventTypesstringEvent type (can be repeated multiple times)

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 by specific WhatsApp Business phone number ID
urlstringFilter by specific webhook URL (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 Specification#

Dates are specified in Ticks format: 100-nanosecond intervals since January 1, 0001 at 00:00:00 UTC.
Example: 638000000000000000

Request Examples#

Multiple Event Types - Basic Request#

Retrieve both Message Status and Other event types without date filters:
Or with date range:

Multiple Event Types with Phone Number Filter#

Filter by phone number and retrieve multiple event types:

Multiple Event Types with Webhook URL Filter#

Filter by webhook URL and retrieve multiple event types:

All Three Event Types#

Retrieve Incoming Message, Message Status, and Other events:

With Page Size#

Response Structure#

The response contains logs from all specified event types, mixed together and sorted by creation time:
{
    "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\":\"delivered\",\"timestamp\":\"1704067200\",\"conversation\":{\"id\":\"5f7375311518ef490638d5b08aee9eb5\",\"origin\":{\"type\":\"service\"}},\"pricing\":{\"pricing_model\":\"PMP\",\"billable\":false,\"category\":\"service\"}}]}}]}]}",
                "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#

Response Object#

FieldTypeDescription
messagestringSuccess message
dataobjectResponse data container

Data Object#

FieldTypeDescription
data.logsarrayArray of log entries from all specified event types
data.next_page_tokenstringPagination token for next page

Log Entry Fields#

Each log entry contains:
FieldTypeDescription
project_idstringProject identifier
phone_number_idstringWhatsApp Business phone number ID
event_typestringEvent type: "Incoming Message", "Message Status", or "Other"
payloadstringJSON string with full webhook payload
created_atintegerTimestamp in Ticks format
directionintegerMessage direction (1 = incoming)
flyout_delivery_statusstringFlyout delivery status
flyout_delivery_responsestringFlyout delivery response
flyout_delivery_response_codeintegerHTTP response code for flyout
flyout_urlstringFlyout notification URL

Filtering Results by Event Type#

Since the response contains multiple event types, you can filter them in your application:

Pagination#

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

Error Responses#

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#

Event Type Filtering: Only logs matching the specified event types are returned
Mixed Results: Results from different event types are interleaved by timestamp
URL Encoding: All eventTypes values must be URL encoded
Parameter Repetition: Repeat the eventTypes parameter for each event type you want
7-Day Retention: Logs are only available for the last 7 days
Payload Parsing: The payload field is a JSON string that must be parsed

Use Cases#

1.
Message Lifecycle Tracking: Retrieve both incoming messages and their status updates together
2.
Selective Monitoring: Monitor specific event combinations without retrieving all events
3.
Efficient Data Retrieval: Reduce API calls by combining multiple event types
4.
Correlation Analysis: Analyze relationships between different event types
5.
Targeted Auditing: Create focused audit logs for specific event combinations

Code Example#

Best Practices#

1.
Limit Event Types: Only request the event types you actually need
2.
Use Filters: Combine with phoneNumberId or url filters to narrow results
3.
Handle Pagination: Always check for and use next_page_token when present
4.
Parse Payloads: Remember to parse the JSON string in the payload field
5.
Filter Client-Side: Use the event_type field to separate results if needed

Related Endpoints#

Retrieve All Event Logs - Get all event types without filtering
Retrieve Incoming Message Logs - Get incoming messages only
Retrieve Message Status Logs - Get status updates only
Retrieve Other Event Logs - Get other event types only

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 -g --request GET 'https://api.sendzen.io/v1/logs?fromDate=ticksTime&toDate=ticksTime&eventTypes=Incoming%20Message&phoneNumberId={{$number.int(min=10)}}&url={{$internet.url}}' \
--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 09:59:36
Previous
Other Event Logs
Next
Programming Languages
Built with