Batch Operations
Batch operations let you execute up to 1,000 operations in a single atomic request. All operations succeed together or fail together — there's no partial state.
How It Works
Send an array of operations to the batch endpoint. Each operation specifies a type and the data for that operation. The entire batch is executed within a single transaction.
Usage
rekor batch --base my-base --operations '[
{"type":"upsert_record","record_type":"orders",
"data":{"customer":"Acme Corp","total":5000}},
{"type":"upsert_record","record_type":"line_items",
"data":{"product":"Widget","qty":10,"price":500}},
{"type":"upsert_relationship",
"rel_type":"contains",
"source_record_type":"orders","source_id":"ord_1",
"target_record_type":"line_items","target_id":"li_1"}
]'
Supported Operation Types
| Type | What it does |
|---|---|
upsert_record | Create or update a record in a record_type |
delete_record | Soft-delete a record |
upsert_relationship | Create or update a relationship between two records |
delete_relationship | Delete a relationship |
upsert_record_type | Create or update a record_type schema |
delete_record_type | Delete a record_type |
When to Use Batch
- Related records — create a parent record and its children together, ensuring both exist or neither does.
- Record + relationship — create a record and link it to another in one atomic step.
- Bulk imports — load many records at once, with guaranteed consistency.
- Schema + data — create a record_type and seed it with initial records atomically (preview bases only for schema changes).
Limits
Maximum 1,000 operations per batch request. Each operation is validated individually — if any operation fails validation, the entire batch is rejected before any writes occur.
REST API
POST /v1/{base_id}/batch
Content-Type: application/json
{
"operations": [
{"type": "upsert_record", "record_type": "orders", "data": {...}},
{"type": "upsert_relationship", "rel_type": "contains", ...}
]
}
MCP Tool
batch_operations(
base_id: "my-base",
operations: [
{type: "upsert_record", record_type: "orders", data: {...}},
{type: "upsert_relationship", rel_type: "contains", ...}
]
)