I’ve been using the Notion API to retrieve articles, which include images, and I noticed a problem recently. Up until now, when I requested file objects, they contained properties like name, url, and expiry_time, as the documentation specified. However, after my latest API call, the response is not what I expect.
Now, it looks like this:
"ProfilePicture": {
"id": "mX%4A%2F",
"type": "files",
"files": [
{
"name": "avatar-photo.jpg"
}
]
}
The url property is missing, which is causing issues because I need those URLs to display the images properly. I’m still on API version “2021-08-16” and haven’t made any changes to my code. Has anyone faced a similar situation? Did Notion make any updates that might have led to the absence of file URLs?
This happens when your integration can’t access the files properly. No URL means Notion can’t create the download link - usually because the file wasn’t uploaded through the API or your integration doesn’t have the right permissions. I ran into this with databases where files were added manually through the web interface. Fixed it by updating my integration settings to include “Read content” permissions for files and media. After that, a fresh API call returned complete file objects with URLs. Also check if your integration token expired - Notion sometimes returns incomplete objects when auth is partially failing instead of throwing a proper error.
Check your API version - they changed file URL handling in newer versions. Also make sure you’re pulling the full page content, not just metadata. Notion sometimes strips URLs if files are too big or they’re having bandwidth issues. Try the same request again in a few minutes - could just be temporary.
Had this exact same issue two weeks ago - spent hours pulling my hair out! Your code’s fine, and Notion didn’t change anything on their end. You’re probably hitting cached data or there’s an auth scope problem. In my case, I’d uploaded files directly through Notion’s interface instead of the API, and for whatever reason the API only returned partial file objects. Try a fresh request with explicit auth headers and double-check your integration has the right permissions for file content. Also, file URLs sometimes get stripped while Notion’s still processing them, so I added a small delay before requesting file details - that fixed it for me.