Instagram Messaging API · error code

Instagram error 9004: Media could not be fetched from the URI (2207052)

ConfigurationHTTP 400Content publishing (posts, reels, stories)

Last verified against Meta for Developers - Messenger Platform error codes

What Instagram returns
The media could not be fetched from this uri: {uri}

What error 9004 means

Code 9004 with subcode 2207052 is returned when Instagram tried to download your image_url or video_url and could not. The publishing flow does not accept file bytes on the standard path: Meta's guide says it cURLs the media at the URL you pass, so the file must be on a publicly accessible server at the time of the attempt. Meta's recommended solution is to make sure the URI is valid and publicly available.

"Publicly available" is stricter than it sounds. A URL that opens in your browser may still fail for Meta's fetcher if it relies on cookies, a signed query string that expired, a redirect chain, geo-blocking, bot protection, or a localhost or private-network address. The guide also recommends URLs that contain only US-ASCII characters, so file names with spaces or accented letters are a common, quiet cause.

The fix lives on your hosting side; the Instagram account and token are not involved.

What it looks like

{
  "error": {
    "type": "OAuthException",
    "code": 9004,
    "error_subcode": 2207052,
    "error_user_msg": "The media could not be fetched from this uri: https://cdn.example.com/posts/summer launch.jpg",
    "fbtrace_id": "GzM2tHq7YdRe9Bo"
  }
}

Why it happens

  • The URL points to a private bucket, an authenticated endpoint, or an internal hostname.
  • A presigned or expiring URL lapsed before Instagram fetched it.
  • A CDN, firewall or bot-protection layer blocked Meta's fetcher.
  • The URL contains unencoded spaces or non-ASCII characters.
  • The URL returns an HTML page or redirect rather than the media file itself.

How to fix Instagram error 9004

  1. 1Request the exact URL with curl -I from a machine outside your network and confirm a 200 response with an image or video content type.
  2. 2Serve media from a public bucket or CDN path with no cookies, headers or login required.
  3. 3If you use presigned URLs, give them enough lifetime to cover container creation and processing.
  4. 4Rename files to plain ASCII and URL-encode anything else.
  5. 5Point straight at the file, not at a share page or a redirecting short link.

How to stop it recurring

Stage every post's media at a stable, public HTTPS location dedicated to publishing, with ASCII file names and generous URL lifetimes, and run a HEAD check before creating the container. Keep the file in place until the container reports FINISHED. Slow or oversized downloads fail differently - see 2207003 and 36000/2207004.

Official reference: Meta for Developers - Messenger Platform error codes. See all Instagram error codes or the Instagram limits and quotas.

Related codes

Error 9004 - quick answers

What does Instagram error 9004 mean?

Code 9004 with subcode 2207052 is returned when Instagram tried to download your image_url or video_url and could not. The publishing flow does not accept file bytes on the standard path: Meta's guide says it cURLs the media at the URL you pass, so the file must be on a publicly accessible server at the time of the attempt. Meta's recommended solution is to make sure the URI is valid and publicly available.

How do I fix Instagram error 9004?

1. Request the exact URL with curl -I from a machine outside your network and confirm a 200 response with an image or video content type. 2. Serve media from a public bucket or CDN path with no cookies, headers or login required. 3. If you use presigned URLs, give them enough lifetime to cover container creation and processing. 4. Rename files to plain ASCII and URL-encode anything else. 5. Point straight at the file, not at a share page or a redirecting short link.

Stop debugging Instagram by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.