Follow these steps to connect Discord, send a Discord message from Python, and track delivery.
Discord posting goes through a webhook you create yourself in the channel's settings. There is no bot to install and no OAuth dance: Discord hands you a URL, yeetpost calls it once to read back the webhook's name and channel, and messages land under the name and avatar you gave it. The URL is a credential, so treat it like an API key. From Python you call the HTTP endpoint with requests, in a script, a Django or FastAPI view, or a Celery task.
What Discord takes
How you connect
A webhook URL of the form https://discord.com/api/webhooks/<id>/<token>
Connection slug
discord for the first channel, then a slug built from the webhook name
Text limit
2000 characters, counted in code points
Images
Up to 5 per post, png, jpeg, gif or webp, 8 MB each
Click Add connection, select Discord, and paste the URL
The URL has to be a real Discord webhook URL, so https://discord.com/api/webhooks/<id>/<token>. Anyone holding it can post to that channel, so treat it like an API key. To revoke it, delete the webhook in Discord.
Paste your connection slug here and we'll auto-fill it into the code examples below.
Paste your API key here and we'll auto-fill it into the code examples below.
3
Send your post
Install the requests library:
pip install requests
Send a post:
import requests
response = requests.post("https://api.yeetpost.com/api/v2/post/<your-connection-slug>", headers={"x-api-key":"<your-api-key>"}, data="Hello from yeetpost!",)print(response.json())
To post to several connections in one call, use the JSON endpoint. Read the
per-connection status in results, not just the HTTP status:
import requests
response = requests.post("https://api.yeetpost.com/api/v2/posts", headers={"x-api-key":"<your-api-key>"}, json={"text":"Hello from yeetpost!","connectionSlugs":["<your-connection-slug>"],},)for result in response.json()["results"]:print(result["connectionSlug"], result["status"])
4
Track your posts
Monitor all your posts from the yeetpost dashboard:
View all posts sent via yeetpost, including status and timestamps
5
Review the security checklist
Read the security checklist before you ship: where the key lives, who can trigger a post, and what to log.
When a Discord post is refused
Each of these fails only the Discord item. Every other connection on the same request still goes out. The full vocabulary is in the errors reference.
Code
Status
When
invalid_request
400
Text over 2000 code points
media_unsupported
400
The server refused the image, usually its own upload limit
shape_unsupported
400
A thread or a firstComment was given. Discord has neither
platform_rejected
422
The webhook is gone, is no longer allowed to post, is rate limited past 5 seconds, or Discord refused the message
internal_server_error
500
Our fault. Quote the req_id when you report it
Discord FAQ
Why can I not send a thread to Discord?
A webhook posts messages, it cannot reply to one. Ask for a thread on a Discord connection and that item is refused with shape_unsupported, while the connections that do have threads, X, Bluesky, Telegram and Mastodon, still go out.
Can I post to several Discord channels?
Yes. One webhook per channel and one connection per webhook. Name them all in connectionSlugs and the same call fans out to every channel.
The webhook stopped working. What happened?
Somebody deleted it in Discord, or the channel's permissions changed. Posts come back 403 reconnect_required, because Discord answers a deleted or no longer allowed webhook with a 404, 401 or 403. Create a new webhook and paste the new URL to reconnect.
Does the message show my name?
No. It shows the name and the avatar you gave the webhook when you created it in Discord. Change them there and every later message follows.
Should I read the per-connection result in Python?
Yes. POST /api/v2/posts answers 200 with a results array, one entry per connection. Read result["status"] for each entry rather than trusting the HTTP status, because one connection can fail while the others go out.