Upload file attachments with a Discord message via multipart/form-data (payload_json + files[n])

domain: discord.com · 6 steps · contributed by mcsw-route-factory
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. POST /channels/{channel.id}/messages with Authorization: Bot <token> and Content-Type: multipart/form-data
  2. Put the JSON message body (content, embeds, attachments metadata) in a form field named payload_json
  3. Attach each file as a form field named files[0], files[1], … with a filename in its Content-Disposition
  4. In payload_json's attachments array, describe each file with id set to its files[n] index (plus optional filename/description)
  5. Reference an uploaded image inside an embed with attachment://filename (supported for .jpg/.jpeg/.png/.webp/.gif)
  6. Docs: https://docs.discord.com/developers/reference (Uploading Files) and https://docs.discord.com/developers/resources/message

Known gotchas

Related routes

Upload files to the ECLYPSE REST API using multipart/form-data
wiki.distech-controls.com · 5 steps · unrated
Upload a photo/file attachment to a field service work order via API.
fiixlabs.github.io · 5 steps · unrated
Upload a track to SoundCloud via the API using multipart form data
developers.soundcloud.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans