POST
and the Prefer: resolution=merge-duplicates
header:
Prefer: resolution=ignore-duplicates
.
On Conflict
By specifying the on_conflict query parameter, you can make upsert work on a column(s) that has a UNIQUE constraint.PUT
You can also upsert data withPUT
:
Response
If the data was inserted, the response status code will be201 Created
. If the data was updated, the response status code will be 200 OK
.
The response body will be empty by default, but you can add a select
query parameter to select the columns that should be returned: