Skip to main content
Bulk methods allow you to create, update, or delete up to 100 records in a single request. Use them for imports, batch status updates, or any operation where looping individual calls would be slow or hit rate limits.

All-or-nothing

Every bulk call runs in a single transaction: either every item succeeds or nothing is written. If any item fails validation, the call throws HaspSDKError with code VALIDATION_FAILED (HTTP 422) and no records are created, updated, or deleted. getFieldErrors() keys each error by the item’s position in the batch, so you can show exactly which row to fix and retry the whole batch. Bulk calls throw like every other SDK method — there is no partial result to inspect. (Earlier 1.x releases resolved { data, error } when some items failed; the API is now all-or-nothing, so a failing batch rejects instead and nothing is written.)

bulkCreateRecords(entityKey, records, signal?)

Creates up to 100 records in one request.
Field error keys have the form records.<index>.<field>.

bulkUpdateRecords(entityKey, updates, signal?)

Updates up to 100 records in one request. Each item must include id and data. PATCH semantics — only submitted fields change; send null to clear a field.
Field error keys have the form updates.<index>.id or updates.<index>.data.<field>.

bulkDeleteRecords(entityKey, ids, signal?)

Deletes up to 100 records in one request.
Field error keys have the form ids.<index>.

Limits

For datasets larger than 100, loop in batches: