Hi everyone,
I’m trying to use the Shopify Admin GraphQL API to attach a video (already uploaded to Shopify Files) to a product as a media item.
Here’s what I’ve done so far:- Successfully uploaded a video via Shopify Admin → Content → Files
However, when I try to use either of these with the productCreateMedia mutation, it fails with an error.
My question:
Is there any supported way to attach a video that already exists in Shopify Files to a product using the GraphQL API?
Thank you
Hi there!
Great question.
At the moment, Shopify’s GraphQL Admin API doesn’t support directly attaching a video from Shopify Files to a product via a native field. However, there’s a solid workaround:
You can use the productMediaCreate mutation to add videos to a product, but it typically expects a direct video URL or upload. To work with videos stored in Shopify Files, you can:
-
Get the URL of the video from your Files.
-
Use that URL as the mediaContentType: VIDEO_EXTERNAL when calling productCreateMedia.
Keep in mind, this works best with publicly accessible video URLs (which Files provides), but sometimes Shopify may restrict external URLs for certain operations. If that becomes an issue, uploading the video directly or using a third-party platform like Vimeo or YouTube for hosting might be more stable.
If you’re working on something custom or building out a larger workflow, I’d be happy to jump in and set this up or extend the functionality depending on your use case—feel free to reach out!
Absolutepro | Shopify Expert & Developer
Custom Solutions | API Integrations | Theme Tweaks