Updating templates across multiple websites programmatically

Hello,

We have numerous client sites that use some of the same templates. Managing/syncing updates to templates is becoming increasingly painful.

As such, I would like to make it so that when we update a “master template,” and publish it to GitHub, that it rolls out the latest version to our client sites automatically.

Are there any “gotchas” or references we should know about that would help us on this journey?

My instinct would be to connect to the sites using the WP REST API and update each template post’s (CPT) content and/or settings, but I’m concerned there might be some… nuances to this based on my poking around in the database.

Other/related thoughts:

  1. A setting (in Settings > Templates) to expose Bricks Templates and Meta Fields to the WP REST API would be a good update.

  2. This would be a very helpful tutorial from Bricks, i.e., to understand how to work with templates programmatically.

Thanks so much!