Insert Row
curl --request POST \
--url https://api.sublay.io/v7/:projectId/db/:tableName \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/db/:tableName"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/db/:tableName', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/db/:tableName"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/db/:tableName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"row": {}
}Custom Tables — Rows
Insert Row
Insert a single row into a custom table
Insert Row
curl --request POST \
--url https://api.sublay.io/v7/:projectId/db/:tableName \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/db/:tableName"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/db/:tableName', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/db/:tableName"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/db/:tableName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"row": {}
}Inserts one row and returns it.
Row endpoints capture the caller’s identity but enforce no authorization — any caller who can reach your project can write these rows. See Security: open row CRUD.
tableName is the logical name — pass orders, not custom_orders.Path Parameters
string
required
Logical name of the custom table.
Body
The body is a free-form column map — one key per column you are setting. At least one key is required.{ "status": "open", "total": 42 }
Managed columns are rejected, unknown columns are ignored. Writing
id, createdAt, updatedAt or deletedAt fails with database/managed-column. A key that matches no column on the table is silently dropped — so a typo in a column name does not error, it simply does not persist. If every key is dropped, the request fails with database/no-writable-columns.Response
Returns201 Created.
object
The inserted row, including its generated managed columns.
Error Responses
Invalid Body — 400
Invalid Body — 400
Returned when the body is empty or not an object.
{ "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
Every key in the body matched no column on the table.
{ "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
A value references a row that does not exist.
{ "error": "Conflict", "code": "database/foreign-key-violation" }
Server Error — 500
Server Error — 500
{ "error": "Internal Server Error", "code": "database/server-error" }

