User GuidesAPI ReferenceRelease Notes
Doc HomeHelp CenterLog In
API Reference

Modify a dataset's records

This will increment the dataset's version, but not do any data scale processing

A POST to this endpoint allows you to create, update, or delete records in a specified dataset.

  • A CREATE action overwrites an existing record or creates a new one.
  • A DELETE action removes the record from the dataset.

The POST body of the request contains newline-delimited JSON documents, one document per update command, as in the following example:

{"action": "CREATE","recordId": "101","record": {"name":"John","email":["[email protected]","[email protected]"]}}
{"action": "CREATE","recordId": "102","record": {"name":"Jane","email":["[email protected]","[email protected]"]}}
{"action": "DELETE","recordId": "102"}

The POST body contains newline-delimited JSON documents. Using newline-delimited JSON documents is not required, since the API uses the JSON document-end to delimit the stream.

However, exporting dataset's records as JSON requires that each line is newline-delimitated. For more information, see Stream the contents of a dataset as JSON records.

The fields in each request object are as follows:

FieldDescription
actionThe action requested.CREATE or DELETE.
recordIdThe ID of the record, which is the content of the primary key attribute in the dataset.
recordOptional. The key: value pair with the information for the new record to contain on creation or update.
Keys must exist as attributes in the schema of the dataset they are being added to. If not in the schema, they are ignored.

A successful request returns a JSON object with metadata describing the action.

KeyValue Description
numCommandsProcessedThe number of commands successfully processed.
allCommandsSucceededBoolean. Whether all the commands succeeded.
validationErrorsA list of any validation errors returned for failed commands. Only provided if allCommandSucceeded is false.
Language
Click Try It! to start a request and see the response here!