Records Management

Upsert Bulk Records

Upsert multiple records for an object. This endpoint allows you to update existing records or create new ones if they do not exist, based on the id field in the payload, which is useful for synchronizing data or bulk updating records.

patch/api/bulk-upsert/{objectNames}/{recordId}/{childObjectName}

Request

  • Base URL: https://api.reallysimplesystems.com
  • URL: https://api.reallysimplesystems.com/api/bulk-upsert/{objectNames}/{recordId}/{childObjectName}
  • Auth: HTTP bearer

Request body

datastring[] required

An array of records to upsert. Every record MUST include an id field: use null to create a new record, or the id of an existing record to update it. Any record missing the id field fails the whole batch.

Example request

{
  "data": [
    {
      "id": null,
      "Name": "Test Account API 1",
      "OwnerId": 1
    },
    {
      "id": 95,
      "Name": "Existing Account Updated"
    }
  ]
}

Response

Records created and/or updated successfully.

statusstring
messagestring

Example response

{
  "status": "success",
  "message": "Records upserted successfully.",
  "data": [
    {
      "metadata": {
        "url": "https://local.reallysimplesystems.com/api/account/1",
        "list_url": "https://local.reallysimplesystems.com/api/accounts",
        "parent": null,
        "object_type": "record",
        "record_type": "account"
      },
      "record": {
        "id": 1,
        "name": "Test Account API 1",
        "ownerid": 1
      }
    },
    {
      "metadata": {
        "url": "https://local.reallysimplesystems.com/api/account/95",
        "list_url": "https://local.reallysimplesystems.com/api/accounts",
        "parent": null,
        "object_type": "record",
        "record_type": "account"
      },
      "record": {
        "id": 95,
        "name": "Existing Account Updated"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.