Advanced
Webhooks
Receive real-time notifications when Figma files, comments, or libraries change.
Webhooks push events to your server in real-time. Instead of polling the API, register a webhook and Figma will send HTTP POST requests to your endpoint when events occur.
Supported Events
| Event | Trigger |
|---|---|
FILE_UPDATE | A file is saved or modified |
FILE_DELETE | A file is deleted |
FILE_VERSION_UPDATE | A new version is created |
FILE_COMMENT | A comment is added or replied to |
LIBRARY_PUBLISH | A library is published |
Creating a Webhook
1
Set up your endpoint
2
Create an HTTPS endpoint that accepts POST requests and returns a
200 status:3
Express
Flask
4
Register the webhook
5
curl -X POST "https://api.figma.com/v2/webhooks" \
-H "X-Figma-Token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event_type": "FILE_UPDATE",
"team_id": "YOUR_TEAM_ID",
"endpoint": "https://your-server.com/webhooks/figma",
"passcode": "your-secret-passcode",
"description": "File update notifications"
}'
6
Verify the passcode
7
Every webhook request includes a
passcode field. Verify it matches the passcode you set during registration:8
app.post("/webhooks/figma", (req, res) => {
if (req.body.passcode !== process.env.FIGMA_WEBHOOK_PASSCODE) {
return res.status(401).send("Unauthorized");
}
// Process event...
res.status(200).send("OK");
});
Webhook Payload
FILE_UPDATE payload
FILE_UPDATE payload
FILE_COMMENT payload
FILE_COMMENT payload
LIBRARY_PUBLISH payload
LIBRARY_PUBLISH payload
Managing Webhooks
List your active webhooks:
curl -H "X-Figma-Token: YOUR_TOKEN" \
"https://api.figma.com/v2/webhooks/YOUR_TEAM_ID"
Delete a webhook:
curl -X DELETE "https://api.figma.com/v2/webhooks/WEBHOOK_ID" \
-H "X-Figma-Token: YOUR_TOKEN"