post

/dataspace/sync/upsert

UpsertData

There are two versions of UpsertData API calls, synchronous and asynchronous. This particular version is the synchronous version where no more than 1000 records rows are subject to be inserted/updated on a data table at in a single call. If you require to insert more than 1000 records at a single call, Asynchronous UpserData call must be used. The method is used to insert bulk new records or update existing ones on a data table except sys_contact table.

The method is used to insert bulk new records or update existing ones on a data table except sys_contact table.

If the target data table has primary key values, UpsertData call has to include these primary key values in input data rows as well as the rest of the to-be-updated column values.

If the target data table has no primary key values, UpsertData appends input data rows to the data table.

Input data row has to include all the column values of the target data table, otherwise an error will be returned.

Important Note

You can form the request body in two different ways by using either of the following input parameters

OPTION 1: Using tableId which is the uuid of the data table OPTION 2: Using tableName which is the name of the data table

DateTime Format:

  • yyyy-MM-dd
  • yyyy-MM-dd HH:mm
  • yyyy-MM-ddTHH:mm
  • yyyy-MM-dd HH:mm:ss
  • yyyy-MM-ddTHH:mm:ss
  • yyyy-MM-dd HH:mm:ss.f
  • yyyy-MM-dd HH:mm:ss.ff
  • yyyy-MM-dd HH:mm:ss.fff
  • yyyy-MM-ddTHH:mm:ss.f
  • yyyy-MM-ddTHH:mm:ss.ff
  • yyyy-MM-ddTHH:mm:ss.fff
  • yyyy-MM-ddTHH:mm:ssZ
  • yyyy-MM-ddTHH:mm:ss.fffZ

Request Parameters

1 Header

Request Body

tableId OR tableName is required.

2 Examples
Schema
object
tableId
string

the id of the table to be upserted. tableId OR tableName is required.

tableName
string

the name of the table to be upserted. tableId OR tableName is required.

columns
array[string]

The columns to be upserted

1 validation
rows
array[object]

The rows to be upserted.

1 validation

Responses

At least some rows are inserted / updated in the table. Please see errorCount and error list objects to see if there is an error.

1 Example
Schema
object
transactionId
string
code
integer
message
string
data
object

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
$$.env
1 variable not set
access_token