file Create
Requires access scope,
access scope or
access scope. Also: Users must have create files permissions.
Creates file assets for a store from external URLs or files that were previously uploaded using the
mutation.
Use the mutation to add various types of media and documents to your store. These files are added to the
Files page in the Shopify admin and can be referenced by other
resources in your store.
The mutation supports multiple file types:
- Images: Product photos, variant images, and general store imagery
- Videos: Shopify-hosted videos for product demonstrations and marketing
- External videos: YouTube and Vimeo videos for enhanced product experiences
- 3D models: Interactive 3D representations of products
- Generic files: PDFs, documents, and other file types for store resources
The mutation handles duplicate filenames using configurable resolution modes that automatically append UUIDs, replace existing files, or raise errors when conflicts occur.
After creating files, you can make subsequent updates using the following mutations:
: Update file properties such as alt text or replace file contents while preserving the same URL.
: Remove files from your store when they are no longer needed.
To list all files in your store, use the
files
query.
Learn how to manage product media and file assets in your app.
Arguments
- Anchor to filesfiles•[File
Create Input!]! required List of new files to be created.
- Anchor to filesfiles•[File!]
The newly created files.
- Anchor to userErrorsuser•[Files
Errors User Error!]! non-null The list of errors that occurred from executing the mutation.