from retab import Retab
client = Retab()
file = client.files.get("file_a1b2c3d4e5f6")
print(f"Filename: {file.filename}")
print(f"Pages: {file.page_count}")
print(f"Created: {file.created_at}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const file = await client.files.get("file_a1b2c3d4e5f6");
console.log(`Filename: ${file.filename}`);
console.log(`Pages: ${file.pageCount}`);
console.log(`Created: ${file.createdAt}`);
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)
}
file, err := client.Files.Get(ctx, "file_a1b2c3d4e5f6")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Filename: %s\n", file.Filename)
fmt.Printf("Pages: %v\n", file.PageCount)
fmt.Printf("Created: %v\n", file.CreatedAt)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
file = client.files.get(file_id: 'file_a1b2c3d4e5f6')
puts "Filename: #{file.filename}"
puts "Pages: #{file.page_count}"
puts "Created: #{file.created_at}"
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 file = client.files().get("file_a1b2c3d4e5f6").await?;
println!("Filename: {}", file.filename);
println!("Pages: {}", file.page_count.unwrap_or_default());
println!("Created: {}", file.created_at.as_deref().unwrap_or("unknown"));
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->files()->get(
fileId: 'file_6dd6eb00688ad8d1',
);
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.Files.GetAsync("file_6dd6eb00688ad8d1");
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.files().get("file_abc123");
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/files/file_a1b2c3d4e5f6' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"id": "file_a1b2c3d4e5f6",
"object": "file",
"filename": "invoice.pdf",
"page_count": 3,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"detail": "File not found"
}
Files
Get File
Retrieve a file.
Returns metadata for the file identified by file_id, including its
filename, page_count, and timestamps. Responds with 404 if no
matching file exists.
GET
/
v1
/
files
/
{file_id}
from retab import Retab
client = Retab()
file = client.files.get("file_a1b2c3d4e5f6")
print(f"Filename: {file.filename}")
print(f"Pages: {file.page_count}")
print(f"Created: {file.created_at}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const file = await client.files.get("file_a1b2c3d4e5f6");
console.log(`Filename: ${file.filename}`);
console.log(`Pages: ${file.pageCount}`);
console.log(`Created: ${file.createdAt}`);
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)
}
file, err := client.Files.Get(ctx, "file_a1b2c3d4e5f6")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Filename: %s\n", file.Filename)
fmt.Printf("Pages: %v\n", file.PageCount)
fmt.Printf("Created: %v\n", file.CreatedAt)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
file = client.files.get(file_id: 'file_a1b2c3d4e5f6')
puts "Filename: #{file.filename}"
puts "Pages: #{file.page_count}"
puts "Created: #{file.created_at}"
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 file = client.files().get("file_a1b2c3d4e5f6").await?;
println!("Filename: {}", file.filename);
println!("Pages: {}", file.page_count.unwrap_or_default());
println!("Created: {}", file.created_at.as_deref().unwrap_or("unknown"));
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->files()->get(
fileId: 'file_6dd6eb00688ad8d1',
);
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.Files.GetAsync("file_6dd6eb00688ad8d1");
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.files().get("file_abc123");
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/files/file_a1b2c3d4e5f6' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"id": "file_a1b2c3d4e5f6",
"object": "file",
"filename": "invoice.pdf",
"page_count": 3,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"detail": "File not found"
}
Retrieve metadata for a single file by ID.
from retab import Retab
client = Retab()
file = client.files.get("file_a1b2c3d4e5f6")
print(f"Filename: {file.filename}")
print(f"Pages: {file.page_count}")
print(f"Created: {file.created_at}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const file = await client.files.get("file_a1b2c3d4e5f6");
console.log(`Filename: ${file.filename}`);
console.log(`Pages: ${file.pageCount}`);
console.log(`Created: ${file.createdAt}`);
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)
}
file, err := client.Files.Get(ctx, "file_a1b2c3d4e5f6")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Filename: %s\n", file.Filename)
fmt.Printf("Pages: %v\n", file.PageCount)
fmt.Printf("Created: %v\n", file.CreatedAt)
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
file = client.files.get(file_id: 'file_a1b2c3d4e5f6')
puts "Filename: #{file.filename}"
puts "Pages: #{file.page_count}"
puts "Created: #{file.created_at}"
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 file = client.files().get("file_a1b2c3d4e5f6").await?;
println!("Filename: {}", file.filename);
println!("Pages: {}", file.page_count.unwrap_or_default());
println!("Created: {}", file.created_at.as_deref().unwrap_or("unknown"));
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->files()->get(
fileId: 'file_6dd6eb00688ad8d1',
);
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.Files.GetAsync("file_6dd6eb00688ad8d1");
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.files().get("file_abc123");
System.out.println(result);
}
}
curl -X GET \
'https://api.retab.com/v1/files/file_a1b2c3d4e5f6' \
-H "Authorization: Bearer $RETAB_API_KEY"
{
"id": "file_a1b2c3d4e5f6",
"object": "file",
"filename": "invoice.pdf",
"page_count": 3,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"detail": "File not found"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
An uploaded file: its id, filename, MIME type, page count, and timestamps.
The unique identifier of the file
The name of the file
Allowed value:
"file"The MIME type of the file
When the file was created
When the file was last updated
Number of pages in the file
⌘I