From 6e17c513619a139c1157d2c207324a8eddbec8d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 6 Jul 2026 23:08:05 +0000 Subject: [PATCH] Document why upsert returns 200 where insert returns 201 An upsert may update existing rows without creating anything, so it deliberately does not claim resource creation with a 201. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GrHZSypDfMnym1tM5XJAFZ --- docs/json_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/json_api.rst b/docs/json_api.rst index 32d28733..2105d6e0 100644 --- a/docs/json_api.rst +++ b/docs/json_api.rst @@ -1944,7 +1944,7 @@ The above example will: Similar to ``/-/insert``, a ``row`` key with an object can be used instead of a ``rows`` array to upsert a single row. -If successful, this will return a ``200`` status code and a ``{"ok": true}`` response body. +If successful, this will return a ``200`` status code and a ``{"ok": true}`` response body. This is deliberately different from the ``201`` returned by :ref:`insert `: an upsert may update existing rows without creating anything, so it does not claim resource creation. Add ``"return": true`` to the request body to return full copies of the affected rows after they have been inserted or updated: