Write API PUT Returning 404 when attempting an upsert

According to your documentation, when using the Write API PUT action, if the resource does not exist it will create it, else it will update the resource that matches the id passed in the URL.
I have no issue updating an existing resource but how do I accomplish an insert with a PUT, effectivly an upsert? Whenever I make the PUT request with an ID that does not exist, I get a 404 response from the API.

Thanks

Hey @tim , The resource mentioned in the documentation refers to fields that already exist in the model—it does not imply that a new entry will be created with a PUT request. If you have an existing entry with some fields left blank, the PUT request will update those fields with the provided values.

" When sending a PUT request, provide the complete representation of the resource you want to replace. This replaces the existing resource, or if the resource doesn’t exist, it creates a new resource. If you don’t specify a property, it is deleted."

Also, please note that the entry ID must refer to a valid existing entry. If your goal is to create a new entry, you should use a POST request instead.

Let me know if you have any further questions!

your document specifically states… if the resource doesn’t exist, it creates a new resource. Please fix your documentation.

[

PUT

](Builder.io Write API)

Use a PUT request to create or replace an entire resource.

When sending a PUT request, provide the complete representation of the resource you want to replace. This replaces the existing resource, or if the resource doesn’t exist, it creates a new resource. If you don’t specify a property, it is deleted.