Cadense

Upsert Row

Insert a new row or update an existing one based on a unique column value. The table must have at least one column with a unique constraint. If a row with a matching unique value exists, it is updated; otherwise, a new row is inserted. When multiple unique columns exist, specify `conflictTarget` to indicate which column to match on.

POST
/api/v1/tables/{tableId}/rows/upsert
X-API-Key<token>

Your Cadense API key (personal or workspace). Generate one from the Cadense dashboard under Settings > API Keys.

In: header

Path Parameters

tableId*string

The unique identifier of the table.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST \  "https://cadense.io/api/v1/tables/{tableId}/rows/upsert" \  -H "X-API-Key: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "workspaceId": "YOUR_WORKSPACE_ID",    "data": { "email": "[email protected]", "name": "John" }  }'
{  "success": true,  "data": {    "row": {      "id": "row_abc123",      "data": {        "email": "[email protected]",        "name": "John Doe"      },      "createdAt": "2026-01-15T10:30:00Z",      "updatedAt": "2026-01-15T10:30:00Z"    },    "operation": "insert",    "message": "Row inserted successfully"  }}
On this page

On this page

No Headings