---
title: "Batch upsert a JSON array"
method: POST
path: "/batchupsert_4FY_v1"
---

# Batch upsert a JSON array

`POST /batchupsert_4FY_v1`

Perform batch upserts of JSON arrays

## Request body

- object
  - `dataOptions` object, required — The information that determines the behavior of the batch upsert operations.
    - `table` string, required — The type of records to alter. Can be either <code>Documents</code> or <code>Contacts</code>.
    - `subtypeForNewRecords` string — The contact or asset subtype of any newly-created records. This is required when your call creates new records. <br/> This parameter uses the DataTable API syntax for <a href="https://developer.orangelogic.com/reference/base-calls-for-managing-assets">assets</a> and <a href="https://developer.orangelogic.com/reference/base-calls-for-managing-contacts">Contacts</a> in the format <code>{Documents-or-Contacts}.{Asset_type}.{Asset_subtype}</code>. For example, for a standard video you would use <code>Documents.Video.Default</code>. <br/> For more information on asset types and subtypes, go to the <a href="https://developer.orangelogic.com/reference/assets#asset-type-and-subtype">Assets</a> article.
    - `fieldToMatch` 'MediaEncryptedIdentifier' | 'CoreField.Identifier' | 'CoreField.Id_client' | 'CoreField.OriginalFileName', required — The field used to identify records to update in Orange Logic. This field <strong>must</strong> match the field used to identify records to update or create in the <code>records</code> object.<ul><li>The <code>MediaEncryptedIdentifier</code> is the Record ID.</li><li>The <code>CoreField.Identifier</code> is the Unique ID.</li><li>The <code>CoreField.Id_client</code> is the Legacy ID.</li><li>The <code>CoreField.OriginalFileName</code> is the Original File Name.</li></ul>
    - `ignoreExistingRecords` boolean — Whether to <strong>update</strong> records that already exist in the Orange Logic database. <ul> <li>When <code>true</code>, the call returns the code <code>IGNORED_EXISTING_RECORD</code> if a provided record is found in the Orange Logic database.</li> <li>When <code>false</code>, the call updates the provided record.</li> </ul>
    - `ignoreMissingRecords` boolean — Whether to <strong>create</strong> new records if a provided record does not match any records in the Orange Logic database. <ul> <li>When <code>true</code>, the call returns the code <code>IGNORED_MISSING_RECORD</code> if a provided record is not found.</li> <li>When <code>false</code>, the call creates a new database entry with the provided record if that record is not found in the Orange Logic database.</li> </ul>
    - `multiValueSeparator` string — The separator used to pass values to a multi-valued field, including an authority list, with a single string. For example, let’s say you want a multi-valued field to include the values <code>red</code>, <code>blue</code>, and <code>yellow</code>. If you leave the default <code>multiValueSeparator</code> pipe (<code>|</code>), your field entry would be <code>"red|blue|yellow"</code>. </br> However, we recommend instead using an array of strings with the syntax <code>["red", "blue", "yellow"]</code> because it allows more flexibility in your field entries.
    - `augmentAuthorityListsOnTheFly` boolean — Whether to create new tags if the provided tags do not exist in a multi-valued field’s authority list. <ul> <li>When <code>true</code>, if one of the values assigned to a multi-valued field doesn’t exist in that field’s authority list, Orange Logic creates a new tag for that value, includes it in the authority list, and assigns it to the multi-value field.</li> <li>When <code>false</code>, if a value assigned to a multi-valued field doesn’t exist in that field’s authority list, Orange Logic does not create a new tag or assign the value to that field.</li> </ul>
    - `maxRecordsAffected` integer — The maximum number of Orange Logic database records that the call alters for each record submitted in the call. If Orange Logic finds more records than the maximum specified, it returns an error and doesn’t make any updates. </br> For example, let’s say you want to update the record with the Original File Name “London sunset.” If you set this parameter to one and more than one Orange Logic record has “London sunset” as the Original File Name, Orange Logic will not change any records.
    - `indexInBackground` boolean — Set to `true` to delay indexing and speed up the API call processing time. </br> This parameter is available beginning in [Orange Logic Ottawa](https://developer.orangelogic.com/reference/about#orange-logic-api-versioning).
    - `indexingPriority` 'Medium' | 'Low' | 'VeryLow' — Forces the records to be indexed in a lower-priority queue to avoid impacting the primary indexing queue. For example, if you are calling large batches of records, the calls might fire faster than the database can index them. You can append IndexingPriority=Low to avoid overloading the queue. Leave this parameter blank to keep the call in a high priority indexing queue. </br> This parameter is available beginning in [Orange Logic Ottawa](https://developer.orangelogic.com/reference/about#orange-logic-api-versioning).
  - `executionOptions` object — Determines how Orange Logic completes the call.
    - `executeSynchronously` boolean — Whether the batch job is executed synchronously (foreground) or asynchronously via the agent job (background). <ul> <li>When <code>true</code>, the API call is executed synchronously and you must wait until the server returns the response, including all the results of the batch operation.</li> <li>When <code>false</code>, the API call is executed asynchronously. The batch job is passed to the agent and the API responds immediately with the <a href="https://developer.orangelogic.com/reference/batch-upsert#call-responses">jobRecordID</a> of the asynchronous processing task. You can use this processing task recordID to query the status and the result of the batch job via the <a href="https://developer.orangelogic.com/reference/query-asynchronous-batch-upsert-calls">Query asynchronous batch upsert calls API</a> or in the Orange Logic interface in <strong>Administration</strong> > <strong>Maintenance</strong> > <strong>Show Processing Tasks</strong>.</li> </ul>
    - `successWebHookEndpoint` string — The <a href="https://developer.orangelogic.com/reference/webhooks">webhook</a> that receives success notifications for each upsert operation in an asynchronous batch.
    - `failureWebHookEndpoint` string — The <a href="https://developer.orangelogic.com/reference/webhooks">webhook</a> that receives failure notifications for each upsert operation in an asynchronous batch.
    - `webHookCustomHttpHeaders` object — The custom header is included in the <span style="color:#0171C2">**POST**</span> request to the webhook endpoints. You can use this to add extra context to the webhook notifications with the format <code>"description": "string"</code>.
      - `jobID` string — Example custom webhook header.
  - `records` object[], required — An array that includes one object for each record you want to update or create. Each object must include the field you used in the <code>fieldsToMatch</code> parameter. This field is used to find the record in the Orange Logic platform. You can update multiple fields for each record.
    - `CoreField.Identifier` string — The record's <a href="https://developer.orangelogic.com/reference/assets#unique-identifiers">Unique ID</a>. Enter only if you selected this in the <code>fieldToMatch</code> parameter.
    - `CoreField.MediaEncryptedIdentifier` string — The record's Media Encrypted Identifier, or <a href="https://developer.orangelogic.com/reference/assets#record_id">Record ID</a>. Enter only if you selected this in the <code>fieldToMatch</code> parameter.
    - `CoreField.Id_client` string — The record’s Legacy Identifier. Enter only if you selected this in the <code>fieldToMatch</code> parameter.
    - `Corefield.OriginalFileName` string — The record's Original File Name. Enter only if you selected this in the <code>fieldToMatch</code> parameter.
    - `CoreField.Title` string — The title of the updated or newly created record. (The title is not required; this is just an example of metadata you might want to add to the asset.)
    - `CoreField.Keywords` string[] — The keywords to add to the title as an array, in the format <code>["Tower of London", "sightseeing"]</code>. (Keywords are not required; this is just an example of metadata you might want to add to the asset.)
    - `[Custom_Metadata]` string — You can add other metadata fields with this syntax <code>"FieldAPIname": "value"</code>.

## Response `200`

200

- union
  - object
    - `transactionID` string
    - `results` object[]
      - `recordID` string
      - `matchedFieldValue` string
      - `code` string
      - `error` unknown
    - `executeInBackground` boolean
    - `jobRecordID` unknown
  - object
    - `transactionID` unknown
    - `results` unknown
    - `executeInBackground` boolean
    - `jobRecordID` string

---

[API](https://skmtc.net/orangelogic/apis/security.md) · [All operations](https://skmtc.net/orangelogic/apis/security/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/orangelogic/security/versions/c8e945426c5e/schema)
