Figma
Proxy for the Figma REST API via the managed gateway.
What this connector does
Gives agents gated access to Figma for:
- Reading files, specific nodes, components, and version history.
- Rendering nodes to image URLs (PNG/SVG/PDF).
- Listing and posting file comments.
- Listing files in a project and projects in a team.
All operations are gated by PBAC policy. Every call flows: agent → gateway → /introspect (with this connector's resource_type) → OPA decision → Figma API → response.
The connector supports two auth modes, chosen per managed resource at install time:
- Per-user passthrough (
idp_passthrough, recommended) — the gateway forwards each calling user's own Figma OAuth token (captured when they log in to PolicyArc through the Figma IdP), asAuthorization: Bearer. Figma enforces its own file/project permissions, and its audit shows the real person. - Shared service token (
static) — every call uses one operator-held Figma personal access token via theX-Figma-Tokenheader (Figma PATs are not Bearer tokens). PolicyArc still enforces per-user policy and audit in front, but Figma sees a single identity.
Note on auth: Figma's OAuth is OAuth 2.0, not OpenID Connect — it issues no
id_token. PolicyArc still uses it as a login IdP the same way it uses GitHub: the subject is derived from the Bearer-authed userinfo endpoint (GET /v1/me). The bundledfigmaIdP preset wires this up.
Prerequisites
-
A Figma account with access to the files you want to reach.
-
Passthrough mode: a Figma IdP registered in PolicyArc with provider key
figma. Pick Figma in the IdP setup wizard — the bundled preset fills in the endpoints (authorizehttps://www.figma.com/oauth, tokenhttps://api.figma.com/v1/oauth/token, userinfohttps://api.figma.com/v1/me). You supply the Client ID / secret from a Figma OAuth app (figma.com/developers/apps) whose redirect URL is the AS's/oauth2/callback. Users must log in to PolicyArc through that Figma IdP — the gateway replays the token captured at login.Token refresh: Figma refreshes at a distinct URL (
/v1/oauth/refresh); if the deployment can't target it, users re-authenticate at token expiry. Static mode is unaffected. -
Static mode: a Figma personal access token with the scopes you want to gate, stored in a PolicyArc secret.
Install
Pick the auth mode in the install form's Authentication field (defaults to
idp_passthrough). The access-token field only appears when static is
selected; passthrough installs need no secret.
Verify
The gateway path is /gateway/<resource name>/<Figma REST path>. The install
form names the resource after the connector id without its vendor prefix, and
the name cannot be edited, so the resource answers at /gateway/figma/...:
curl "https://<your-as>/gateway/figma/v1/files/<file_key>" \
-H "Authorization: Bearer <token>"
In idp_passthrough mode, the default, <token> must be a user token, issued
through an authorization-code login by a user who signed in with the figma
IdP. A 200 with the file JSON means policy allowed the call and Figma accepted the
forwarded user token. A client_credentials token carries no user, so the
gateway answers 502 with "Upstream auth failed: token resolution requires an
authenticated subject". In static mode the gateway sends its configured token
itself, and an agent's client_credentials token is enough.
Getting tokens covers both grants.
What can go wrong
| Symptom | Cause | Fix |
|---|---|---|
403 from Figma | Token lacks access to the file or the needed scope | Check the token's scopes and the user's file/project access. |
404 from Figma | Wrong file_key/project_id/team_id | Confirm the key from the Figma URL. |
403 from the gateway | Agent lacks the required scope | Request a token with the fig:* scope matching the route. |
404 at the gateway | Wrong path | Gateway path is /gateway/<resource name>/<Figma REST path>; a default install is named figma. Figma paths start with /v1/.... |
401 with "error": "idp_link_required" (passthrough mode) | The user has no linked figma token, or the linked token lacks a scope the connector now requires | Open the link_url from the response body and sign in again. |
502 "Upstream auth failed: token resolution requires an authenticated subject" (passthrough mode) | The token is a client_credentials token, which carries no user | Use a user token from an authorization-code login. |