curl --request POST \
--url https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "customers"
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "charges",
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "invoices",
"fullRefreshCacheSchedule": {
"type": "BASIC",
"expression": "PT24H"
},
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
}
]
'import requests
url = "https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch"
payload = [
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "customers"
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "charges",
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "invoices",
"fullRefreshCacheSchedule": {
"type": "BASIC",
"expression": "PT24H"
},
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
}
]
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([
{catalogId: '627249916703408649', schemaName: 'payment', tableName: 'customers'},
{
catalogId: '627249916703408649',
schemaName: 'payment',
tableName: 'charges',
incrementalCacheSchedule: {type: 'BASIC', expression: 'PT6H'}
},
{
catalogId: '627249916703408649',
schemaName: 'payment',
tableName: 'invoices',
fullRefreshCacheSchedule: {type: 'BASIC', expression: 'PT24H'},
incrementalCacheSchedule: {type: 'BASIC', expression: 'PT6H'}
}
])
};
fetch('https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch', 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://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch",
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([
[
'catalogId' => '627249916703408649',
'schemaName' => 'payment',
'tableName' => 'customers'
],
[
'catalogId' => '627249916703408649',
'schemaName' => 'payment',
'tableName' => 'charges',
'incrementalCacheSchedule' => [
'type' => 'BASIC',
'expression' => 'PT6H'
]
],
[
'catalogId' => '627249916703408649',
'schemaName' => 'payment',
'tableName' => 'invoices',
'fullRefreshCacheSchedule' => [
'type' => 'BASIC',
'expression' => 'PT24H'
],
'incrementalCacheSchedule' => [
'type' => 'BASIC',
'expression' => 'PT6H'
]
]
]),
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://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch"
payload := strings.NewReader("[\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"customers\"\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"charges\",\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"invoices\",\n \"fullRefreshCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT24H\"\n },\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\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://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"customers\"\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"charges\",\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"invoices\",\n \"fullRefreshCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT24H\"\n },\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch")
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 {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"customers\"\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"charges\",\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"invoices\",\n \"fullRefreshCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT24H\"\n },\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"success": true,
"error": "<string>",
"cache": {
"id": "<string>",
"catalogId": "<string>",
"schemaName": "<string>",
"tableName": "<string>",
"incrementalCacheSchedule": {
"type": "<string>",
"expression": "<string>"
},
"fullRefreshCacheSchedule": {
"type": "<string>",
"expression": "<string>"
},
"projectId": "<string>"
}
}
]Create Batch Cache
Creates multiple caches in a single request. Each item in the array follows the same schema as the single create cache endpoint. Caches are created independently; if one fails, the others may still succeed.
The response contains a list of results, one per requested cache, each indicating success or failure. On success, the created cache object is included. On failure, the error message is provided.
This is useful when enabling caching for multiple tables at once (e.g. during initial project setup).
curl --request POST \
--url https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "customers"
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "charges",
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "invoices",
"fullRefreshCacheSchedule": {
"type": "BASIC",
"expression": "PT24H"
},
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
}
]
'import requests
url = "https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch"
payload = [
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "customers"
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "charges",
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
},
{
"catalogId": "627249916703408649",
"schemaName": "payment",
"tableName": "invoices",
"fullRefreshCacheSchedule": {
"type": "BASIC",
"expression": "PT24H"
},
"incrementalCacheSchedule": {
"type": "BASIC",
"expression": "PT6H"
}
}
]
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([
{catalogId: '627249916703408649', schemaName: 'payment', tableName: 'customers'},
{
catalogId: '627249916703408649',
schemaName: 'payment',
tableName: 'charges',
incrementalCacheSchedule: {type: 'BASIC', expression: 'PT6H'}
},
{
catalogId: '627249916703408649',
schemaName: 'payment',
tableName: 'invoices',
fullRefreshCacheSchedule: {type: 'BASIC', expression: 'PT24H'},
incrementalCacheSchedule: {type: 'BASIC', expression: 'PT6H'}
}
])
};
fetch('https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch', 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://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch",
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([
[
'catalogId' => '627249916703408649',
'schemaName' => 'payment',
'tableName' => 'customers'
],
[
'catalogId' => '627249916703408649',
'schemaName' => 'payment',
'tableName' => 'charges',
'incrementalCacheSchedule' => [
'type' => 'BASIC',
'expression' => 'PT6H'
]
],
[
'catalogId' => '627249916703408649',
'schemaName' => 'payment',
'tableName' => 'invoices',
'fullRefreshCacheSchedule' => [
'type' => 'BASIC',
'expression' => 'PT24H'
],
'incrementalCacheSchedule' => [
'type' => 'BASIC',
'expression' => 'PT6H'
]
]
]),
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://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch"
payload := strings.NewReader("[\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"customers\"\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"charges\",\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"invoices\",\n \"fullRefreshCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT24H\"\n },\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\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://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"customers\"\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"charges\",\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"invoices\",\n \"fullRefreshCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT24H\"\n },\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner.peaka.studio/api/v1/data/projects/{projectId}/cache/batch")
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 {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"customers\"\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"charges\",\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n },\n {\n \"catalogId\": \"627249916703408649\",\n \"schemaName\": \"payment\",\n \"tableName\": \"invoices\",\n \"fullRefreshCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT24H\"\n },\n \"incrementalCacheSchedule\": {\n \"type\": \"BASIC\",\n \"expression\": \"PT6H\"\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"success": true,
"error": "<string>",
"cache": {
"id": "<string>",
"catalogId": "<string>",
"schemaName": "<string>",
"tableName": "<string>",
"incrementalCacheSchedule": {
"type": "<string>",
"expression": "<string>"
},
"fullRefreshCacheSchedule": {
"type": "<string>",
"expression": "<string>"
},
"projectId": "<string>"
}
}
]

Authorizations
Use the Authorization header with the value 'Bearer ' to authenticate. Partner API Keys have full access; Project API Keys are limited to their project scope. Learn more: https://docs.peaka.com/api-reference/authentication
Path Parameters
The unique identifier of the project that owns the data sources
Body
Array of cache creation requests. Each element specifies a table to cache with optional sync schedules.
The ID of the catalog for the cache request.
The name of the schema for the cache request.
The name of the table for the cache request.
This class represents a schedule for a cache request. It contains the type and expression of the schedule.
Show child attributes
Show child attributes
This class represents a schedule for a cache request. It contains the type and expression of the schedule.
Show child attributes
Show child attributes