Documentation Index
Fetch the complete documentation index at: https://mintlify.com/edgarqs/DiscordWebhook/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Message History provides comprehensive tracking of all messages sent through Discord Webhook Manager. Every message sent—whether manual or scheduled—is logged with full details including:- Message content and embeds
- Delivery status (success/failed)
- Timestamp
- Sender information
- Discord API responses
Message history is automatically created for all webhook sends and is retained indefinitely unless manually deleted.
Accessing Message History
There are multiple ways to view message history:1. Webhook-Specific History
View history for a single webhook:
URL Pattern:
/webhooks/{id}/history
Code Reference: app/app/Controllers/WebhookController.php:351-364
2. Dashboard Overview
The webhook detail page shows recent activity:app/app/Controllers/WebhookController.php:107-109).
3. Statistics View
The webhook show page includes aggregated statistics (app/app/Controllers/WebhookController.php:112-119):
Message History Data Structure
Database Schema
Themessage_history table stores:
| Field | Type | Description |
|---|---|---|
id | BIGINT | Primary key |
webhook_id | BIGINT | Associated webhook |
user_id | BIGINT | User who sent the message |
message_content | JSON | Full message payload |
sent_at | TIMESTAMP | When message was sent |
status | VARCHAR | success or failed |
response | JSON | Discord API response |
created_at | TIMESTAMP | Record creation |
updated_at | TIMESTAMP | Last update |
Message Content Format
Themessage_content field stores the complete Discord payload:
Creating History Records
Successful Messages
When a message sends successfully (app/app/Controllers/WebhookController.php:321-328):
Failed Messages
Failed attempts are also logged (app/app/Controllers/WebhookController.php:335-341):
History Display
Pagination
History pages show 20 messages per page:app/app/Controllers/WebhookController.php:355-358
User Information
Each history record includes the sender’s name:Analytics & Statistics
Webhook Performance Metrics
The webhook detail page calculates key metrics:app/app/Controllers/WebhookController.php:112-119
Time-Based Analysis
Example query for daily message counts:Permissions & Access Control
Message history respects webhook permissions:View Permission
Users can view history if they can view the webhook (app/app/Controllers/WebhookController.php:353):
- Webhook owners
- Collaborators with any permission level (admin, editor, viewer)
Privacy Considerations
This is by design to enable team coordination, but be aware when sharing webhooks with sensitive content.Discord API Responses
Theresponse field stores Discord’s API response:
Success Response Example
Error Response Example
| Code | Meaning |
|---|---|
| 10015 | Unknown Webhook |
| 50027 | Invalid Webhook Token |
| 50035 | Invalid Form Body (validation error) |
| 40005 | Request entity too large (file too big) |
Filtering and Search
By Status
Filter messages by delivery status:By Date Range
Find messages in a specific time period:By User
For shared webhooks, filter by sender:Message History in Scheduled Messages
Scheduled messages also create history records when they send. The main difference is theuser_id reflects who created the schedule, not who triggered the send (since it’s automated).
Identifying Scheduled Messages:
You can track whether a message was manually sent or scheduled by checking if it has a corresponding scheduled_message_id (if you extend the schema to include this relationship).
Exporting History
Example export to CSV:Retention and Cleanup
Storage Considerations
Message history grows continuously. Consider implementing automatic cleanup:Archive Strategy
For long-term retention with reduced storage:- Export old history to compressed JSON files
- Store in S3 or cold storage
- Delete from active database
- Provide “restore from archive” functionality if needed
Debugging Failed Messages
Common Failure Patterns
Invalid Webhook URL:Troubleshooting Steps
Validate Content
Check that message content respects Discord limits:
- Content: 2000 characters max
- Embeds: 10 max per message
- Embed title: 256 characters max
- Embed description: 4096 characters max
Performance Optimization
Database Indexing
Ensure proper indexes for common queries:Query Optimization
For large history tables, use chunking for bulk operations:Eager Loading
Always eager load relationships to avoid N+1 queries:Best Practices
Regular Review
Periodically review failed messages to identify webhook issues or validation problems.
Set Retention Policy
Define how long to keep history based on your compliance and storage constraints.
Monitor Success Rate
Track delivery success rate over time to catch degraded performance early.
Use for Auditing
Leverage history for compliance auditing and tracking who sent what.
Next Steps
Webhooks
Learn more about webhook management
Scheduled Messages
Automate message delivery
