DocsAPI Reference
  • Data API
    • POSTGet BIN
LogoLogo
Login
Login
Data APIRecords

Insert Records

POST
/v1/vaults/:vaultID/:tableName
POST
/v1/vaults/:vaultID/:tableName
1curl -X POST https://{{vault_url_identifier}}.vault.skyflowapis.com/v1/vaults/d4410ea01d83473ca09a24c6b03096d4/persons \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "records": [
6 {
7 "fields": {
8 "drivers_license_number": "13456789",
9 "name": "John",
10 "phone_number": "1236784563",
11 "ssn": "123-45-6789"
12 }
13 },
14 {
15 "fields": {
16 "drivers_license_number": "98765432",
17 "name": "James",
18 "phone_number": "9876543215",
19 "ssn": "345-45-9876"
20 }
21 }
22 ],
23 "tokenization": true,
24 "upsert": "drivers_license_number",
25 "homogeneous": false
26}'
Try it
1{
2 "records": [
3 {
4 "skyflow_id": "9322ffcc-fb8b-4fbe-8551-55c80559007c",
5 "tokens": {
6 "drivers_license_number": "358a03eb-2592-4037-be31-046032471d44",
7 "name": "16c5aa3e-fc49-4a87-8891-5a40c6c2f880",
8 "phone_number": "015ef018-adf3-49a0-8590-dbe9746de044",
9 "ssn": "341-11-6689"
10 }
11 },
12 {
13 "skyflow_id": "51782ea4-91a5-4430-a06d-f4b76efd3d2f",
14 "tokens": {
15 "drivers_license_number": "f7d9a190-899c-40bf-b719-9e856afb6995",
16 "name": "071a3ae2-62eb-4b63-bcca-17a4da96fc87",
17 "phone_number": "a2fba7f3-d5e5-4e40-ab44-bce2c0ba1493",
18 "ssn": "522-41-0947"
19 }
20 }
21 ]
22}
Inserts a record in the specified table.<br /><br />The time-to-live (TTL) for a transient field begins when the field value is set during record insertion.<br /><br />Columns that have a string data type and a uniqueness constraint accept strings up to 2500 characters. If an inserted string exceeds 2500 characters, the call returns a token insertion error.
Was this page helpful?
Previous

Bulk Delete Records

Next
Built with
Bulk Delete Records

Authentication

AuthorizationBearer
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Path parameters

vaultIDstringRequired
ID of the vault.
tableNamestringRequired
Name of the table.

Request

This endpoint expects an object.
ID of the vault.
Name of the table.
recordslist of objectsOptional
Record values and tokens.
tokenizationbooleanOptional

If true, this operation returns tokens for fields with tokenization enabled.

upsertstringOptional
Name of a unique column in the table. Uses upsert operations to check if a record exists based on the unique column's value. If a matching record exists, the record updates with the values you provide. If a matching record doesn't exist, the upsert operation inserts a new record.<br /><br />When you upsert a field, include the entire contents you want the field to store. For JSON fields, include all nested fields and values. If a nested field isn't included, it's removed.
homogeneousbooleanOptionalDefaults to false
If `true`, this operation mandates that all the records have the same fields. This parameter does not work with upsert.
byotenumOptionalDefaults to DISABLE
Token insertion behavior. - DISABLE: Tokens aren't allowed for any fields. If tokens are specified, the request fails. - ENABLE: Tokens are allowed—but not required—for all fields. If tokens are specified, they're inserted. - ENABLE_STRICT: Tokens are required for all fields. If tokens are specified, they're inserted. If not, the request fails.
Allowed values:

Response

A successful response.
recordslist of objects or null
Identifiers for the inserted records.

Errors

Token insertion behavior.

  • DISABLE: Tokens aren’t allowed for any fields. If tokens are specified, the request fails.
  • ENABLE: Tokens are allowed—but not required—for all fields. If tokens are specified, they’re inserted.
  • ENABLE_STRICT: Tokens are required for all fields. If tokens are specified, they’re inserted. If not, the request fails.

Bearer authentication of the form Bearer <token>, where token is your auth token.

If true, this operation mandates that all the records have the same fields. This parameter does not work with upsert.

Inserts a record in the specified table.

The time-to-live (TTL) for a transient field begins when the field value is set during record insertion.

Columns that have a string data type and a uniqueness constraint accept strings up to 2500 characters. If an inserted string exceeds 2500 characters, the call returns a token insertion error.

Name of a unique column in the table. Uses upsert operations to check if a record exists based on the unique column’s value. If a matching record exists, the record updates with the values you provide. If a matching record doesn’t exist, the upsert operation inserts a new record.

When you upsert a field, include the entire contents you want the field to store. For JSON fields, include all nested fields and values. If a nested field isn’t included, it’s removed.