Add the folders endpoints (replacing the deprecated projects endpoints) - #120
Open
JWMarchant wants to merge 4 commits into
Open
JWMarchant wants to merge 4 commits into
JWMarchant wants to merge 4 commits into
Conversation
Figma deprecated the projects endpoints in August 2026 in favour of folders, and personal access tokens can no longer be granted the files:read scope that /v1/teams/:team_id/projects and /v1/projects/:project_id/files require - the token scope picker only offers the granular scopes now, so both calls return 403 "Invalid scope" for any token created today. That leaves the library with no working way to list the files in a project. Add the four replacements, which the folders:read scope covers (folder_metadata:read for getFolderMeta): - getTeamFolders GET /v2/teams/:team_id/folders - getFolderFolders GET /v2/folders/:folder_id/folders - getFolderFiles GET /v2/folders/:folder_id/files - getFolderMeta GET /v2/folders/:folder_id/meta They sit on v2 like the webhooks endpoints do, so the version goes in config as API_VER_FOLDERS rather than being inlined. Folder IDs are the same values as project IDs and the response shapes are unchanged, so callers migrating only have to rename the call and the path param. The projects endpoints keep working for anyone still holding an older token, so they are marked deprecated rather than removed. Verified against the live API: getFolderFiles and getFolderMeta return the expected payloads, and getProjectFiles returns the 403 described above. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a Folders section to the endpoints list with the one-line migration example, and a warning on the Projects section explaining why those calls now fail: tokens created today cannot be granted the files:read scope they need. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Figma deprecated the projects endpoints in August 2026 in favour of folders, and the
files:readscope they require is no longer offered when creating a personal access token — the picker only exposes the granular scopes now. The result is thatgetProjectFilesandgetTeamProjectsfail for any token created today:That token has every scope the UI offers,
folders:readincluded. There is currently no way to list the files in a project using this library with a new token.What this adds
getTeamFoldersGET /v2/teams/:team_id/foldersfolders:readgetFolderFoldersGET /v2/folders/:folder_id/foldersfolders:readgetFolderFilesGET /v2/folders/:folder_id/filesfolders:readgetFolderMetaGET /v2/folders/:folder_id/metafolder_metadata:readFolder IDs are the same values as project IDs and the response shapes are unchanged, so migrating is a rename:
Notes
@figma/rest-api-specfloor moved to0.42.0(was0.37.0). The folders types first appear in 0.42.0 — I checked 0.38–0.41 and none of them haveGetFolderFilesResponse. The existing range would have resolved to a spec without them.@deprecatedcomment and a README warning pointing at the replacements.API_VER_FOLDERSadded toconfig.tsrather than inliningv2, matching howAPI_VER_WEBHOOKSis handled.lib/is rebuilt in its own commit so the generated diff doesn't bury the source review.Verification
tsc --noEmitclean,npm test53/53 passing (8 new). Checked against the live API with a real token:getFolderMeta's 401 is the token's missing scope, not the URL — that endpoint needsfolder_metadata:read, which isn't offered alongside the others.Commits
CHANGELOG.mdentry is under## [Unreleased]— happy to move it under a version heading if you'd rather set that here.🤖 Generated with Claude Code