Skip to main content

Batch Operations

Using batch operations

Manage collections with batch operations and key-value pairs using the id key from each record or assigned key-value pairing. You can also use the id key to update or delete records in a batch operation. Note: Your deployment tier has limits on how many id keys you can use in a batch operation. (500-20,000 at a time depending on the deployment tier)

Batch Insert

Insert multiple records in a single request:

POST https://{EKODB_API_URL}/api/batch/insert/{collection}
Content-Type: application/json
Authorization: Bearer {YOUR_TOKEN}

{
"records": [
{"id": "id1", "name": "User 1"},
{"id": "id2", "name": "User 2"}
]
}

# Response
{
"successful": ["id1", "id2"],
"failed": ["id3", "id4"]
}

Batch Update

Update multiple records in a single request:

PUT https://{EKODB_API_URL}/api/batch/update/{collection}
Content-Type: application/json
Authorization: Bearer {YOUR_TOKEN}

{
"updates": [
{"id": "id1", "name": "Updated 1"},
{"id": "id2", "name": "Updated 2"}
]
}

# Response
{
"successful": ["id1", "id2", ...],
"failed": ["id3", "id4", ...]
}

Batch Delete

Delete multiple records in a single request:

DELETE https://{EKODB_API_URL}/api/batch/delete/{collection}
Content-Type: application/json
Authorization: Bearer {YOUR_TOKEN}

{
"ids": ["id1", "id2"]
}

# Response
{
"successful": ["id1", "id2", ...],
"failed": ["id3", "id4", ...]
}