5.9. POST /db/_bulk_docs

5.9.1. Inserting Documents in Bulk
5.9.2. Updating Documents in Bulk
5.9.3. Bulk Documents Transaction Semantics
5.9.4. Bulk Document Validation and Conflict Errors
MethodPOST /db/_bulk_docs
Request JSON of the docs and updates to be applied
Response JSON of updated documents
Admin Privileges Requiredno
Return Codes
201 Document(s) have been created or updated

The bulk document API allows you to create and update multiple documents at the same time within a single request. The basic operation is similar to creating or updating a single document, except that you batch the document structure and information and . When creating new documents the document ID is optional. For updating existing documents, you must provide the document ID, revision information, and new document values.

For both inserts and updates the basic structure of the JSON is the same:

Table 5.4.  Bulk Documents

FieldDescription
all_or_nothing (optional) Sets the database commit mode to use all-or-nothing semantics
docs [array] Bulk Documents Document
        _id (optional) Document ID
        _rev (optional) Revision ID (when updating an existing document)
        _deleted (optional) Whether the document should be deleted