Loading...
Loading...
Publish, delete and read your own posts (toots) on any Mastodon instance via the Mastodon REST API. Use when the user wants to post a toot to their Mastodon / fediverse account, cross-post an article as a short dev-focused post, delete a toot, or list their own recent posts with engagement stats (boosts, favourites, replies).
npx skill4agent add acedatacloud/skills mastodoncurl + jq$MASTODON_BASE_URLhttps://mastodon.social$MASTODON_ACCESS_TOKENAuthorization: Bearer $MASTODON_ACCESS_TOKEN{"error":"<message>"}401"The access token is invalid"writewrite:statusesidcurl -sS "$MASTODON_BASE_URL/api/v1/accounts/verify_credentials" \
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
| jq '{id, username, acct, display_name, followers: .followers_count, statuses: .statuses_count}'visibilityunlistedpublicSTATUS_TEXT="Hello fediverse 👋 #introductions"
curl -sS -X POST "$MASTODON_BASE_URL/api/v1/statuses" \
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
--data-urlencode "status=$STATUS_TEXT" \
--data-urlencode "visibility=unlisted" \
--data-urlencode "language=en" \
| jq '{id, url, visibility, created_at}'visibilitypublicunlistedprivatedirectspoiler_textin_reply_to_idsensitive=truelanguageIdempotency-Keyuuidgen--data-urlencode422 {"error":"Validation failed: Text ..."}idverify_credentialsACCT_ID="14715" # from verify_credentials
curl -sS "$MASTODON_BASE_URL/api/v1/accounts/$ACCT_ID/statuses?limit=20&exclude_replies=true&exclude_reblogs=true" \
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
| jq '.[] | {id, url, boosts: .reblogs_count, favs: .favourites_count, replies: .replies_count, created_at}'limitonly_mediapinnedtagged=<hashtag>curl -sS -X DELETE "$MASTODON_BASE_URL/api/v1/statuses/STATUS_ID" \
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" | jq '{id, deleted: true}'text404 {"error":"Record not found"}POST $MASTODON_BASE_URL/api/v2/mediamultipart/form-datafilemedia_ids[]$MASTODON_BASE_URLreadread:accountsread:statuseswritewrite:statuses403"This action is outside the authorized scopes"429verify_credentialsnotesourcepublish_artifactpublish_artifact(kind="message", channel="mastodon", title="<title>", url="<the REAL returned URL>", status="delivered")status="failed"_shared/artifacts.md