Using the V2 Records API with the Flatfile TypeScript API package
@flatfile/api
package in version 1.18.0.records.v2
property on the Flatfile client.
JsonlRecord
objects containing the raw data structure from the API including special fields like __k
(record ID), __v
(version), etc.
Example:
records
- Array of JsonlRecord objects to writeoptions
- Write configuration optionsrequestOptions
- Optional request configuration__
(double underscore) to store metadata and system information:
Field | Description | Example |
---|---|---|
__k | Record ID (unique identifier) | "us_rc_123456" |
__nk | New record ID (for creation) | "temp_123" |
__v | Record version ID | "v_789" |
__s | Sheet ID | "us_sh_123" |
__n | Sheet slug | "contacts" |
__c | Record configuration | {"locked": true} |
__m | Record metadata | {"source": "import"} |
__i | Validation messages | {"email": [{"type": "error", "message": "Invalid format"}]} |
__d | Deleted flag | true |
__e | Valid flag | false |
__l | Linked records | [{...}] |
__u | Updated timestamp | "2023-11-20T16:59:40.286Z" |
includeMessages
to include the __i
field with validation messages.
__i
field contains validation messages for fields that have errors or warnings.
The messages are structured as an array of objects. Each validation message object will be structured
as {"x": <field key of message>, "m": <validation message>}
.
__s
and no record ID.
__k
field.
__k
field and pass the delete flag
in the __d
field.