Execute transactional SQL batch
curl --request POST \
--url https://api.hoox.sh/batch \
--header 'Content-Type: application/json' \
--data '
{
"statements": [
{
"query": "INSERT INTO trades (id, symbol) VALUES (?, ?)",
"params": [
"<unknown>"
]
}
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
statements: [
{query: 'INSERT INTO trades (id, symbol) VALUES (?, ?)', params: ['<unknown>']}
]
})
};
fetch('https://api.hoox.sh/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hoox.sh/batch"
payload = { "statements": [
{
"query": "INSERT INTO trades (id, symbol) VALUES (?, ?)",
"params": ["<unknown>"]
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"results": [
"<unknown>"
]
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}Database
Execute transactional SQL batch
Internal endpoint on d1-worker. Executes multiple SQL
statements atomically via D1’s db.batch(). Each statement
is validated against the same allowlist as /query.
POST
/
batch
Execute transactional SQL batch
curl --request POST \
--url https://api.hoox.sh/batch \
--header 'Content-Type: application/json' \
--data '
{
"statements": [
{
"query": "INSERT INTO trades (id, symbol) VALUES (?, ?)",
"params": [
"<unknown>"
]
}
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
statements: [
{query: 'INSERT INTO trades (id, symbol) VALUES (?, ?)', params: ['<unknown>']}
]
})
};
fetch('https://api.hoox.sh/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hoox.sh/batch"
payload = { "statements": [
{
"query": "INSERT INTO trades (id, symbol) VALUES (?, ?)",
"params": ["<unknown>"]
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"results": [
"<unknown>"
]
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}Body
application/json
Optional correlation ID for tracing
Example:
"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
Last modified on June 17, 2026
⌘I