Update model
curl --request PATCH \
--url https://api.prequel.co/models/{model_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"model": {
"description": "Order records including status and totals",
"columns": [
{
"name_in_source": "created_at",
"name_in_destination": "created_at",
"data_type": "timestamp",
"is_primary_key": false,
"is_last_modified": false
}
],
"source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_name": "production-primary",
"source_table": "public.orders",
"source_query": "SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})",
"organization_column": "organization_id",
"is_append_only": false,
"destination_table_name": "orders",
"skip_transfer_source_validation": false,
"model_validation_id_in_provider_system": "cus_1a2b3c4d",
"model_validation_start_time_epoch": "2026-01-01T00:00:00Z",
"model_validation_end_time_epoch": "2026-01-02T00:00:00Z",
"model_validation_tags": {}
},
"skip_model_validation": false
}
'import requests
url = "https://api.prequel.co/models/{model_id}"
payload = {
"model": {
"description": "Order records including status and totals",
"columns": [
{
"name_in_source": "created_at",
"name_in_destination": "created_at",
"data_type": "timestamp",
"is_primary_key": False,
"is_last_modified": False
}
],
"source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_name": "production-primary",
"source_table": "public.orders",
"source_query": "SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})",
"organization_column": "organization_id",
"is_append_only": False,
"destination_table_name": "orders",
"skip_transfer_source_validation": False,
"model_validation_id_in_provider_system": "cus_1a2b3c4d",
"model_validation_start_time_epoch": "2026-01-01T00:00:00Z",
"model_validation_end_time_epoch": "2026-01-02T00:00:00Z",
"model_validation_tags": {}
},
"skip_model_validation": False
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: {
description: 'Order records including status and totals',
columns: [
{
name_in_source: 'created_at',
name_in_destination: 'created_at',
data_type: 'timestamp',
is_primary_key: false,
is_last_modified: false
}
],
source_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
source_name: 'production-primary',
source_table: 'public.orders',
source_query: 'SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})',
organization_column: 'organization_id',
is_append_only: false,
destination_table_name: 'orders',
skip_transfer_source_validation: false,
model_validation_id_in_provider_system: 'cus_1a2b3c4d',
model_validation_start_time_epoch: '2026-01-01T00:00:00Z',
model_validation_end_time_epoch: '2026-01-02T00:00:00Z',
model_validation_tags: {}
},
skip_model_validation: false
})
};
fetch('https://api.prequel.co/models/{model_id}', 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.prequel.co/models/{model_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'model' => [
'description' => 'Order records including status and totals',
'columns' => [
[
'name_in_source' => 'created_at',
'name_in_destination' => 'created_at',
'data_type' => 'timestamp',
'is_primary_key' => false,
'is_last_modified' => false
]
],
'source_id' => '3fa85f64-5717-4562-b3fc-2c963f66afa6',
'source_name' => 'production-primary',
'source_table' => 'public.orders',
'source_query' => 'SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})',
'organization_column' => 'organization_id',
'is_append_only' => false,
'destination_table_name' => 'orders',
'skip_transfer_source_validation' => false,
'model_validation_id_in_provider_system' => 'cus_1a2b3c4d',
'model_validation_start_time_epoch' => '2026-01-01T00:00:00Z',
'model_validation_end_time_epoch' => '2026-01-02T00:00:00Z',
'model_validation_tags' => [
]
],
'skip_model_validation' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.prequel.co/models/{model_id}"
payload := strings.NewReader("{\n \"model\": {\n \"description\": \"Order records including status and totals\",\n \"columns\": [\n {\n \"name_in_source\": \"created_at\",\n \"name_in_destination\": \"created_at\",\n \"data_type\": \"timestamp\",\n \"is_primary_key\": false,\n \"is_last_modified\": false\n }\n ],\n \"source_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_name\": \"production-primary\",\n \"source_table\": \"public.orders\",\n \"source_query\": \"SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})\",\n \"organization_column\": \"organization_id\",\n \"is_append_only\": false,\n \"destination_table_name\": \"orders\",\n \"skip_transfer_source_validation\": false,\n \"model_validation_id_in_provider_system\": \"cus_1a2b3c4d\",\n \"model_validation_start_time_epoch\": \"2026-01-01T00:00:00Z\",\n \"model_validation_end_time_epoch\": \"2026-01-02T00:00:00Z\",\n \"model_validation_tags\": {}\n },\n \"skip_model_validation\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://api.prequel.co/models/{model_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": {\n \"description\": \"Order records including status and totals\",\n \"columns\": [\n {\n \"name_in_source\": \"created_at\",\n \"name_in_destination\": \"created_at\",\n \"data_type\": \"timestamp\",\n \"is_primary_key\": false,\n \"is_last_modified\": false\n }\n ],\n \"source_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_name\": \"production-primary\",\n \"source_table\": \"public.orders\",\n \"source_query\": \"SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})\",\n \"organization_column\": \"organization_id\",\n \"is_append_only\": false,\n \"destination_table_name\": \"orders\",\n \"skip_transfer_source_validation\": false,\n \"model_validation_id_in_provider_system\": \"cus_1a2b3c4d\",\n \"model_validation_start_time_epoch\": \"2026-01-01T00:00:00Z\",\n \"model_validation_end_time_epoch\": \"2026-01-02T00:00:00Z\",\n \"model_validation_tags\": {}\n },\n \"skip_model_validation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prequel.co/models/{model_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": {\n \"description\": \"Order records including status and totals\",\n \"columns\": [\n {\n \"name_in_source\": \"created_at\",\n \"name_in_destination\": \"created_at\",\n \"data_type\": \"timestamp\",\n \"is_primary_key\": false,\n \"is_last_modified\": false\n }\n ],\n \"source_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_name\": \"production-primary\",\n \"source_table\": \"public.orders\",\n \"source_query\": \"SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})\",\n \"organization_column\": \"organization_id\",\n \"is_append_only\": false,\n \"destination_table_name\": \"orders\",\n \"skip_transfer_source_validation\": false,\n \"model_validation_id_in_provider_system\": \"cus_1a2b3c4d\",\n \"model_validation_start_time_epoch\": \"2026-01-01T00:00:00Z\",\n \"model_validation_end_time_epoch\": \"2026-01-02T00:00:00Z\",\n \"model_validation_tags\": {}\n },\n \"skip_model_validation\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"model": {
"model_name": "orders",
"columns": [
{
"name_in_source": "created_at",
"name_in_destination": "created_at",
"data_type": "timestamp",
"is_primary_key": false,
"is_last_modified": false
}
],
"source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"description": "Order records including status and totals",
"source_table": "public.orders",
"source_query": "SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})",
"destination_table_name": "orders",
"organization_column": "organization_id",
"skip_transfer_source_validation": false,
"is_append_only": false,
"model_validation_id_in_provider_system": "cus_1a2b3c4d",
"model_validation_start_time_epoch": "2026-01-01T00:00:00Z",
"model_validation_end_time_epoch": "2026-01-02T00:00:00Z",
"model_validation_tags": {}
}
},
"message": "<string>"
}{
"status": "error",
"message": "<string>",
"data": null
}{
"status": "error",
"message": "<string>",
"data": null
}{
"status": "error",
"message": "<string>",
"data": null
}{
"status": "error",
"message": "<string>",
"data": null
}Models
Update model
Update an existing model.
PATCH
/
models
/
{model_id}
Update model
curl --request PATCH \
--url https://api.prequel.co/models/{model_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"model": {
"description": "Order records including status and totals",
"columns": [
{
"name_in_source": "created_at",
"name_in_destination": "created_at",
"data_type": "timestamp",
"is_primary_key": false,
"is_last_modified": false
}
],
"source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_name": "production-primary",
"source_table": "public.orders",
"source_query": "SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})",
"organization_column": "organization_id",
"is_append_only": false,
"destination_table_name": "orders",
"skip_transfer_source_validation": false,
"model_validation_id_in_provider_system": "cus_1a2b3c4d",
"model_validation_start_time_epoch": "2026-01-01T00:00:00Z",
"model_validation_end_time_epoch": "2026-01-02T00:00:00Z",
"model_validation_tags": {}
},
"skip_model_validation": false
}
'import requests
url = "https://api.prequel.co/models/{model_id}"
payload = {
"model": {
"description": "Order records including status and totals",
"columns": [
{
"name_in_source": "created_at",
"name_in_destination": "created_at",
"data_type": "timestamp",
"is_primary_key": False,
"is_last_modified": False
}
],
"source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source_name": "production-primary",
"source_table": "public.orders",
"source_query": "SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})",
"organization_column": "organization_id",
"is_append_only": False,
"destination_table_name": "orders",
"skip_transfer_source_validation": False,
"model_validation_id_in_provider_system": "cus_1a2b3c4d",
"model_validation_start_time_epoch": "2026-01-01T00:00:00Z",
"model_validation_end_time_epoch": "2026-01-02T00:00:00Z",
"model_validation_tags": {}
},
"skip_model_validation": False
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: {
description: 'Order records including status and totals',
columns: [
{
name_in_source: 'created_at',
name_in_destination: 'created_at',
data_type: 'timestamp',
is_primary_key: false,
is_last_modified: false
}
],
source_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
source_name: 'production-primary',
source_table: 'public.orders',
source_query: 'SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})',
organization_column: 'organization_id',
is_append_only: false,
destination_table_name: 'orders',
skip_transfer_source_validation: false,
model_validation_id_in_provider_system: 'cus_1a2b3c4d',
model_validation_start_time_epoch: '2026-01-01T00:00:00Z',
model_validation_end_time_epoch: '2026-01-02T00:00:00Z',
model_validation_tags: {}
},
skip_model_validation: false
})
};
fetch('https://api.prequel.co/models/{model_id}', 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.prequel.co/models/{model_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'model' => [
'description' => 'Order records including status and totals',
'columns' => [
[
'name_in_source' => 'created_at',
'name_in_destination' => 'created_at',
'data_type' => 'timestamp',
'is_primary_key' => false,
'is_last_modified' => false
]
],
'source_id' => '3fa85f64-5717-4562-b3fc-2c963f66afa6',
'source_name' => 'production-primary',
'source_table' => 'public.orders',
'source_query' => 'SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})',
'organization_column' => 'organization_id',
'is_append_only' => false,
'destination_table_name' => 'orders',
'skip_transfer_source_validation' => false,
'model_validation_id_in_provider_system' => 'cus_1a2b3c4d',
'model_validation_start_time_epoch' => '2026-01-01T00:00:00Z',
'model_validation_end_time_epoch' => '2026-01-02T00:00:00Z',
'model_validation_tags' => [
]
],
'skip_model_validation' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.prequel.co/models/{model_id}"
payload := strings.NewReader("{\n \"model\": {\n \"description\": \"Order records including status and totals\",\n \"columns\": [\n {\n \"name_in_source\": \"created_at\",\n \"name_in_destination\": \"created_at\",\n \"data_type\": \"timestamp\",\n \"is_primary_key\": false,\n \"is_last_modified\": false\n }\n ],\n \"source_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_name\": \"production-primary\",\n \"source_table\": \"public.orders\",\n \"source_query\": \"SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})\",\n \"organization_column\": \"organization_id\",\n \"is_append_only\": false,\n \"destination_table_name\": \"orders\",\n \"skip_transfer_source_validation\": false,\n \"model_validation_id_in_provider_system\": \"cus_1a2b3c4d\",\n \"model_validation_start_time_epoch\": \"2026-01-01T00:00:00Z\",\n \"model_validation_end_time_epoch\": \"2026-01-02T00:00:00Z\",\n \"model_validation_tags\": {}\n },\n \"skip_model_validation\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://api.prequel.co/models/{model_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": {\n \"description\": \"Order records including status and totals\",\n \"columns\": [\n {\n \"name_in_source\": \"created_at\",\n \"name_in_destination\": \"created_at\",\n \"data_type\": \"timestamp\",\n \"is_primary_key\": false,\n \"is_last_modified\": false\n }\n ],\n \"source_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_name\": \"production-primary\",\n \"source_table\": \"public.orders\",\n \"source_query\": \"SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})\",\n \"organization_column\": \"organization_id\",\n \"is_append_only\": false,\n \"destination_table_name\": \"orders\",\n \"skip_transfer_source_validation\": false,\n \"model_validation_id_in_provider_system\": \"cus_1a2b3c4d\",\n \"model_validation_start_time_epoch\": \"2026-01-01T00:00:00Z\",\n \"model_validation_end_time_epoch\": \"2026-01-02T00:00:00Z\",\n \"model_validation_tags\": {}\n },\n \"skip_model_validation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prequel.co/models/{model_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": {\n \"description\": \"Order records including status and totals\",\n \"columns\": [\n {\n \"name_in_source\": \"created_at\",\n \"name_in_destination\": \"created_at\",\n \"data_type\": \"timestamp\",\n \"is_primary_key\": false,\n \"is_last_modified\": false\n }\n ],\n \"source_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"source_name\": \"production-primary\",\n \"source_table\": \"public.orders\",\n \"source_query\": \"SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})\",\n \"organization_column\": \"organization_id\",\n \"is_append_only\": false,\n \"destination_table_name\": \"orders\",\n \"skip_transfer_source_validation\": false,\n \"model_validation_id_in_provider_system\": \"cus_1a2b3c4d\",\n \"model_validation_start_time_epoch\": \"2026-01-01T00:00:00Z\",\n \"model_validation_end_time_epoch\": \"2026-01-02T00:00:00Z\",\n \"model_validation_tags\": {}\n },\n \"skip_model_validation\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"model": {
"model_name": "orders",
"columns": [
{
"name_in_source": "created_at",
"name_in_destination": "created_at",
"data_type": "timestamp",
"is_primary_key": false,
"is_last_modified": false
}
],
"source_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"description": "Order records including status and totals",
"source_table": "public.orders",
"source_query": "SELECT * FROM some_parameterized_view(tenant_id = {{.IdInProviderSystem}})",
"destination_table_name": "orders",
"organization_column": "organization_id",
"skip_transfer_source_validation": false,
"is_append_only": false,
"model_validation_id_in_provider_system": "cus_1a2b3c4d",
"model_validation_start_time_epoch": "2026-01-01T00:00:00Z",
"model_validation_end_time_epoch": "2026-01-02T00:00:00Z",
"model_validation_tags": {}
}
},
"message": "<string>"
}{
"status": "error",
"message": "<string>",
"data": null
}{
"status": "error",
"message": "<string>",
"data": null
}{
"status": "error",
"message": "<string>",
"data": null
}{
"status": "error",
"message": "<string>",
"data": null
}Authorizations
Path Parameters
Model ID.
Body
application/json