botruntime
API ReferenceTables API

Upsert Table Rows

Inserts or updates rows based on a key. If a row exists, it is updated; otherwise, a new row is created.

POST
/v1/tables/{table}/rows/upsert

Path Parameters

table*string

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

Request Body

application/json

Rows for insertion or update, with a key column to determine action. Supports partial successes.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/tables/string/rows/upsert" \  -H "Content-Type: application/json" \  -d '{    "rows": [      {}    ]  }'
{  "inserted": [    {      "id": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "computed": {        "property1": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        },        "property2": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        }      },      "stale": [        "string"      ],      "similarity": 0    }  ],  "updated": [    {      "id": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "computed": {        "property1": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        },        "property2": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        }      },      "stale": [        "string"      ],      "similarity": 0    }  ],  "warnings": [    "string"  ],  "errors": [    "string"  ]}
{  "inserted": [    {      "id": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "computed": {        "property1": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        },        "property2": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        }      },      "stale": [        "string"      ],      "similarity": 0    }  ],  "updated": [    {      "id": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "computed": {        "property1": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        },        "property2": {          "status": "string",          "error": "string",          "updatedBy": "string",          "updatedAt": "string"        }      },      "stale": [        "string"      ],      "similarity": 0    }  ],  "warnings": [    "string"  ],  "errors": [    "string"  ]}