Which Mastodon instances work?
Any instance yeetpost can reach over https on a public address. The app is registered on your instance on demand the first time somebody connects an account there, and reused after that.
Follow these steps to connect Mastodon post, send from Python, and track delivery.
Mastodon has no central developer app, so yeetpost registers itself on your instance the first time somebody connects an account there, and then sends you to that instance to approve posting. You type the host you are on, for example mastodon.social, and approve three scopes: read your account, write statuses, write media. No client id and no app registration of your own. From Python you call the HTTP endpoint with requests, in a script, a Django or FastAPI view, or a Celery task.
| How you connect | Your instance host, then approval on that instance for three scopes |
|---|---|
| Connection slug | mastodon for the first account, then a slug built from the handle |
| Text limit | Your instance's own limit, read when you connect. 500 by default |
| Images | Up to 4 per post, png, jpeg, gif or webp |
| Alt text | Yes, sent as each attachment's description |
| Threads | Yes, up to 24 replies under the head status |
| First comment | No, LinkedIn only |
| Scheduling | Yes |
| Permalink | Whatever your instance returned, in practice https://<host>/@<handle>/<status id> |
| Per-post fee | None |
Connect your Mastodon account to yeetpost through your own instance:
mastodon.socialThe host has to be reachable over https and has to be a public address. Nothing else is needed from you: no client id, no client secret and no app registration of your own.
Paste your connection slug here and we'll auto-fill it into the code examples below.
Get your API key from the yeetpost dashboard:
Paste your API key here and we'll auto-fill it into the code examples below.
Install the requests library:
pip install requestsSend 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"])Monitor all your posts from the yeetpost dashboard:
Review the Security Checklist to ensure your implementation is secure.
Each of these fails only the Mastodon 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 the instance's limit, in the post or in any thread segment |
| media_unsupported | 400 | More than 4 images |
| shape_unsupported | 400 | A firstComment was given. Mastodon has no first comment |
| unauthorized | 401 | The token was revoked on the instance. Connect the account again |
| platform_rejected | 422 | The instance refused the image, is still processing it, or refused the status |
| internal_server_error | 500 | Our fault. Quote the req_id when you report it |
Any instance yeetpost can reach over https on a public address. The app is registered on your instance on demand the first time somebody connects an account there, and reused after that.
Mastodon weighs every URL as 23 characters. yeetpost counts them in full, so a link-heavy status is refused a little sooner than the instance would refuse it. That direction is the safe one: nothing is published and then rejected.
Not supported yet. A post goes out as a plain public status. Content warnings, visibility, polls and the language field are on the list, not in the product.
Mastodon tokens do not expire and there is no refresh token, so a 401 means the token was revoked on the instance. Connect the account again in the dashboard.
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.
Copy this guide (with your values) for use with LLMs or sharing with colleagues.