Bulk edit variables
documentedBulk create, update, and delete local variables and variable collections in a file.
POST /v1/files/{file_key}/variablesVariablesno implementation yet0 runsNo implementation yet. Run it to have the agent write one, or open a pull request with your own.
Seed example (keychains curl)
npx -y keychains@latest curl "https://api.figma.com/v1/files/{{$file_key}}/variables" \
-X POST \
-H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"variableCollections": [ {"action": "CREATE", "id": "col_{{$collection_id}}", "name": "Example Variable Collection", "initialModeId": "mode_{{$mode_id}}"} ], "variableModes": [ {"action": "CREATE", "id": "mode_{{$mode_id}}", "name": "Default", "variableCollectionId": "col_{{$collection_id}}"} ], "variables": [ {"action": "CREATE", "id": "var_{{$variable_id}}", "name": "Primary Color", "variableCollectionId": "col_{{$collection_id}}", "resolvedType": "COLOR"} ], "variableModeValues": [ {"variableId": "var_{{$variable_id}}", "modeId": "mode_{{$mode_id}}", "value": {"r": {{$r}}, "g": {{$g}}, "b": {{$b}} }} ] }'