Update Record via API Not Working

Hi all, I’m working on a flow that triggers an action which is external to Bubble. Based on the result of that action, I need to update a record in my database via the Bubble API.

When I send a PUT request, I keep getting this error with status code 500: “{“error_class”:“UnexpectedPostgresError”,“args”:{“code”:“1707599464584x314050118428019140”},“message”:“Sorry, we ran into a temporary bug and can’t complete your request. We’ll fix it as soon as we can; please try again in a bit!”}”

This is a screenshot of the PUT request I’m making.

Any ideas why it’s not working?

This is generally a Bubble issue rather than your own issue. Although, if you’re just updating one field, use PATCH.

When updating your object, it’s important to choose the correct HTTP method. Use PATCH to update specific fields of your object, and PUT to replace the entire object.

The PUT HTTP method will overwrite all editable fields on a record. Fields not specified in the request will be left empty or reset to their default values, as set in the Data Type editor.

To ensure your API call is set up correctly, consider the following checks:

  1. Privacy Rules: Your request will only succeed if the “Modify via API” privacy setting is active for the relevant data type. For more details, refer to Data API Privacy Rules.
  2. Request Body: The body of your request should be a JSON object containing a list of keys and values you wish to modify.