How to retrieve user's teams, projects and files through Figma API after authentication

I’m working on a personal project using Figma’s API and I need help figuring out how to get information about a user’s workspace after they authenticate with OAuth.

The main issue I’m facing is that I want to fetch the files, projects, and teams that belong to a specific user once they’ve logged in. I’ve been looking through the API documentation but I can’t seem to find the right endpoints for this.

I did find an endpoint that lets me get all projects for a particular team, but here’s the catch - I need the team ID first. The problem is that after OAuth authentication, I don’t get any user details that would tell me which teams they belong to.

Has anyone worked with this before? I’m stuck on how to bridge this gap between user authentication and actually accessing their workspace data. Any suggestions would be really helpful!

I encountered a similar situation while integrating with the Figma API recently. The main challenge is the absence of a straightforward method to retrieve all user teams. I suggest starting with the /v1/files/recent endpoint, which provides details on recently accessed files and reveals the associated team information. This way, you can collect the team IDs and then use them to fetch projects with the endpoints you have found. If applicable, accessing specific files through the /v1/files/{file_key} endpoint can also give you useful team and project metadata. While the API design may not seem intuitive at first, this approach has proven effective.