500 errors occurred when I was using the API

Hello, 500 errors occurred when I was using the API.

curl --location 'https://api.figma.com/v1/files/xxxxx/variables' \
--header 'X-FIGMA-TOKEN: xxxxx' \
--header 'Content-Type: application/json' \
--data '{"variableCollections":[{"action":"DELETE","id":"VariableCollectionId:555:23333"}]}'

The response result is:

 {
    "status": 500,
    "error": true,
    "message": "Error updating file, please try again later"
}

I remember a few months ago, this was working properly, and the query was normal.

The same situation applies when adding variable data, with a status code of 500.



{
  "variableCollections": [
    {
      "action": "CREATE",
      "id": "my_variable_collection",
      "name": "BRE_New_Variable_Collection",
      "initialModeId": "my_mode1"
    }
  ],
  "variableModes": [
      {
          "action": "CREATE",
          "id": "my_mode1",
          "name": "chinese", 
          "variableCollectionId": "my_variable_collection" 
      },
      {
          "action": "CREATE",
          "id": "my_mode2",
          "name": "en", 
          "variableCollectionId": "my_variable_collection" 
      }
  ],
  "variables": [
      {
          "action": "CREATE",
          "id": "my_variable1",
          "name": "bre账号名",
          "resolvedType": "STRING",
          "variableCollectionId": "my_variable_collection" 
      }
  ],
  "variableModeValues": [
      {
          "variableId": "my_variable1", 
          "modeId": "my_mode1", 
          "value": "张三"
      }
  ]
}

Thank you for your review. If there is a solution, please let me know. Thank you very much!

2 Likes

I have the same problem, the write api cannot succeed :unamused:But read api will work

1 Like

Is there any updated on this?? our team is facing the same issue :eyes:

Thanks for the post. I’m checking this with our internal team. We will get back to you when I have anything that I can share with you.

Thanks for your patience.

Toku

Hi all,

I’ve checked with our engineering team and they confirmed it was a bug and they’ve already fixed it. Could you please try again and let me know how it works?

Thanks!
Toku

Hi @y_toku, this seems to be an issue again. I can successfully read files, however receive a 500 error and “Error updating file, please try again later” in response to a POST request. Even on the Figma documentation page itself. I’ve had this issue since at least 28th March '24. Any help would be greatly appreciated.

Thanks for flagging. I’ll check internally again and will get back to you if there is anything I can share with you! Thanks

Hi there,

Our internal internal team confirmed it’s fixed. Could you check? If you still have the issue, please let us know.

Thanks!
Toku