Skip to main content
An integration usually keys everything on its own id, such as a creative_id or a product_sku. For each item it makes three calls:
  1. Look up the item’s object in the bucket. No object means you never submitted it.
  2. Submit the item once, only when the lookup finds nothing.
  3. Read the item’s documents once its object is COMPLETED.
You keep no state of your own: the lookup tells you where each item stands. The examples below use a bucket creatives whose schema has a creative_id string and an image blob, and a retriever creative_lookup with one input, creative_id.

Object states

An object’s status tells you where processing stands. Treat any other status as still processing. Combined with the lookup, an item is in one of four states: A read alone cannot tell “never submitted” from “not ready”, because both return an empty list. The lookup can.

1. Look up an item

List the bucket’s objects with a filter on your id:
Each entry in results has object_id, status, error, document_count, created_at and updated_at.

2. Submit an item

Create the object with auto_process=true, so processing starts at once:
The response is the object with status: "PENDING". Look it up again until status is COMPLETED or FAILED.

3. Read an item’s documents

Execute the retriever with your id as its input:
Read documents, and check status and warnings with it. A run that timed out or skipped a stage answers HTTP 200 with status: "degraded", and its documents can be short. You can also read every document made from one object, across all collections, with GET /v1/objects/{object_id}/documents.

Duplicates and retries

Each create makes a new object, even when its fields match an object you created before. Two submits of one item give two objects, two processing charges, and a read that returns the documents of both. You have three ways to prevent it: idempotency_key protects a retry that follows the first call. Two creates with the same key sent at the same moment can both succeed, so use a unique key when submits can race.

Unique keys

Set unique_key when you create the bucket. It cannot be added to a bucket created without one. Its fields name the schema fields that identify an item:
The policy decides what a create does when the key exists: ?policy= on the create call wins over the bucket’s default_policy. With neither, the create answers 400.

A typed contract for one retriever

The API reference shows the execute call for every retriever, so its document shape is generic. A specific retriever’s request and response are fixed by its configuration, and you can read both. Request. GET /v1/retrievers/{retriever_id} returns input_schema, a flat map of input names to {"type": ..., "required": ...}. Those names are the keys of inputs:
Response. The same call returns collection_ids. GET /v1/collections/{collection_id} returns each collection’s output_schema: the fields its documents carry, which are your passthrough fields plus the extractor’s outputs. Stages that enrich or reshape documents add or change fields; each stage page lists what it adds. Every document also has document_id and collection_id. From those two reads you can write the types once:
A retriever’s shape changes only when you change its stages or its collections. Pin the retriever you integrate against, and re-read both schemas after you edit it.