from retab import Retab
client = Retab()
blueprint = client.files.create_blueprint(
file_id="file_a1b2c3d4e5f6",
intent="Identify the statement fields and transaction table",
background=True,
)
print(blueprint.id)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const blueprint = await client.files.create_blueprint(
"file_a1b2c3d4e5f6",
"Identify the statement fields and transaction table",
"instant",
true
);
console.log(blueprint.id);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func main() {
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
blueprint, err := client.Files.CreateBlueprint(context.Background(), &retab.FilesCreateBlueprintParams{
FileID: "file_a1b2c3d4e5f6",
Intent: retab.Ptr("Identify the statement fields and transaction table"),
Background: retab.Ptr(true),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(blueprint.ID)
}
import com.retab.RetabClient;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
var blueprint = client.files().createBlueprint(
"file_a1b2c3d4e5f6",
"Identify the statement fields and transaction table",
null,
true);
System.out.println(blueprint.getId());
}
}
use retab::models::CreateFileBlueprintRequest;
use retab::resources::files::CreateBlueprintParams;
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 request = CreateFileBlueprintRequest::new("file_a1b2c3d4e5f6");
request.intent = Some("Identify the statement fields and transaction table".into());
request.background = Some(true);
let blueprint = client
.files()
.create_blueprint(CreateBlueprintParams::new(request))
.await?;
println!("{}", blueprint.id);
Ok(())
}
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var blueprint = await client.Files.CreateBlueprintAsync(new FilesCreateBlueprintOptions
{
FileId = "file_a1b2c3d4e5f6",
Intent = "Identify the statement fields and transaction table",
Background = true,
});
Console.WriteLine(blueprint.Id);
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$blueprint = $client->files()->createBlueprint(
fileId: 'file_a1b2c3d4e5f6',
intent: 'Identify the statement fields and transaction table',
background: true,
);
echo $blueprint->id;
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
blueprint = client.files.create_blueprint(
file_id: 'file_a1b2c3d4e5f6',
intent: 'Identify the statement fields and transaction table',
background: true,
)
puts blueprint.id
curl -X POST \
'https://api.retab.com/v1/files/blueprints' \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_id": "file_a1b2c3d4e5f6",
"intent": "Identify the statement fields and transaction table",
"background": true
}'
{
"id": "<string>",
"file": {
"id": "<string>",
"filename": "<string>",
"mime_type": "<string>"
},
"object": "file.blueprint",
"intent": "<string>",
"output": {},
"status": "pending",
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"detail": []
}Create File Blueprint
Create a Document Blueprint for an uploaded file.
from retab import Retab
client = Retab()
blueprint = client.files.create_blueprint(
file_id="file_a1b2c3d4e5f6",
intent="Identify the statement fields and transaction table",
background=True,
)
print(blueprint.id)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const blueprint = await client.files.create_blueprint(
"file_a1b2c3d4e5f6",
"Identify the statement fields and transaction table",
"instant",
true
);
console.log(blueprint.id);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func main() {
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
blueprint, err := client.Files.CreateBlueprint(context.Background(), &retab.FilesCreateBlueprintParams{
FileID: "file_a1b2c3d4e5f6",
Intent: retab.Ptr("Identify the statement fields and transaction table"),
Background: retab.Ptr(true),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(blueprint.ID)
}
import com.retab.RetabClient;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
var blueprint = client.files().createBlueprint(
"file_a1b2c3d4e5f6",
"Identify the statement fields and transaction table",
null,
true);
System.out.println(blueprint.getId());
}
}
use retab::models::CreateFileBlueprintRequest;
use retab::resources::files::CreateBlueprintParams;
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 request = CreateFileBlueprintRequest::new("file_a1b2c3d4e5f6");
request.intent = Some("Identify the statement fields and transaction table".into());
request.background = Some(true);
let blueprint = client
.files()
.create_blueprint(CreateBlueprintParams::new(request))
.await?;
println!("{}", blueprint.id);
Ok(())
}
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var blueprint = await client.Files.CreateBlueprintAsync(new FilesCreateBlueprintOptions
{
FileId = "file_a1b2c3d4e5f6",
Intent = "Identify the statement fields and transaction table",
Background = true,
});
Console.WriteLine(blueprint.Id);
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$blueprint = $client->files()->createBlueprint(
fileId: 'file_a1b2c3d4e5f6',
intent: 'Identify the statement fields and transaction table',
background: true,
);
echo $blueprint->id;
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
blueprint = client.files.create_blueprint(
file_id: 'file_a1b2c3d4e5f6',
intent: 'Identify the statement fields and transaction table',
background: true,
)
puts blueprint.id
curl -X POST \
'https://api.retab.com/v1/files/blueprints' \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_id": "file_a1b2c3d4e5f6",
"intent": "Identify the statement fields and transaction table",
"background": true
}'
{
"id": "<string>",
"file": {
"id": "<string>",
"filename": "<string>",
"mime_type": "<string>"
},
"object": "file.blueprint",
"intent": "<string>",
"output": {},
"status": "pending",
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"detail": []
}from retab import Retab
client = Retab()
blueprint = client.files.create_blueprint(
file_id="file_a1b2c3d4e5f6",
intent="Identify the statement fields and transaction table",
background=True,
)
print(blueprint.id)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const blueprint = await client.files.create_blueprint(
"file_a1b2c3d4e5f6",
"Identify the statement fields and transaction table",
"instant",
true
);
console.log(blueprint.id);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func main() {
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
blueprint, err := client.Files.CreateBlueprint(context.Background(), &retab.FilesCreateBlueprintParams{
FileID: "file_a1b2c3d4e5f6",
Intent: retab.Ptr("Identify the statement fields and transaction table"),
Background: retab.Ptr(true),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(blueprint.ID)
}
import com.retab.RetabClient;
public final class Example {
public static void main(String[] args) throws Exception {
RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));
var blueprint = client.files().createBlueprint(
"file_a1b2c3d4e5f6",
"Identify the statement fields and transaction table",
null,
true);
System.out.println(blueprint.getId());
}
}
use retab::models::CreateFileBlueprintRequest;
use retab::resources::files::CreateBlueprintParams;
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 request = CreateFileBlueprintRequest::new("file_a1b2c3d4e5f6");
request.intent = Some("Identify the statement fields and transaction table".into());
request.background = Some(true);
let blueprint = client
.files()
.create_blueprint(CreateBlueprintParams::new(request))
.await?;
println!("{}", blueprint.id);
Ok(())
}
using Retab;
using RetabClient = Retab.Retab;
var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);
var blueprint = await client.Files.CreateBlueprintAsync(new FilesCreateBlueprintOptions
{
FileId = "file_a1b2c3d4e5f6",
Intent = "Identify the statement fields and transaction table",
Background = true,
});
Console.WriteLine(blueprint.Id);
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$blueprint = $client->files()->createBlueprint(
fileId: 'file_a1b2c3d4e5f6',
intent: 'Identify the statement fields and transaction table',
background: true,
);
echo $blueprint->id;
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
blueprint = client.files.create_blueprint(
file_id: 'file_a1b2c3d4e5f6',
intent: 'Identify the statement fields and transaction table',
background: true,
)
puts blueprint.id
curl -X POST \
'https://api.retab.com/v1/files/blueprints' \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"file_id": "file_a1b2c3d4e5f6",
"intent": "Identify the statement fields and transaction table",
"background": true
}'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Public create-file-blueprint request body.
File id to analyze.
Optional user intent used to guide the blueprint analysis.
Legacy compatibility field. Blueprint analysis always runs a single pass.
instant, reasoning If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1//{id} until status is terminal. Mutually exclusive with stream.
Response
Successful Response
A document blueprint generated from an uploaded file.
Unique identifier of the file blueprint.
Information about the analyzed file.
Show child attributes
Show child attributes
"file.blueprint"User intent supplied with the blueprint request.
The generated Document Blueprint payload.
Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.
pending, queued, in_progress, completed, failed, cancelled Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.
Show child attributes
Show child attributes
instant, reasoning