from retab import Retab
client = Retab()
template = client.edits.templates.update(
"edittplt_abc123",
name="W-9 Form (2024)",
)
print(template.name)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const template = await client.edits.templates.update("edittplt_abc123", "W-9 Form (2024)");
console.log(template.name);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func ptr[T any](v T) *T { return &v }
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
name := "W-9 Form (2024)"
template, err := client.Edits.Templates.Update(ctx, "edittplt_abc123", &retab.EditTemplatesUpdateParams{
Name: &name,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(template.Name)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
template = client.edits.templates.update(
template_id: 'edittplt_abc123',
name: 'W-9 Form (2024)',
)
puts template.name
use retab::models::UpdateEditTemplateRequest;
use retab::resources::edit_templates::UpdateParams;
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 template = client
.edits().templates()
.update(
"edittplt_abc123",
UpdateParams {
body: UpdateEditTemplateRequest {
name: Some("W-9 Form (2024)".into()),
form_fields: None,
},
},
)
.await?;
println!("{}", template.name);
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->edits()->templates()->update(
templateId: 'tmpl_abc123',
);
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.Edits.Templates.UpdateAsync("tmpl_abc123", new EditTemplatesUpdateOptions());
Console.WriteLine(result);
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 result = client.edits().templates().update("tmpl_abc123", "Invoice Processing", null);
System.out.println(result);
}
}
curl -X PATCH \
'https://api.retab.com/v1/edits/templates/edittplt_abc123' \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name": "W-9 Form (2024)"}'
{
"id": "edittplt_abc123",
"name": "W-9 Form (2024)",
"file": {
"id": "file_6dd6eb00688ad8d1",
"filename": "w9_empty.pdf",
"mime_type": "application/pdf"
},
"form_fields": [
{
"key": "full_name",
"description": "Full legal name",
"type": "text",
"bbox": {
"left": 0.15,
"top": 0.2,
"width": 0.35,
"height": 0.03,
"page": 1
}
}
],
"field_count": 1,
"created_at": "2024-03-15T10:30:00Z",
"updated_at": "2024-03-15T11:15:00Z"
}
{
"detail": "Template edittplt_abc123 not found"
}
Templates
Update Template
Update an edit template.
Applies a partial update to the template identified by template_id. Set
name to rename it and/or form_fields to replace its field list; omitted
fields are left unchanged. Returns the updated template, or 404 if no
template with that id exists.
PATCH
/
v1
/
edits
/
templates
/
{template_id}
from retab import Retab
client = Retab()
template = client.edits.templates.update(
"edittplt_abc123",
name="W-9 Form (2024)",
)
print(template.name)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const template = await client.edits.templates.update("edittplt_abc123", "W-9 Form (2024)");
console.log(template.name);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func ptr[T any](v T) *T { return &v }
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
name := "W-9 Form (2024)"
template, err := client.Edits.Templates.Update(ctx, "edittplt_abc123", &retab.EditTemplatesUpdateParams{
Name: &name,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(template.Name)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
template = client.edits.templates.update(
template_id: 'edittplt_abc123',
name: 'W-9 Form (2024)',
)
puts template.name
use retab::models::UpdateEditTemplateRequest;
use retab::resources::edit_templates::UpdateParams;
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 template = client
.edits().templates()
.update(
"edittplt_abc123",
UpdateParams {
body: UpdateEditTemplateRequest {
name: Some("W-9 Form (2024)".into()),
form_fields: None,
},
},
)
.await?;
println!("{}", template.name);
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->edits()->templates()->update(
templateId: 'tmpl_abc123',
);
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.Edits.Templates.UpdateAsync("tmpl_abc123", new EditTemplatesUpdateOptions());
Console.WriteLine(result);
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 result = client.edits().templates().update("tmpl_abc123", "Invoice Processing", null);
System.out.println(result);
}
}
curl -X PATCH \
'https://api.retab.com/v1/edits/templates/edittplt_abc123' \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name": "W-9 Form (2024)"}'
{
"id": "edittplt_abc123",
"name": "W-9 Form (2024)",
"file": {
"id": "file_6dd6eb00688ad8d1",
"filename": "w9_empty.pdf",
"mime_type": "application/pdf"
},
"form_fields": [
{
"key": "full_name",
"description": "Full legal name",
"type": "text",
"bbox": {
"left": 0.15,
"top": 0.2,
"width": 0.35,
"height": 0.03,
"page": 1
}
}
],
"field_count": 1,
"created_at": "2024-03-15T10:30:00Z",
"updated_at": "2024-03-15T11:15:00Z"
}
{
"detail": "Template edittplt_abc123 not found"
}
Update the name and/or the form fields of an existing template. Both fields are optional; only supplied values are overwritten. Supplying
form_fields replaces the entire list.
from retab import Retab
client = Retab()
template = client.edits.templates.update(
"edittplt_abc123",
name="W-9 Form (2024)",
)
print(template.name)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const template = await client.edits.templates.update("edittplt_abc123", "W-9 Form (2024)");
console.log(template.name);
package main
import (
"context"
"fmt"
"log"
retab "github.com/retab-dev/retab/clients/go"
)
func ptr[T any](v T) *T { return &v }
func main() {
ctx := context.Background()
client, err := retab.NewClient("")
if err != nil {
log.Fatal(err)
}
name := "W-9 Form (2024)"
template, err := client.Edits.Templates.Update(ctx, "edittplt_abc123", &retab.EditTemplatesUpdateParams{
Name: &name,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(template.Name)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
template = client.edits.templates.update(
template_id: 'edittplt_abc123',
name: 'W-9 Form (2024)',
)
puts template.name
use retab::models::UpdateEditTemplateRequest;
use retab::resources::edit_templates::UpdateParams;
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 template = client
.edits().templates()
.update(
"edittplt_abc123",
UpdateParams {
body: UpdateEditTemplateRequest {
name: Some("W-9 Form (2024)".into()),
form_fields: None,
},
},
)
.await?;
println!("{}", template.name);
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->edits()->templates()->update(
templateId: 'tmpl_abc123',
);
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.Edits.Templates.UpdateAsync("tmpl_abc123", new EditTemplatesUpdateOptions());
Console.WriteLine(result);
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 result = client.edits().templates().update("tmpl_abc123", "Invoice Processing", null);
System.out.println(result);
}
}
curl -X PATCH \
'https://api.retab.com/v1/edits/templates/edittplt_abc123' \
-H "Authorization: Bearer $RETAB_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name": "W-9 Form (2024)"}'
{
"id": "edittplt_abc123",
"name": "W-9 Form (2024)",
"file": {
"id": "file_6dd6eb00688ad8d1",
"filename": "w9_empty.pdf",
"mime_type": "application/pdf"
},
"form_fields": [
{
"key": "full_name",
"description": "Full legal name",
"type": "text",
"bbox": {
"left": 0.15,
"top": 0.2,
"width": 0.35,
"height": 0.03,
"page": 1
}
}
],
"field_count": 1,
"created_at": "2024-03-15T10:30:00Z",
"updated_at": "2024-03-15T11:15:00Z"
}
{
"detail": "Template edittplt_abc123 not found"
}
Authorizations
Body
application/json
Response
Successful Response
A reusable edit template: an empty PDF and the form_fields defined on it.