Skip to content

feat: full Figma REST API coverage (46/46 endpoints)#1

Merged
alexey1312 merged 3 commits intomainfrom
feat/full-figma-api-coverage
Mar 16, 2026
Merged

feat: full Figma REST API coverage (46/46 endpoints)#1
alexey1312 merged 3 commits intomainfrom
feat/full-figma-api-coverage

Conversation

@alexey1312
Copy link
Contributor

Summary

  • Add 38 new endpoints to achieve 100% coverage of Figma REST API v0.36.0 (46/46 endpoints)
  • Refactor internal baseURL from https://api.figma.com/v1/ to https://api.figma.com/ to support both v1 and v2 API paths (no public API change)
  • Update README with correct usage examples and feature list

Endpoints added by category

Category Endpoints HTTP Methods
User /me GET
Files /files/:key (HEAD), /files/:key/images, /files/:key/versions, /files/:key/variables/published GET, HEAD
Comments /files/:key/comments GET, POST, DELETE
Components /components/:key, /teams/:id/components GET
Component Sets /component_sets/:key, /files/:key/component_sets, /teams/:id/component_sets GET
Styles /styles/:key, /teams/:id/styles GET
Projects /teams/:id/projects, /projects/:id/files GET
Reactions /files/:key/comments/:id/reactions GET, POST, DELETE
Dev Resources /files/:key/dev_resources GET, POST, PUT, DELETE
Webhooks (v2) /v2/webhooks, /v2/webhooks/:id, /v2/teams/:id/webhooks, /v2/webhooks/:id/requests GET, POST, PUT, DELETE
Analytics activity_logs, payments, library component/style/variable actions & usages GET

New patterns introduced

  • HEAD request (GetFileMetaEndpoint) — extracts metadata from HTTP response headers
  • Cursor pagination (PaginationParams) — for team-level list endpoints
  • v2 API support — webhooks use /v2/ prefix while all other endpoints use /v1/
  • PUT method — for updating dev resources and webhooks

Test plan

  • swift build compiles without errors
  • swift test — all 290 test cases pass (0 failures)
  • 22 new JSON fixtures for response parsing tests
  • All new public types conform to Sendable
  • No breaking changes to public API

Add 38 new endpoints covering the complete Figma REST API v0.36.0:

- User: GET /me
- Files: HEAD /files/:key, GET /files/:key/images, GET /files/:key/versions,
  GET /files/:key/variables/published
- Comments: GET/POST/DELETE /files/:key/comments
- Components: GET /components/:key, GET /teams/:id/components
- Component Sets: GET /component_sets/:key, GET /files/:key/component_sets,
  GET /teams/:id/component_sets
- Styles: GET /styles/:key, GET /teams/:id/styles
- Projects: GET /teams/:id/projects, GET /projects/:id/files
- Reactions: GET/POST/DELETE /files/:key/comments/:id/reactions
- Dev Resources: GET/POST/PUT/DELETE /files/:key/dev_resources
- Webhooks (v2): GET/POST/PUT/DELETE /v2/webhooks, GET /v2/teams/:id/webhooks,
  GET /v2/webhooks/:id/requests
- Analytics: activity_logs, payments, library component/style/variable
  actions and usages

Refactor baseURL from https://api.figma.com/v1/ to https://api.figma.com/
so endpoints can target both v1 and v2 paths. This is an internal change
with no impact on the public API.

Add PaginationParams for cursor-based team endpoints, EmptyResponse for
DELETE operations, and 22 new JSON fixtures with 290 total test cases.
- Fix DELETE endpoints crashing on empty 204 No Content responses by
  adding explicit content(from:with:) that handles empty body
- Fix POST/PUT dev_resources to use correct path /v1/dev_resources with
  batch request/response wrapping (dev_resources/links_created/links_updated)
- Fix PostDevResourceBody to include required file_key field per spec
- Fix PutDevResourceBody to match spec (remove dev_status, keep id/name/url)
- Fix GetPaymentsEndpoint to use query params per spec instead of path params
- Fix GetWebhooksEndpoint to use query params (context, context_id) per spec
- Fix GetActivityLogsEndpoint to use correct query filters per spec
- Fix GetFileMetaEndpointTests for Linux FoundationNetworking compatibility
- Remove incorrect @available deprecation from GetTeamWebhooksEndpoint
- Add pageSize validation precondition to PaginationParams
- Narrow Codable to Decodable for read-only models (Webhook, DevResource,
  FileVersion, ComponentSet, User)
Prevents downstream clients (e.g. ExFig) from hardcoding the base URL
in their mock clients, which would silently break when the URL format
changes (as it did when moving version prefix into individual endpoints).
@alexey1312 alexey1312 merged commit 028e774 into main Mar 16, 2026
2 checks passed
@alexey1312 alexey1312 deleted the feat/full-figma-api-coverage branch March 16, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant