from retab import Retab
client = Retab()
result = client.workflows.blocks.create_block_validate_config(
"extract-1",
config={
"model": "retab-small",
"json_schema": {"type": "object", "properties": {}},
},
config_mode="replace",
)
print(result)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const result = await client.workflows.blocks.create_block_validate_config(
"extract-1",
{
model: "retab-small",
json_schema: { type: "object", properties: {} },
},
"replace",
);
console.log(result);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
mode := retab.UpdateWorkflowBlockRequestConfigModeReplace
result, err := client.Workflows.Blocks.CreateBlockValidateConfig(ctx, "extract-1", &retab.WorkflowBlocksCreateBlockValidateConfigParams{
Config: map[string]interface{}{
"model": "retab-small",
"json_schema": map[string]interface{}{"type": "object", "properties": map[string]interface{}{}},
},
ConfigMode: &mode,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(*result)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
result = client.workflows.blocks.create_block_validate_config(
block_id: 'extract-1',
config: {
'model' => 'retab-small',
'json_schema' => { 'type' => 'object', 'properties' => {} },
},
config_mode: 'replace',
)
puts result
use std::collections::HashMap;
use retab::models::ValidateWorkflowBlockConfigRequest;
use retab::resources::workflow_blocks::CreateBlockValidateConfigParams;
use retab::Retab;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Retab::new(std::env::var("RETAB_API_KEY")?);
let mut config = HashMap::new();
config.insert("model".to_string(), serde_json::json!("retab-small"));
config.insert(
"json_schema".to_string(),
serde_json::json!({ "type": "object", "properties": {} }),
);
let result = client
.workflows()
.blocks()
.create_block_validate_config(
"extract-1",
CreateBlockValidateConfigParams::new(ValidateWorkflowBlockConfigRequest::new(config)),
)
.await?;
println!("{:?}", result);
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->blocks()->createBlockValidateConfig(
blockId: 'extract-1',
config: [
'model' => 'retab-small',
'json_schema' => ['type' => 'object', 'properties' => (object) []],
],
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var result = await client.Workflows.Blocks.CreateBlockValidateConfigAsync(
"extract-1",
new WorkflowBlocksCreateBlockValidateConfigOptions
{
Config = new Dictionary<string, object>
{
["model"] = "retab-small",
["json_schema"] = new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>(),
},
},
ConfigMode = UpdateWorkflowBlockRequestConfigMode.Replace,
});
Console.WriteLine(result);
import com.retab.RetabClient;
import com.retab.types.ValidateWorkflowBlockConfigRequestConfigMode;
import java.util.LinkedHashMap;
import java.util.Map;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
Map<String, Object> config = new LinkedHashMap<>();
config.put("model", "retab-small");
config.put("json_schema", Map.of("type", "object", "properties", Map.of()));
var result = client.workflows().blocks().createBlockValidateConfig(
"extract-1",
null,
config,
ValidateWorkflowBlockConfigRequestConfigMode.REPLACE);
System.out.println(result);
}
}
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"
}'
{
"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
from retab import Retab
client = Retab()
result = client.workflows.blocks.create_block_validate_config(
"extract-1",
config={
"model": "retab-small",
"json_schema": {"type": "object", "properties": {}},
},
config_mode="replace",
)
print(result)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const result = await client.workflows.blocks.create_block_validate_config(
"extract-1",
{
model: "retab-small",
json_schema: { type: "object", properties: {} },
},
"replace",
);
console.log(result);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
mode := retab.UpdateWorkflowBlockRequestConfigModeReplace
result, err := client.Workflows.Blocks.CreateBlockValidateConfig(ctx, "extract-1", &retab.WorkflowBlocksCreateBlockValidateConfigParams{
Config: map[string]interface{}{
"model": "retab-small",
"json_schema": map[string]interface{}{"type": "object", "properties": map[string]interface{}{}},
},
ConfigMode: &mode,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(*result)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
result = client.workflows.blocks.create_block_validate_config(
block_id: 'extract-1',
config: {
'model' => 'retab-small',
'json_schema' => { 'type' => 'object', 'properties' => {} },
},
config_mode: 'replace',
)
puts result
use std::collections::HashMap;
use retab::models::ValidateWorkflowBlockConfigRequest;
use retab::resources::workflow_blocks::CreateBlockValidateConfigParams;
use retab::Retab;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Retab::new(std::env::var("RETAB_API_KEY")?);
let mut config = HashMap::new();
config.insert("model".to_string(), serde_json::json!("retab-small"));
config.insert(
"json_schema".to_string(),
serde_json::json!({ "type": "object", "properties": {} }),
);
let result = client
.workflows()
.blocks()
.create_block_validate_config(
"extract-1",
CreateBlockValidateConfigParams::new(ValidateWorkflowBlockConfigRequest::new(config)),
)
.await?;
println!("{:?}", result);
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->blocks()->createBlockValidateConfig(
blockId: 'extract-1',
config: [
'model' => 'retab-small',
'json_schema' => ['type' => 'object', 'properties' => (object) []],
],
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var result = await client.Workflows.Blocks.CreateBlockValidateConfigAsync(
"extract-1",
new WorkflowBlocksCreateBlockValidateConfigOptions
{
Config = new Dictionary<string, object>
{
["model"] = "retab-small",
["json_schema"] = new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>(),
},
},
ConfigMode = UpdateWorkflowBlockRequestConfigMode.Replace,
});
Console.WriteLine(result);
import com.retab.RetabClient;
import com.retab.types.ValidateWorkflowBlockConfigRequestConfigMode;
import java.util.LinkedHashMap;
import java.util.Map;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
Map<String, Object> config = new LinkedHashMap<>();
config.put("model", "retab-small");
config.put("json_schema", Map.of("type", "object", "properties", Map.of()));
var result = client.workflows().blocks().createBlockValidateConfig(
"extract-1",
null,
config,
ValidateWorkflowBlockConfigRequestConfigMode.REPLACE);
System.out.println(result);
}
}
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"
}'
{
"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.
from retab import Retab
client = Retab()
result = client.workflows.blocks.create_block_validate_config(
"extract-1",
config={
"model": "retab-small",
"json_schema": {"type": "object", "properties": {}},
},
config_mode="replace",
)
print(result)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const result = await client.workflows.blocks.create_block_validate_config(
"extract-1",
{
model: "retab-small",
json_schema: { type: "object", properties: {} },
},
"replace",
);
console.log(result);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
mode := retab.UpdateWorkflowBlockRequestConfigModeReplace
result, err := client.Workflows.Blocks.CreateBlockValidateConfig(ctx, "extract-1", &retab.WorkflowBlocksCreateBlockValidateConfigParams{
Config: map[string]interface{}{
"model": "retab-small",
"json_schema": map[string]interface{}{"type": "object", "properties": map[string]interface{}{}},
},
ConfigMode: &mode,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(*result)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
result = client.workflows.blocks.create_block_validate_config(
block_id: 'extract-1',
config: {
'model' => 'retab-small',
'json_schema' => { 'type' => 'object', 'properties' => {} },
},
config_mode: 'replace',
)
puts result
use std::collections::HashMap;
use retab::models::ValidateWorkflowBlockConfigRequest;
use retab::resources::workflow_blocks::CreateBlockValidateConfigParams;
use retab::Retab;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Retab::new(std::env::var("RETAB_API_KEY")?);
let mut config = HashMap::new();
config.insert("model".to_string(), serde_json::json!("retab-small"));
config.insert(
"json_schema".to_string(),
serde_json::json!({ "type": "object", "properties": {} }),
);
let result = client
.workflows()
.blocks()
.create_block_validate_config(
"extract-1",
CreateBlockValidateConfigParams::new(ValidateWorkflowBlockConfigRequest::new(config)),
)
.await?;
println!("{:?}", result);
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->blocks()->createBlockValidateConfig(
blockId: 'extract-1',
config: [
'model' => 'retab-small',
'json_schema' => ['type' => 'object', 'properties' => (object) []],
],
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var result = await client.Workflows.Blocks.CreateBlockValidateConfigAsync(
"extract-1",
new WorkflowBlocksCreateBlockValidateConfigOptions
{
Config = new Dictionary<string, object>
{
["model"] = "retab-small",
["json_schema"] = new Dictionary<string, object>
{
["type"] = "object",
["properties"] = new Dictionary<string, object>(),
},
},
ConfigMode = UpdateWorkflowBlockRequestConfigMode.Replace,
});
Console.WriteLine(result);
import com.retab.RetabClient;
import com.retab.types.ValidateWorkflowBlockConfigRequestConfigMode;
import java.util.LinkedHashMap;
import java.util.Map;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
Map<String, Object> config = new LinkedHashMap<>();
config.put("model", "retab-small");
config.put("json_schema", Map.of("type", "object", "properties", Map.of()));
var result = client.workflows().blocks().createBlockValidateConfig(
"extract-1",
null,
config,
ValidateWorkflowBlockConfigRequestConfigMode.REPLACE);
System.out.println(result);
}
}
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