folder_id on Create Template can only be omitted — letting the API pick a folder — or guessed from an integer read out of an app URL.
Modes
Folders are mode-scoped, matching the transactional / marketing split. Filter withpurpose to get just one side:
folder_id must name a folder of the same mode as its purpose.
A folder’s mode does not set its templates’. Filing a template in a marketing folder does not make it a marketing template — only
purpose on the template does.