Skip to main content

Overview

The Messages API allows you to send messages through webhooks to Discord. Messages can include plain text, rich embeds, and file attachments.

Send Message to Webhook

POST /webhooks/{webhook}/send Send a message through a specific webhook to Discord.

Path Parameters

webhook
integer
required
Webhook ID to send the message through

Request Body

content
string
Plain text message content (max 2000 characters). Supports variables like {user.name}, {date}, {time}
embeds
array
Array of embed objects (max 10 embeds per message)
embeds[].title
string
Embed title (max 256 characters)
embeds[].description
string
Embed description (max 4096 characters)
embeds[].color
integer
Embed color as decimal integer (e.g., 3447003 for blue)
embeds[].url
string
URL for the embed title
embeds[].timestamp
string
ISO 8601 timestamp
Footer object
text
string
Footer text (max 2048 characters)
icon_url
string
Footer icon URL
embeds[].image
object
Image object
url
string
Image URL
embeds[].thumbnail
object
Thumbnail object
url
string
Thumbnail URL
embeds[].author
object
Author object
name
string
Author name (max 256 characters)
url
string
Author URL
icon_url
string
Author icon URL
embeds[].fields
array
Array of field objects (max 25 fields)
name
string
required
Field name (max 256 characters)
value
string
required
Field value (max 1024 characters)
inline
boolean
Whether field should display inline
files
array
Array of file uploads (max 10 files, 10MB each). Multipart/form-data only. Supported: jpg, jpeg, png, gif, webp, mp4, mov, avi
{
  "content": "Hello from {user.name}! The current time is {time}."
}

Response

Returns 302 redirect to /dashboard with success or error message.

Success

Redirect to /dashboard
Flash message: "✅ Message sent successfully to Discord!"

Error

Redirect back with error
Flash message: "❌ Failed to send message: [error details]"

Send Temporary Message

POST /send/temporary Send a message using a temporary webhook URL without saving it to your account.

Request Body

temporary_webhook_url
string
required
Discord webhook URL to send message to
temporary_name
string
Custom webhook name for this message (max 80 characters)
temporary_avatar
string
Custom avatar URL for this message
content
string
Message content (max 2000 characters)
embeds
array
Array of embed objects (same structure as regular send)
files
array
File attachments
{
  "temporary_webhook_url": "https://discord.com/api/webhooks/123456789/abcdefg",
  "temporary_name": "Custom Bot Name",
  "temporary_avatar": "https://example.com/avatar.png",
  "content": "Quick message without saving webhook!",
  "embeds": [
    {
      "title": "Temporary Alert",
      "description": "This is a one-time message",
      "color": 15158332
    }
  ]
}

Response

Returns 302 redirect to /dashboard with success or error message.

Quick Send Page

GET /send Display the quick send interface with available webhooks and templates.

Response

Returns Inertia page with:
webhooks
array
All webhooks available to the user (owned + shared)
templates
array
All templates available to the user (owned + shared)

Variable Replacement

Messages support dynamic variables that are automatically replaced when sent:

User Variables

VariableDescriptionExample
{user.name}Current user’s nameJohn Doe
{user.email}Current user’s email[email protected]
{user.id}User ID123

Webhook Variables

VariableDescriptionExample
{webhook.name}Webhook nameProduction Alerts
{webhook.id}Webhook ID456

Date/Time Variables

VariableDescriptionExample
{date}Current date2024-01-15
{time}Current time10:30:45
{datetime}Current date and time2024-01-15 10:30:45

Example with Variables

{
  "content": "Alert from {user.name} at {time}",
  "embeds": [
    {
      "title": "Status Update",
      "description": "Webhook: {webhook.name}\nDate: {date}",
      "footer": {
        "text": "Sent by {user.email}"
      }
    }
  ]
}
Becomes:
{
  "content": "Alert from John Doe at 10:30:45",
  "embeds": [
    {
      "title": "Status Update",
      "description": "Webhook: Production Alerts\nDate: 2024-01-15",
      "footer": {
        "text": "Sent by [email protected]"
      }
    }
  ]
}

Discord Embed Colors

Common color values for embeds (decimal format):
ColorDecimalHex
Default0#000000
Aqua1752220#1ABC9C
Green3066993#2ECC71
Blue3447003#3498DB
Purple10181046#9B59B6
Gold15844367#F1C40F
Orange15105570#E67E22
Red15158332#E74C3C
Grey9807270#95A5A6
Dark Grey9936031#979C9F
Navy3426654#34495E

File Upload Limits

Important: File uploads must use multipart/form-data encoding, not JSON.
  • Max files per message: 10
  • Max file size: 10 MB per file
  • Supported formats: jpg, jpeg, png, gif, webp, mp4, mov, avi
  • Field name: files[] (array notation)

Message History

All sent messages are logged in the message history with:
  • User who sent the message
  • Message content (stored as JSON)
  • Send timestamp
  • Status (success/failed)
  • Discord API response
View history using the Get Message History endpoint.

Error Handling

Validation Errors

{
  "errors": {
    "content": ["The content must not be greater than 2000 characters."]
  }
}

Discord API Errors

Common Discord errors:
  • Unknown Webhook: Webhook URL is invalid or deleted
  • Invalid Form Body: Message content violates Discord limits
  • Cannot send an empty message: Both content and embeds are empty
  • Rate Limited: Too many messages sent too quickly

Best Practices

Always validate message content before sending. Discord has strict character limits that will cause message delivery to fail if exceeded.
Create templates for frequently sent messages to ensure consistency and reduce errors.
Use a test Discord server to verify message formatting before sending to production channels.
Check message history regularly to identify and troubleshoot failed deliveries.
Discord rate limits webhook requests. Avoid sending messages too rapidly.

Build docs developers (and LLMs) love