Figma OAuth API list all files

Hi, I just wanted to know whether there is a Figma API endpoint that allows me to list a user’s files (all the documents that he’s created). I can’t find an endpoint for this in the documentation and I’m wondering if this is even possible.

This isn’t currently supported by the Figma API; I think this is intentional to prevent overloading Figma’s servers with many large requests

1 Like

I concur. It was the first thing I noticed when investigating this API for possible use cases. I can’t find any useful scenarios where it’s convenient for users to retrieve files from this very basic RESTful API.

I’m genuinely curious about how others utilize this API. It seems they expect you to remember file IDs, which is quite impractical. How does one obtain these IDs to present to a user who wishes to fetch their files, perhaps from an Excel Power script?

In terms of UX, it’s definitely not great to ask the user to remember a file id. Instead, I’ve been asking users to copy and paste their Figma file url into some kind of text field. I then use a regular expression to extract the file id.

Obviously it’s more ideal to be able to retrieve a list of files and their names/ids from the API programatically.

In javascript, extracting the file key would look something like this:

// regular expression that matches figma file urls
const regex = /^((http|https):\/\/)?(www\.)?\/file\/([a-zA-Z0-9]{22})(.*)?/

// test the user input against the regular expression
const matches = userInput.match(regex)

// if there are no matches, the user didn't paste a link to their figma file
if (matches === null) return

// if there is a match, the fourth group matched will be the file id
const id = matches[4]