Versin history

🔄 Figma REST API – Version History

✅ Endpoint

GET https://api.figma.com/v1/files/{file_key}/versions

This endpoint retrieves the list of named versions for a given file.


---

🔐 Authentication Required

Use a Personal Access Token (PAT) as a Bearer token in the Authorization header.

You can create a PAT from: https://www.figma.com/developers/api



---

📌 How to Get file_key

You get it from the Figma file URL:

https://www.figma.com/file/<file_key>/<filename>

Example:

URL: https://www.figma.com/file/abc123XYZ/Design-v1  
→ file_key = abc123XYZ


---

📥 Example Request (with curl)

curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     https://api.figma.com/v1/files/abc123XYZ/versions


---

✅ Example Response

{
  "versions": [
    {
      "id": "4452:4",
      "created_at": "2025-07-25T10:00:00Z",
      "label": "Wireframe Start",
      "description": "Basic layout",
      "user": {
        "id": "17",
        "handle": "john.doe@company.com"
      }
    },
    {
      "id": "4452:5",
      "created_at": "2025-07-27T15:40:30Z",
      "label": "Final UI",
      "description": "Ready for dev",
      "user": {
        "id": "18",
        "handle": "jane.lead@company.com"
      }
    }
  ]
}


---

🧩 Data Fields in Response

Field Description

id Unique ID of the version (used to fetch specific version)
created_at Timestamp of when the version was created
label Custom label assigned to the version
description Text description entered during version save
user.id ID of the user who created the version
user.handle Email or username of the user



---

📂 Fetching a Specific Version of the File

You can retrieve the design content at a specific version:

GET https://api.figma.com/v1/files/{file_key}?version={version_id}

Example:

curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     https://api.figma.com/v1/files/abc123XYZ?version=4452:5

Returns the document tree at that version.


---

❌ Limitations of Version History API

Limitation Details

Only named versions shown Autosaved versions (every few minutes) are not listed
Cannot restore a version via API You must use the Figma UI to restore a version
No diff view You cannot see what changed between versions
No edit log No record of element-level changes (e.g. "color changed")
No delete/rename via API Cannot rename or delete versions programmatically



---

🧠 Use Cases

Audit trail of major design milestones

Integrate with ALM tools (e.g., Codebeamer, JIRA)

Sync design versions with product or engineering timelines

Visualize evolution of design in a dashboard



---

✅ Summary Table

Feature Supported via REST API

List named versions ✅ Yes
See version author & date ✅ Yes
Fetch file at version ✅ Yes (version= param)
View element-level diffs ❌ No
Restore a version ❌ No
Delete/rename version ❌ No
Access autosaved versions ❌ No



---

Would you like a Postman collection, a code integration, or help with syncing version data to an external tool (like Codebeamer or JIRA)?

Comments

Popular posts from this blog

My work

color change