Setting the base directory in build settings via the API when creating a site

I’m using the createSite endpoint to create a new site, and am setting the repo up to build upon create. I have all this working successfully apart from one thing - the part of the repo i’m wanting to build is in a sub folder.

There doesn’t seem to be an option to set this value in the API - I can set the publish directory and the command that needs to run, but not the base.

Is there something missing in the documentation or is this a gap in the API?

Hi welcome back!

I want to confirm when you say “base folder” are you referring to the root of your project?

Have you tried to manually configure your build command to include the path of the subfolder.

Hey @SamO - Yes, thats correct. The “Base Folder” field in the admin when you’re configuring the “Build Settings” where you’d define the starting folder for the repo. As the build process I want to run is not in the root of the repo, I need to set this field, but I need to do it via the API for my use case.

I was going to try doing something like cd folder && npm run build for the command if this was a gap in the capability of the API, but I wanted to check first that I wasn’t missing something.

My other option is to split it out into its own repo so it is in the root, which to be perfectly honest I could do and probably would have its benefits, but I’m purely just interested now as to why this field, in particular, isn’t configurable via the API.

The setting is available as build_settings.base as far as I’m aware.