How to Manually Re-Fetch a Remote Mastodon Post With API
🔍 WiseChecker

How to Manually Re-Fetch a Remote Mastodon Post With API

When you view a remote post in Mastodon, your instance caches a copy. Sometimes that cached copy becomes outdated or fails to load fully, showing a generic error or missing content. This happens because Mastodon fetches remote posts lazily and does not automatically refresh them. This article explains how to force your instance to re-fetch a specific remote post using Mastodon’s REST API. You will learn the exact API endpoint, the required authentication, and how to verify the result. No coding experience is needed beyond sending a single HTTP request.

Key Takeaways: Re-Fetching a Remote Mastodon Post via API

  • POST /api/v1/statuses/:id/reblog: Triggers a re-fetch of the remote post when called with a valid OAuth token and the post ID.
  • OAuth Bearer token: Required for all authenticated API calls; create one in Preferences > Development > New Application.
  • Post ID from URL: The numeric ID at the end of the post URL is the value to use in the API path.

ADVERTISEMENT

Why a Remote Post Needs Manual Re-Fetching

Mastodon instances do not poll remote servers for updates. When you view a post from another instance, your instance fetches it once and stores a local copy. If the remote post is edited, deleted, or was originally fetched with an error, your instance never automatically updates its cached version. The API endpoint for re-blogging a post, POST /api/v1/statuses/:id/reblog, actually forces your instance to re-fetch the remote post before creating the reblog. This side effect is the only built-in way to refresh the cache of a remote post. The method works on any Mastodon version that supports the standard REST API.

What Happens During the Re-Fetch

When you send the reblog request, your instance contacts the remote instance to retrieve the latest version of the post. If the remote post still exists and is accessible, your instance updates its local database with the fresh data. Then it creates a reblog from your account. If the reblog already exists, the API returns an error, but the re-fetch still occurs. This means you can use the endpoint even if you have already boosted the post — the re-fetch happens before the error is returned.

Steps to Re-Fetch a Remote Mastodon Post Using the API

Follow these steps to manually trigger a re-fetch. You will need a Mastodon account, a client application token, and the exact URL of the remote post.

  1. Find the Post ID from the Remote Post URL
    Open the remote post in your browser. The URL ends with a numeric ID, for example https://mastodon.social/@user/109876543210987654. The last number is the post ID. Copy it exactly.
  2. Create an API Application Token
    Go to Preferences > Development > New Application. Give it a name like “Manual Re-Fetch Tool”. Enable the write:statuses scope. Click Submit. Copy the “Your access token” string. This is the Bearer token you will use in the API call.
  3. Prepare the API Request
    You need an HTTP client. Use curl, Postman, or any tool that can send POST requests. The endpoint URL is https://yourinstance.social/api/v1/statuses/POSTID/reblog. Replace yourinstance.social with your own instance domain and POSTID with the numeric ID from step 1.
  4. Send the POST Request with Authentication
    Add an HTTP header Authorization: Bearer YOUR_TOKEN. Replace YOUR_TOKEN with the token from step 2. Send the request. Example using curl: curl -X POST -H "Authorization: Bearer abc123" https://mastodon.example/api/v1/statuses/109876543210987654/reblog.
  5. Check the Response
    If successful, the API returns a JSON object representing the new reblog status. If the reblog already exists, you get an error like 422 Unprocessable Entity. In either case, the re-fetch has already happened. Verify by reloading the remote post in your browser — the content should now be current.

ADVERTISEMENT

Common Issues When Re-Fetching a Remote Post

“Record Not Found” Error When Sending the Request

This error means the post ID does not exist on your instance. The remote post may have been deleted, or you have never accessed it from your instance. Visit the post URL in your browser first to ensure your instance caches it. Then retry the API call.

“Unauthorized” or “Forbidden” Error

Your OAuth token is invalid or lacks the write:statuses scope. Go back to Preferences > Development, edit your application, and confirm the scope is enabled. Generate a new token if needed.

Re-Fetch Does Not Update the Post Content

If the remote post was edited after your instance cached it, the re-fetch should bring the new content. If it does not, the remote instance may be blocking your instance or the post may be from a private account. The API can only fetch posts that are publicly accessible to your instance.

API Re-Fetch vs Browser Reload: Key Differences

Item API Re-Fetch Browser Reload
Triggers server-side cache update Yes No
Requires authentication Yes (OAuth token) No
Updates local database Yes No
Can be automated Yes No

The browser reload only refreshes the HTML page rendered by your instance. It does not contact the remote server for updated post data. Only the API re-fetch forces your instance to pull the latest version from the remote server.

You can now manually re-fetch any remote Mastodon post using the API reblog endpoint. Use this method when a post appears incomplete or outdated on your home timeline. For repeated use, consider writing a small script that accepts a post URL and sends the API call automatically. The same endpoint also works for posts from the same instance, but those are already current.

ADVERTISEMENT