Tesselith
ProductSolutionsAI agentsCompareFree toolsBlogPricing
Log inStart free
  1. Home/
  2. Blog/
  3. Discord Webhooks: Send Messages, Embeds and Files (With Rate Limits That Won't Bite)

Developers

Discord Webhooks: Send Messages, Embeds and Files (With Rate Limits That Won't Bite)

November 27, 2026 · 7 min read

Send messages to Discord with a webhook: the request format, ?wait=true, embeds and their limits, file uploads, forum threads, editing, and handling 429 rate limits.

To send a message with a Discord webhook, POST JSON to the webhook URL (`https://discord.com/api/webhooks/{id}/{token}`) with a `content` field of up to 2,000 characters. No bot, no OAuth and no token header: the URL itself is the credential. Add ?wait=true to get the created message back instead of an empty 204, so you have its id for edits and deletes. A message can carry up to 10 embeds (6,000 characters across all of them) and up to 10 files sent as multipart form data. When you hit a rate limit, Discord returns 429 with a retry_after value. Wait that long, then retry.

Key takeaways

  • The webhook URL is a secret. Anyone with it can post as your webhook.
  • Always add ?wait=true so you get a message id and real errors back.
  • Limits: 2,000 characters of content, 10 embeds totalling 6,000 characters, 10 files.
  • Use allowed_mentions to stop user-supplied text from pinging @everyone.
  • Discord doesn't publish fixed webhook limits. Read the X-RateLimit headers and honour retry_after instead of hard-coding a number.

Create a webhook

In Discord, open the channel's settings (the gear next to the channel name), go to Integrations, then Webhooks, and click New Webhook. Name it, pick an avatar, choose the channel, and click Copy Webhook URL. You need the Manage Webhooks permission on the server to see this.

Treat that URL like a password. Don't commit it, don't put it in front-end code, and don't paste it in a public issue. If it leaks, delete the webhook in the same menu and make a new one. There's no rotation, only replacement.

Send a plain message

curl -X POST "$DISCORD_WEBHOOK_URL?wait=true" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "v2.4 is live: CSV export, faster search, and a fix for the timezone bug.",
    "username": "Release Bot",
    "allowed_mentions": {"parse": []}
  }'

# {"id": "1311000000000000000", "channel_id": "...", "content": "v2.4 is live...", ...}

Without wait=true, Discord answers 204 No Content before the message is saved, and a message that fails to save doesn't return an error. That's fine for a fire-and-forget alert. For anything you'll edit, delete or report on, always wait.

username and avatar_url override the webhook's defaults per message, so one webhook can post as "Release Bot" and "Status" without creating two. allowed_mentions: {"parse": []} disables all mention parsing. If any part of content comes from users, a CMS or an RSS feed, set it, or someone's "@everyone" in a blog title pings the whole server.

Embeds

Embeds are the cards with a colored bar, title, description, fields and images. A message can have up to 10.

{
  "embeds": [{
    "title": "Weekly report: 12 Nov to 18 Nov",
    "url": "https://example.com/reports/week-46",
    "description": "Signups up, churn flat. Full numbers below.",
    "color": 5814783,
    "fields": [
      {"name": "Signups", "value": "412", "inline": true},
      {"name": "Churn", "value": "1.9%", "inline": true}
    ],
    "image": {"url": "https://cdn.example.com/charts/week-46.png"},
    "footer": {"text": "Generated automatically"},
    "timestamp": "2026-11-19T09:00:00.000Z"
  }],
  "allowed_mentions": {"parse": []}
}
Embed fieldLimit (Discord docs, Nov 2026)
title256 characters
description4,096 characters
fieldsUp to 25 per embed
field name / value256 / 1,024 characters
footer.text2,048 characters
author.name256 characters
All embeds in one message combined6,000 characters
Embeds per message10

The 6,000 total is the one that catches people: it sums titles, descriptions, field names and values, footers and author names across every embed. Exceed any limit and the whole request fails with 400. color is a decimal integer, not a hex string: #58B9FF is 5814783. Embeds with the same url are deduplicated, so only the first one shows.

Sending files

Files need multipart/form-data. Put each file in a files[n] field and the JSON body in a field called payload_json. To show an uploaded image inside an embed, reference it as attachment://filename.

export async function postWithFile(webhookUrl: string, text: string, file: Blob, name: string) {
  const form = new FormData()
  form.set("payload_json", JSON.stringify({
    content: text.slice(0, 2000),
    embeds: [{ title: "Chart", image: { url: "attachment://" + name } }],
    allowed_mentions: { parse: [] },
  }))
  form.set("files[0]", file, name)

  const res = await fetch(webhookUrl + "?wait=true", { method: "POST", body: form })
  if (!res.ok) throw new Error("Discord " + res.status + ": " + (await res.text()))
  return (await res.json()).id as string
}

Don't set the Content-Type header yourself with FormData. fetch adds it with the boundary. Discord's docs give a default upload limit of 20 MiB per file (higher on boosted servers) and a 25 MiB maximum request size for creating a message, so several large images can fail together even when each is under the per-file limit. Resize before sending.

Forum channels and threads

If the webhook's channel is a forum or media channel, every message has to go into a thread. Pass thread_name in the body to create a new post with that title, or ?thread_id=... in the query string to post into an existing one. Send neither and the request fails. thread_id also works in normal text channels for posting into a thread under a message.

# New forum post
curl -X POST "$DISCORD_WEBHOOK_URL?wait=true" \
  -H "Content-Type: application/json" \
  -d '{"thread_name": "Release notes: v2.4", "content": "Full changelog inside."}'

# Reply into an existing thread
curl -X POST "$DISCORD_WEBHOOK_URL?wait=true&thread_id=1311000000000000123" \
  -H "Content-Type: application/json" \
  -d '{"content": "Hotfix 2.4.1 is out."}'

Edit and delete messages

Webhooks can edit and delete their own messages, which is great for status messages that update in place ("Deploy running" to "Deploy finished") instead of spamming the channel.

# Edit
curl -X PATCH "$DISCORD_WEBHOOK_URL/messages/$MESSAGE_ID" \
  -H "Content-Type: application/json" \
  -d '{"content": "Deploy finished in 4m 12s."}'

# Delete
curl -X DELETE "$DISCORD_WEBHOOK_URL/messages/$MESSAGE_ID"

Add ?thread_id= to both if the message lives in a thread. A webhook can't reply to a message with a quoted reference the way a bot can. If you need follow-ups, post them as new messages, or use a thread.

Rate limits and 429s

Discord doesn't publish fixed per-webhook numbers, and it says plainly that limits can change. Rate limits are scoped per route and per top-level resource, and webhooks count as a top-level resource (the webhook id and token), so each webhook has its own bucket. Every response tells you where you stand:

HeaderMeaning
X-RateLimit-LimitRequests allowed in the current window
X-RateLimit-RemainingRequests left in this window
X-RateLimit-ResetEpoch seconds when the window resets
X-RateLimit-Reset-AfterSeconds until reset
X-RateLimit-BucketId of the shared limit this route belongs to
Retry-After (on 429)Seconds to wait before retrying
export async function sendWithRetry(url: string, body: unknown, attempts = 4) {
  for (let i = 0; i < attempts; i++) {
    const res = await fetch(url + "?wait=true", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body),
    })
    if (res.ok) return res.json()
    if (res.status === 429) {
      const { retry_after } = await res.json()
      await new Promise((r) => setTimeout(r, Math.ceil(retry_after * 1000)))
      continue
    }
    if (res.status >= 500) {
      await new Promise((r) => setTimeout(r, 1000 * 2 ** i))
      continue
    }
    // 400: bad payload. 401/404: webhook deleted or URL wrong. Don't retry.
    throw new Error("Discord " + res.status + ": " + (await res.text()))
  }
  throw new Error("Discord: gave up after retries")
}

Back off when X-RateLimit-Remaining reaches zero, rather than waiting for the 429. Discord also watches for invalid requests: apps that keep sending requests that end in 401, 403 or 429 can be temporarily blocked at the IP level. That's the practical reason not to retry a deleted webhook in a loop.

Common failures

  • 404 Unknown Webhook: someone deleted the webhook or it was regenerated. Get a new URL. Retrying never fixes it.
  • 401: the token part of the URL is wrong, usually a copy-paste truncation.
  • 400 with a field path: an embed limit or empty message. Discord tells you which field.
  • Message posted but pings everyone: you didn't set allowed_mentions.
  • Nothing appears and no error: you didn't use ?wait=true, so a failed save was silent.

If you want to schedule announcements rather than wire them up in code, our guide to scheduling Discord messages covers the options, and the Discord character counter checks the 2,000 limit.

When to use a scheduling API instead of building it yourself

For a single channel, a webhook and a cron job is the right answer. It's simpler than anything you'd buy. A scheduling tool makes sense when the same announcement also goes to Telegram, Mastodon, Bluesky or Instagram, when someone non-technical writes it, or when you want approvals, a calendar and failure alerts around it.

Discord is coming soon to Tesselith. The Tesselith API already publishes to Telegram, Bluesky, Mastodon, Threads, Instagram, Facebook Pages and YouTube with one post model and signed webhooks for results. See our scheduling API checklist, the automation walkthrough, and the docs.

Questions people ask

How do I send a message to a Discord webhook?
POST JSON with a content field (up to 2,000 characters) to the webhook URL. Add ?wait=true to receive the created message, including its id.
How many embeds can a Discord webhook message have?
Up to 10 embeds, with a combined limit of 6,000 characters across all titles, descriptions, fields, footers and author names.
How do I send a file with a Discord webhook?
Use multipart/form-data with the file in a files[0] field and the JSON body in payload_json. Reference an uploaded image in an embed as attachment://filename.
What is the Discord webhook rate limit?
Discord doesn't publish a fixed number. Each webhook has its own bucket; read the X-RateLimit headers and wait for retry_after when you get a 429.
Can a Discord webhook edit its messages?
Yes. PATCH {webhook_url}/messages/{message_id} to edit and DELETE the same URL to remove a message the webhook sent.

Try Tesselith free

Connect your channels and schedule your first post in minutes. No credit card required.

Start free

Related pages

How to schedule Discord messagesSocial media webhooks, explainedDiscord character counterTesselith REST API

More from the blog

Social Media Webhooks, Explained: Get Notified the Moment a Post Publishes or FailsChoosing a Social Media Scheduling API in 2026: A 12-Point Checklist for DevelopersX API Pricing in 2026: Pay-Per-Use Rates, What a Post Really Costs, and How to BudgetPublishing to Instagram with the Graph API: Containers, Status Polling, Carousels and Reels

Free to start

One calendar for everything you post.

No credit card. Connect your first channel and schedule a post in under two minutes.

Start free
Tesselith

The social scheduler for creators, teams and agencies. One calendar, every network you post to.

Product

  • Composer
  • Calendar
  • Analytics
  • Automation
  • AI assistant
  • Posting queue
  • API & webhooks
  • MCP server
  • All features

AI agents

  • Claude
  • Claude Code
  • ChatGPT
  • Codex
  • Cursor
  • Gemini CLI
  • n8n
  • All AI agents

Solutions

  • Creators
  • Agencies
  • Small business
  • E-commerce
  • All solutions

Compare

  • Scheduler pricing 2026
  • vs Buffer
  • vs Hootsuite
  • Metricool alternatives
  • Planoly alternatives
  • SocialBee alternatives
  • All comparisons
  • All alternatives

Free tools

  • Character counter
  • Best time to post
  • UTM builder
  • Engagement rate
  • All tools

Company

  • About
  • Blog
  • Research
  • Developer docs
  • Pricing
  • Contact
  • Security
  • Status

Legal

  • Privacy
  • Terms
  • Cookies
  • Acceptable Use
  • DPA
  • Refunds

Schedule posts for

  • X (Twitter)
  • Instagram
  • Facebook Pages
  • LinkedIn
  • YouTube
  • TikTok
  • Threads
  • Bluesky
  • Mastodon
  • Pinterest
  • Reddit
  • Discord
  • Telegram
  • Dev.to
  • Hashnode

Popular guides

  • Post to all social media at once
  • Schedule Discord messages
  • Cross-post to Bluesky, Mastodon and Threads
  • Buffer pricing
  • Sprout Social pricing
  • Metricool pricing
  • Sendible pricing
  • Loomly pricing
© 2026 Tesselith. All rights reserved.
PrivacyTermsCookiesSecurityData deletion
Tesselith