# Batch Operation

```http
POST https://%7B%7Bvault_uri%7D%7D.vault.skyflowapis.com/v1/vaults/{vaultID}
Content-Type: application/json
```

Performs multiple record operations in a single transaction.

## Authentication

- `Authorization` header (bearer token, required) — Access token, prefixed by `Bearer `.

## Servers

- `https://%7B%7Bvault_uri%7D%7D.vault.skyflowapis.com` (Production, default)
- `https://%7B%7Bvault_uri%7D%7D.vault.skyflowapis-preview.com` (Sandbox)

## Request

### Path parameters

- `vaultID` (string, required) — ID of the vault.

### Body (application/json)

This endpoint expects an object.

- `records` (list of object, required) — Record operations to perform.
  - `fields` (map from string to any, required) — Field and value key pairs. For example, `{'field_1':'value_1', 'field_2':'value_2'}`. Only valid when `method` is `POST` or `PUT`.
  - `tableName` (string, required) — Name of the table to perform the operation on.
  - `method` (enum, required) — Method of the operation.
    - Allowed values: `POST`, `PUT`, `GET`, `DELETE`
  - `batchID` (string, optional) — ID to group operations by. Operations in the same group are executed sequentially.
  - `redaction` (enum, optional, default: DEFAULT) — Redaction level to enforce for the returned record. Subject to policies assigned to the API caller.
    - Allowed values: `DEFAULT`, `REDACTED`, `MASKED`, `PLAIN_TEXT`
  - `tokenization` (boolean, optional, default: false) — If `true`, this operation returns tokens for fields with tokenization enabled. Only applicable if `skyflow_id` values are specified.
  - `ID` (string, optional) — `skyflow_id` for the record. Only valid when `method` is `GET`, `DELETE`, or `PUT`.
  - `downloadURL` (boolean, optional, default: false) — If `true`, returns download URLs for fields with a file data type. URLs are valid for 15 minutes. If virus scanning is enabled, only returns if the file is clean.
  - `upsert` (string, optional) — Column that stores primary keys for upsert operations. The column must be marked as unique in the vault schema. Only valid when `method` is `POST`.
  - `tokens` (map from string to any, optional) — Fields and tokens for the record. For example, `{'field_1':'token_1', 'field_2':'token_2'}`.
  - `returnFileMetadata` (boolean, optional, default: false) — If `true`, returns metadata for files.
- `continueOnError` (boolean, optional, default: false) — If `true`, continues processing remaining operations when one operation returns an error. If `false`, stops processing remaining operations when one operation returns an error.

## Response

### 200

OK

- `vaultID` (string, optional) — ID of the vault.
- `responses` (list of object, optional) — Responses in the same order as in the request. Responses have the same payload structure as their corresponding APIs: `POST` returns an Insert Records response.`PUT` returns an Update Record response.`GET` returns a Get Record response.`DELETE` returns a Delete Record response.

### 207

Returned when a bulk request partially succeeds. Check per-record status codes and error messages in the response body.

- `map from string to any`

## Errors

### 400 Bad Request Error

Returned when the request is invalid or cannot be served.

- `error` (object, required)
  - `grpc_code` (integer, required) — gRPC status codes. See [https://grpc.io/docs/guides/status-codes](https://grpc.io/docs/guides/status-codes).
  - `http_code` (integer, required) — HTTP status codes. See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).
  - `http_status` (string, required)
  - `message` (string, required)
  - `details` (list of map from string to any, optional)

### 401 Unauthorized Error

Returned when the request is unauthorized.

- `error` (object, required)
  - `grpc_code` (integer, required) — gRPC status codes. See [https://grpc.io/docs/guides/status-codes](https://grpc.io/docs/guides/status-codes).
  - `http_code` (integer, required) — HTTP status codes. See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).
  - `http_status` (string, required)
  - `message` (string, required)
  - `details` (list of map from string to any, optional)

### 404 Not Found Error

Returned when a resource doesn't exist.

- `error` (object, required)
  - `grpc_code` (integer, required) — gRPC status codes. See [https://grpc.io/docs/guides/status-codes](https://grpc.io/docs/guides/status-codes).
  - `http_code` (integer, required) — HTTP status codes. See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).
  - `http_status` (string, required)
  - `message` (string, required)
  - `details` (list of map from string to any, optional)

### 422 Unprocessable Entity Error

Returned when the request is well-formed but contains semantic errors that prevent it from being processed.

- `error` (object, required)
  - `grpc_code` (integer, required) — gRPC status codes. See [https://grpc.io/docs/guides/status-codes](https://grpc.io/docs/guides/status-codes).
  - `http_code` (integer, required) — HTTP status codes. See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).
  - `http_status` (string, required)
  - `message` (string, required)
  - `details` (list of map from string to any, optional)

### 500 Internal Server Error

An unexpected error response.

- `error` (object, required)
  - `grpc_code` (integer, required) — gRPC status codes. See [https://grpc.io/docs/guides/status-codes](https://grpc.io/docs/guides/status-codes).
  - `http_code` (integer, required) — HTTP status codes. See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).
  - `http_status` (string, required)
  - `message` (string, required)
  - `details` (list of map from string to any, optional)

## Examples

### Example 1

**Request**

```json
{
  "records": [
    {
      "fields": {
        "drivers_license_number": "89867453",
        "name": "Connor",
        "phone_number": "8794523160",
        "ssn": "143-89-2306"
      },
      "tableName": "persons",
      "method": "POST",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "downloadURL": false,
      "upsert": "drivers_license_number"
    },
    {
      "fields": {},
      "tableName": "persons",
      "method": "GET",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
      "downloadURL": true
    }
  ]
}
```

**Response**

```json
{
  "vaultID": "cd1d815aa09b4cbfbb803bd20349f202",
  "responses": [
    {
      "records": [
        {
          "fields": {
            "drivers_license_number": "*REDACTED*",
            "id_proof": "https://<aws-url>/f244fg04bgh876qemk6c3a32256e2k90/record_file/cd1d815aa09b4cbfbb803bd20349f202/c2d1debe468923c08f32470a9dh789f9/f1dbc55c-7c9b-495d-9a36-72bb2b619202/8fa99367cf58h5w296eaf15d6f42a4d237cbab65?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<aws-credential>&X-Amz-Date=20230622T100910Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=<aws-signature>",
            "name": "B***ok",
            "phone_number": "XXXXXX7533",
            "skyflow_id": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
            "ssn": "XXX-XX-7645"
          },
          "skyflow_id": "4bc4a3a6-dfba-4314-809d-5ca63d43c732"
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID"

payload = { "records": [
        {
            "fields": {
                "drivers_license_number": "89867453",
                "name": "Connor",
                "phone_number": "8794523160",
                "ssn": "143-89-2306"
            },
            "tableName": "persons",
            "method": "POST",
            "batchID": "persons-12345",
            "redaction": "PLAIN_TEXT",
            "tokenization": False,
            "downloadURL": False,
            "upsert": "drivers_license_number"
        },
        {
            "fields": {},
            "tableName": "persons",
            "method": "GET",
            "batchID": "persons-12345",
            "redaction": "PLAIN_TEXT",
            "tokenization": False,
            "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
            "downloadURL": True
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"records":[{"fields":{"drivers_license_number":"89867453","name":"Connor","phone_number":"8794523160","ssn":"143-89-2306"},"tableName":"persons","method":"POST","batchID":"persons-12345","redaction":"PLAIN_TEXT","tokenization":false,"downloadURL":false,"upsert":"drivers_license_number"},{"fields":{},"tableName":"persons","method":"GET","batchID":"persons-12345","redaction":"PLAIN_TEXT","tokenization":false,"ID":"f1dbc55c-7c9b-495d-9a36-72bb2b619202","downloadURL":true}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID"

	payload := strings.NewReader("{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID', [
  'body' => '{
  "records": [
    {
      "fields": {
        "drivers_license_number": "89867453",
        "name": "Connor",
        "phone_number": "8794523160",
        "ssn": "143-89-2306"
      },
      "tableName": "persons",
      "method": "POST",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "downloadURL": false,
      "upsert": "drivers_license_number"
    },
    {
      "fields": {},
      "tableName": "persons",
      "method": "GET",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
      "downloadURL": true
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["records": [
    [
      "fields": [
        "drivers_license_number": "89867453",
        "name": "Connor",
        "phone_number": "8794523160",
        "ssn": "143-89-2306"
      ],
      "tableName": "persons",
      "method": "POST",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "downloadURL": false,
      "upsert": "drivers_license_number"
    ],
    [
      "fields": [],
      "tableName": "persons",
      "method": "GET",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
      "downloadURL": true
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "records": [
    {
      "fields": {
        "drivers_license_number": "89867453",
        "name": "Connor",
        "phone_number": "8794523160",
        "ssn": "143-89-2306"
      },
      "tableName": "persons",
      "method": "POST",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "downloadURL": false,
      "upsert": "drivers_license_number"
    },
    {
      "fields": {},
      "tableName": "persons",
      "method": "GET",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
      "downloadURL": true
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID"

payload = { "records": [
        {
            "fields": {
                "drivers_license_number": "89867453",
                "name": "Connor",
                "phone_number": "8794523160",
                "ssn": "143-89-2306"
            },
            "tableName": "persons",
            "method": "POST",
            "batchID": "persons-12345",
            "redaction": "PLAIN_TEXT",
            "tokenization": False,
            "downloadURL": False,
            "upsert": "drivers_license_number"
        },
        {
            "fields": {},
            "tableName": "persons",
            "method": "GET",
            "batchID": "persons-12345",
            "redaction": "PLAIN_TEXT",
            "tokenization": False,
            "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
            "downloadURL": True
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"records":[{"fields":{"drivers_license_number":"89867453","name":"Connor","phone_number":"8794523160","ssn":"143-89-2306"},"tableName":"persons","method":"POST","batchID":"persons-12345","redaction":"PLAIN_TEXT","tokenization":false,"downloadURL":false,"upsert":"drivers_license_number"},{"fields":{},"tableName":"persons","method":"GET","batchID":"persons-12345","redaction":"PLAIN_TEXT","tokenization":false,"ID":"f1dbc55c-7c9b-495d-9a36-72bb2b619202","downloadURL":true}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID"

	payload := strings.NewReader("{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID', [
  'body' => '{
  "records": [
    {
      "fields": {
        "drivers_license_number": "89867453",
        "name": "Connor",
        "phone_number": "8794523160",
        "ssn": "143-89-2306"
      },
      "tableName": "persons",
      "method": "POST",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "downloadURL": false,
      "upsert": "drivers_license_number"
    },
    {
      "fields": {},
      "tableName": "persons",
      "method": "GET",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
      "downloadURL": true
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"records\": [\n    {\n      \"fields\": {\n        \"drivers_license_number\": \"89867453\",\n        \"name\": \"Connor\",\n        \"phone_number\": \"8794523160\",\n        \"ssn\": \"143-89-2306\"\n      },\n      \"tableName\": \"persons\",\n      \"method\": \"POST\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"downloadURL\": false,\n      \"upsert\": \"drivers_license_number\"\n    },\n    {\n      \"fields\": {},\n      \"tableName\": \"persons\",\n      \"method\": \"GET\",\n      \"batchID\": \"persons-12345\",\n      \"redaction\": \"PLAIN_TEXT\",\n      \"tokenization\": false,\n      \"ID\": \"f1dbc55c-7c9b-495d-9a36-72bb2b619202\",\n      \"downloadURL\": true\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["records": [
    [
      "fields": [
        "drivers_license_number": "89867453",
        "name": "Connor",
        "phone_number": "8794523160",
        "ssn": "143-89-2306"
      ],
      "tableName": "persons",
      "method": "POST",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "downloadURL": false,
      "upsert": "drivers_license_number"
    ],
    [
      "fields": [],
      "tableName": "persons",
      "method": "GET",
      "batchID": "persons-12345",
      "redaction": "PLAIN_TEXT",
      "tokenization": false,
      "ID": "f1dbc55c-7c9b-495d-9a36-72bb2b619202",
      "downloadURL": true
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{{vault_uri}}.vault.skyflowapis.com/v1/vaults/vaultID")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```