Přejít na hlavní obsah
POST
/
v1
/
tables
const table = await client.tables.create({
  schema_id: "schema_abc123",
  name: "Q1 Product Catalog",
  file_ids: ["file_xyz789"],
  webhook_url: "https://your-server.com/webhooks",
});

console.log(table.id);     // "tbl_..."
console.log(table.status); // "processing"
table = client.tables.create(
    schema_id="schema_abc123",
    name="Q1 Product Catalog",
    file_ids=["file_xyz789"],
    webhook_url="https://your-server.com/webhooks",
)

print(table["id"])      # "tbl_..."
print(table["status"])  # "processing"
curl -X POST "https://hub.banditshq.com/api/v1/tables" \
  -H "Authorization: Bearer lasso_..." \
  -H "Content-Type: application/json" \
  -d '{
    "schema_id": "schema_abc123",
    "name": "Q1 Product Catalog",
    "file_ids": ["file_xyz789"],
    "webhook_url": "https://your-server.com/webhooks"
  }'
{
  "id": "tbl_abc123",
  "name": "Q1 Product Catalog",
  "schema_id": "schema_xyz789",
  "status": "processing",
  "progress": 0,
  "total_rows": 0,
  "source_type": "files",
  "additional_context": null,
  "enhancement_context": null,
  "error_message": null,
  "files": [
    { "name": "catalog.pdf", "path": "company_123/file_xyz/catalog.pdf", "size": 1048576 }
  ],
  "created_at": "2025-03-10T14:30:00.000Z",
  "updated_at": "2025-03-10T14:30:00.000Z"
}

Tělo požadavku

schema_id
string
povinné
ID schématu, které se použije pro extrakci.
name
string
povinné
Název tabulky.
file_ids
string[]
Pole ID souborů (z Files API), ze kterých se mají extrahovat data. Zadejte přesně jedno z file_ids, file_urls nebo source_text.
file_urls
string[]
Pole veřejně přístupných URL adres, ze kterých se mají extrahovat data.
source_text
string
Surový textový obsah, ze kterého se mají extrahovat data.
additional_context
string
Dodatečný kontext pro řízení procesu extrakce.
enhancement_context
string
Kontext pro AI obohacení extrahovaných dat.
webhook_url
string
URL pro příjem webhook notifikací po dokončení zpracování.

Odpověď

Vrací vytvořený objekt tabulky se stavem processing.
id
string
Jedinečný identifikátor tabulky.
name
string
Název tabulky.
schema_id
string
Schéma použité pro extrakci.
status
string
Pro novou tabulku vždy processing.
progress
integer
Průběh extrakce (0-100).
total_rows
integer
Počet dosud extrahovaných řádků (zpočátku 0).
source_type
string
files nebo text.
additional_context
string | null
Kontext extrakce.
enhancement_context
string | null
Kontext obohacení.
error_message
string | null
Chybová zpráva, pokud zpracování selhalo.
files
array
Metadata nahraných souborů.
created_at
string
Časové razítko ISO 8601.
updated_at
string
Časové razítko ISO 8601.
const table = await client.tables.create({
  schema_id: "schema_abc123",
  name: "Q1 Product Catalog",
  file_ids: ["file_xyz789"],
  webhook_url: "https://your-server.com/webhooks",
});

console.log(table.id);     // "tbl_..."
console.log(table.status); // "processing"
table = client.tables.create(
    schema_id="schema_abc123",
    name="Q1 Product Catalog",
    file_ids=["file_xyz789"],
    webhook_url="https://your-server.com/webhooks",
)

print(table["id"])      # "tbl_..."
print(table["status"])  # "processing"
curl -X POST "https://hub.banditshq.com/api/v1/tables" \
  -H "Authorization: Bearer lasso_..." \
  -H "Content-Type: application/json" \
  -d '{
    "schema_id": "schema_abc123",
    "name": "Q1 Product Catalog",
    "file_ids": ["file_xyz789"],
    "webhook_url": "https://your-server.com/webhooks"
  }'
{
  "id": "tbl_abc123",
  "name": "Q1 Product Catalog",
  "schema_id": "schema_xyz789",
  "status": "processing",
  "progress": 0,
  "total_rows": 0,
  "source_type": "files",
  "additional_context": null,
  "enhancement_context": null,
  "error_message": null,
  "files": [
    { "name": "catalog.pdf", "path": "company_123/file_xyz/catalog.pdf", "size": 1048576 }
  ],
  "created_at": "2025-03-10T14:30:00.000Z",
  "updated_at": "2025-03-10T14:30:00.000Z"
}

Čekání na dokončení

Tabulky se zpracovávají asynchronně. Použijte vestavěný polling helper SDK nebo nakonfigurujte webhook.
const completed = await client.tables.waitForCompletion(table.id, {
  intervalMs: 3000,
  timeoutMs: 300000,
});

console.log(completed.status);     // "completed"
console.log(completed.total_rows); // 42
completed = client.tables.wait_for_completion(
    table["id"],
    interval_s=3,
    timeout_s=300,
)

print(completed["status"])      # "completed"
print(completed["total_rows"])  # 42