Create new branch for file via REST API

I would really like to see the ability to create new branches for an existing file via the REST API. This is particularly important when implementing Figma variables via the REST API since the REST API is a prime opportunity for automating workflows for design and developer collaboration and unification.

For example, our team is actively working to implement this basic workflow:

  1. Contributor updates tokens in our token repository
  2. When tokens are released, a build script converts tokens to Figma variable format and creates / updates them via the REST API

This process would help to ensure our design resources are up-to-date. However, the issue with this approach is that POSTing to the REST API automatically updates the file’s local variables, and the designer is not informed of the updates. This creates a situation where designers have no ability to manage or be informed of changes that occur in the file.

In an ideal world, every time we run the script to POST our tokens to Figma, we would first create a new branch of the file with a custom name (such as “Update to tokens version {tokenVersion}”.

The benefit to this approach is that designers would retain governance over their files, and could approve or reject updates if needed. Since Figma is already leaning (slightly) towards Dev workflows with Branching features, it makes sense to incorporate functionality like this within the REST API as well.

6 Likes

Yes it makes sense to incorporate functionality like this within the REST API as well. +1
I am on the same page. Api should be able to work on a branch.