Introduction
The Discord Webhook Manager API is built on Laravel and uses session-based authentication with Laravel Sanctum. All API endpoints are protected and require authentication.Base URL
All API endpoints are relative to your application’s base URL:Authentication
The application uses Laravel Sanctum for API authentication with session-based cookies. All requests must include:CSRF token obtained from the application session
Session cookie containing authentication credentials
Authentication Flow
- Login through the web interface or authentication endpoint
- Receive session cookie and CSRF token
- Include both in subsequent API requests
- All routes require
authandverifiedmiddleware
Rate Limiting
Certain endpoints have rate limiting applied:- AI Generation: 10 requests per minute per user
- Standard endpoints: Laravel’s default rate limiting applies
Response Format
All responses follow standard HTTP status codes:Indicates if the request was successful
Contains the response payload
Human-readable message about the operation
Success Response
Error Response
Common HTTP Status Codes
| Status Code | Meaning |
|---|---|
| 200 | OK - Request succeeded |
| 201 | Created - Resource created successfully |
| 302 | Redirect - Successful action with redirect |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn’t exist |
| 422 | Unprocessable Entity - Validation failed |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Internal server error |
Permissions & Authorization
The application uses Laravel Policies for authorization:- Owner: Full access to all operations
- Collaborators: Limited access based on permission level
view: Read-only accesssend: Can send messagesedit: Can modify resources
Pagination
List endpoints support pagination:Page number to retrieve
Number of items per page (max 100)
Paginated Response
Variables & Dynamic Content
The application supports dynamic variables in message content:{user.name}- Current user’s name{user.email}- Current user’s email{webhook.name}- Webhook name{date}- Current date{time}- Current time{datetime}- Current date and time
Best Practices
Validate Discord URLs
Validate Discord URLs
Always validate Discord webhook URLs before storing them. Use the
/webhooks/validate endpoint to verify URLs with Discord’s API.Handle File Uploads
Handle File Uploads
Files must be uploaded as multipart/form-data with a maximum size of 10MB per file. Supported formats: jpg, jpeg, png, gif, webp, mp4, mov, avi.
Respect Discord Limits
Respect Discord Limits
- Maximum 2000 characters for message content
- Maximum 10 embeds per message
- Maximum 256 characters for embed titles
- Maximum 4096 characters for embed descriptions
- Maximum 25 fields per embed
Error Handling
Error Handling
Always check response status codes and handle errors gracefully. Validation errors return detailed field-level error messages.
Next Steps
Webhooks API
Manage Discord webhooks
Messages API
Send messages to Discord
Templates API
Create and manage templates
Scheduled Messages
Schedule recurring messages
