Validate Block Config
curl --request POST \
--url https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"config_mode": "replace"
}
'import requests
url = "https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config"
payload = {
"config": {},
"config_mode": "replace"
}
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({config: {}, config_mode: 'replace'})
};
fetch('https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config', 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.retab.com/v1/workflows/blocks/{block_id}/validate-config",
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([
'config' => [
],
'config_mode' => 'replace'
]),
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.retab.com/v1/workflows/blocks/{block_id}/validate-config"
payload := strings.NewReader("{\n \"config\": {},\n \"config_mode\": \"replace\"\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.retab.com/v1/workflows/blocks/{block_id}/validate-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {},\n \"config_mode\": \"replace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config")
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 \"config\": {},\n \"config_mode\": \"replace\"\n}"
response = http.request(request)
puts response.read_body{
"workflow_id": "<string>",
"block_id": "<string>",
"block_type": "<string>",
"config_hash": "<string>",
"ok": true
}{
"detail": []
}Blocks
Validate Block Config
Validate an assembled block config without mutating the workflow draft.
POST
/
v1
/
workflows
/
blocks
/
{block_id}
/
validate-config
Validate Block Config
curl --request POST \
--url https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"config_mode": "replace"
}
'import requests
url = "https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config"
payload = {
"config": {},
"config_mode": "replace"
}
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({config: {}, config_mode: 'replace'})
};
fetch('https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config', 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.retab.com/v1/workflows/blocks/{block_id}/validate-config",
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([
'config' => [
],
'config_mode' => 'replace'
]),
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.retab.com/v1/workflows/blocks/{block_id}/validate-config"
payload := strings.NewReader("{\n \"config\": {},\n \"config_mode\": \"replace\"\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.retab.com/v1/workflows/blocks/{block_id}/validate-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"config\": {},\n \"config_mode\": \"replace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retab.com/v1/workflows/blocks/{block_id}/validate-config")
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 \"config\": {},\n \"config_mode\": \"replace\"\n}"
response = http.request(request)
puts response.read_body{
"workflow_id": "<string>",
"block_id": "<string>",
"block_type": "<string>",
"config_hash": "<string>",
"ok": true
}{
"detail": []
}Dry-run an assembled block config against the target block without mutating the
workflow draft.
Use this before pushing a locally edited block config bundle when you want the
backend to apply the same validation policy used by block updates.
Python
import os
import requests
response = requests.post(
"https://api.retab.com/v1/workflows/blocks/extract-1/validate-config",
headers={"Authorization": f"Bearer {os.environ['RETAB_API_KEY']}"},
json={
"config": {
"model": "retab-small",
"json_schema": {"type": "object", "properties": {}},
},
"config_mode": "replace",
},
)
response.raise_for_status()
print(response.json()["config_hash"])
TypeScript
const response = await fetch(
"https://api.retab.com/v1/workflows/blocks/extract-1/validate-config",
{
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.RETAB_API_KEY!}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
config: {
model: "retab-small",
json_schema: { type: "object", properties: {} },
},
config_mode: "replace",
}),
},
);
if (!response.ok) throw new Error(await response.text());
console.log((await response.json()).config_hash);
Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]any{
"config": map[string]any{
"model": "retab-small",
"json_schema": map[string]any{"type": "object", "properties": map[string]any{}},
},
"config_mode": "replace",
})
req, _ := http.NewRequest(
"POST",
"https://api.retab.com/v1/workflows/blocks/extract-1/validate-config",
bytes.NewReader(body),
)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RETAB_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var payload map[string]any
if err := json.NewDecoder(res.Body).Decode(&payload); err != nil {
log.Fatal(err)
}
fmt.Println(payload["config_hash"])
}
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var body = """
{
"config": {
"model": "retab-small",
"json_schema": {"type": "object", "properties": {}}
},
"config_mode": "replace"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.retab.com/v1/workflows/blocks/extract-1/validate-config"))
.header("Authorization", "Bearer " + System.getenv("RETAB_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
cURL
curl --request POST \
'https://api.retab.com/v1/workflows/blocks/extract-1/validate-config' \
--header "Authorization: Bearer $RETAB_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"config": {
"model": "retab-small",
"json_schema": {"type": "object", "properties": {}}
},
"config_mode": "replace"
}'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Workflow ID to disambiguate legacy duplicate block IDs. Omit for normal server-generated block IDs.
Body
application/json
Dry-run validation for an assembled workflow block config.
Assembled block config to validate.
How to apply the config before validation. 'replace' validates the config as the full block config; 'merge' validates the result of merging it into the existing block config.
Available options:
merge, replace ⌘I