Bulk Insert Rows
curl --request POST \
--url https://api.sublay.io/v7/:projectId/db/:tableName/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{}
]
}
'import requests
url = "https://api.sublay.io/v7/:projectId/db/:tableName/bulk"
payload = { "rows": [{}] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({rows: [{}]})
};
fetch('https://api.sublay.io/v7/:projectId/db/:tableName/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v7/:projectId/db/:tableName/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rows' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/db/:tableName/bulk"
payload := strings.NewReader("{\n \"rows\": [\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/v7/:projectId/db/:tableName/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/db/:tableName/bulk")
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 \"rows\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{}
]
}Custom Tables — Rows
Bulk Insert Rows
Insert up to 100 rows into a custom table in one request
Bulk Insert Rows
curl --request POST \
--url https://api.sublay.io/v7/:projectId/db/:tableName/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{}
]
}
'import requests
url = "https://api.sublay.io/v7/:projectId/db/:tableName/bulk"
payload = { "rows": [{}] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({rows: [{}]})
};
fetch('https://api.sublay.io/v7/:projectId/db/:tableName/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v7/:projectId/db/:tableName/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rows' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/db/:tableName/bulk"
payload := strings.NewReader("{\n \"rows\": [\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/v7/:projectId/db/:tableName/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/db/:tableName/bulk")
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 \"rows\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{}
]
}Inserts many rows in a single request and returns them.
Row endpoints capture the caller’s identity but enforce no authorization. See Security: open row CRUD.
Path Parameters
string
required
Logical name of the custom table — pass
orders, not custom_orders.Body Parameters
object[]
required
Between 1 and 100 rows. Each entry is a free-form column map, following the same rules as Insert Row: managed columns are rejected, unknown columns are silently dropped.
{
"rows": [
{ "status": "open", "total": 42 },
{ "status": "closed", "total": 7 }
]
}
Response
Returns201 Created.
object[]
The inserted rows, including their generated managed columns.
Error Responses
Invalid Body — 400
Invalid Body — 400
Missing
rows, an empty array, or more than 100 entries.{ "error": "Bad Request", "code": "database/invalid-body" }
Managed Column — 400
Managed Column — 400
{
"error": "Bad Request",
"code": "database/managed-column",
"column": "<column name>"
}
No Writable Columns — 400
No Writable Columns — 400
{ "error": "Bad Request", "code": "database/no-writable-columns" }
Table Not Found — 404
Table Not Found — 404
{ "error": "Not Found", "code": "database/table-not-found" }
Foreign Key Violation — 409
Foreign Key Violation — 409
{ "error": "Conflict", "code": "database/foreign-key-violation" }
Server Error — 500
Server Error — 500
{ "error": "Internal Server Error", "code": "database/server-error" }

