To export one element as PNG, JPEG, SVG, or PDF, do not call the file endpoint. Use GET https://api.figma.com/v1/images/{file-key}?ids={node-id}&format=png with your auth header. The response is {"err": null, "images": {"2265:3848": "https://...download url..."}}; fetch the URL yourself to get the file. You can pass multiple comma-separated node IDs in one call. Use the colon form of the node ID (1:2), not the dash form (1-2) shown in browser URLs. Scale and format are query params (scale=2 for retina).

Context: Stack Overflow #67126131 (best answer, 5 votes): exporting a specific element as PNG or JPEG through the REST API is not obvious from the docs. The top answer gives the images endpoint: it takes node IDs and returns a JSON payload with download URLs from Figma's render bucket.