Updating images via the api

I am writing some migration scripts to migrate a website from another CMS to builder. As such I have to migrate images. I know how to create images in builder via the API but I am always inserting new images and am ending up having multiple instance of the same image in the asset library. Is there a way to lookup if an image exists (e.g. by filename) and update it if it exists rather than always create a new version of the image (e.g. an upsert)?

Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.

Builder content link
e.g. Builder.io: Visual Development Platform

Builder public api key
go to Builder.io: Visual Development Platform and copy your PUBLIC api key

What are you trying to accomplish
e.g. I want to integrate builder on a landing page

Screenshots or video link
Screenshots of your issue, or even better a link to a video of what is happening or what you are trying to accomplish. We love using loom for that sort of thing

Code stack you are integrating Builder with
e.g. NextJS, react, Shopify

Reproducible code example
If you are having integration errors, please link to codesandbox or copy and paste your problematic code here. The more detail the better!

Hi John,

There is currently no API endpoint that will return the files you have in the asset library. You could alternatively track your images with a custom content model.

  1. Create a media-assets model in Builder.io
  2. Define Fields such as filename, url, uploadDate, etc

Then, you can query this model using builder.getAll and track your assets through it.