POST
/
v1
/
tables
/
{table}
/
rows
/
upsert
curl --request POST \
  --url https://api.botpress.cloud/v1/tables/{table}/rows/upsert \
  --header 'Content-Type: application/json' \
  --data '{
  "rows": [
    {
      "id": 123
    }
  ],
  "keyColumn": "id",
  "waitComputed": true
}'
{
  "inserted": [
    {
      "id": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "computed": {},
      "stale": [
        "<string>"
      ],
      "similarity": 123
    }
  ],
  "updated": [
    {
      "id": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "computed": {},
      "stale": [
        "<string>"
      ],
      "similarity": 123
    }
  ],
  "warnings": [
    "<string>"
  ],
  "errors": [
    "<string>"
  ]
}

Path Parameters

table
string
required

The table's name or unique identifier for targeting specific table operations.

Body

application/json
Rows for insertion or update, with a key column to determine action. Supports partial successes.
rows
object[]
required
keyColumn
string
default:id

Determines if a row is inserted or updated. Defaults to "id".

Required string length: 1 - 30
waitComputed
boolean

Ensure computed columns are fully processed before returning the result. This is applicable only when the number of rows involved is fewer than 1.

Response

200
application/json
Summary of insertions and updates, including any warnings or errors.
inserted
object[]
required
updated
object[]
required
warnings
string[]

Alerts for minor issues that don't block the operation but suggest possible improvements.

errors
string[]

Critical issues in specific elements that prevent their successful processing, allowing partial operation success.