What custom field must be set inside the collection settings in Webflow for the ExtFileRef type to work when using the CMS API to add photos to a collection?

Published on
September 22, 2023

To use the ExtFileRef type and add photos to a collection using the CMS API in Webflow, you need to set the "API ID" field inside the collection settings.

Here is how you can do it:

  1. Log in to your Webflow account and navigate to the Collections tab.
  2. Select the collection you want to add photos to.
  3. Click on the Collection Settings button located at the top right corner of the page.
  4. In the Collection Settings panel, you will find a field titled "API ID."
  5. Enter a unique identifier for the field in the API ID field. It is recommended to use lowercase letters and underscores instead of spaces or special characters.
  6. Save your changes.

Once you have set the API ID field, you can use the ExtFileRef type in your CMS API calls to add photos to your collection items. The ExtFileRef type allows you to reference external images by their URL, making it convenient to add photos programmatically through the CMS API.

Remember to make sure that the field you create with the ExtFileRef type is also set as a multi-reference field, so that you can assign multiple images to each collection item.

By setting the "API ID" field inside the collection settings, you enable the use of the ExtFileRef type for adding photos to a collection using the CMS API in Webflow.