---
title: "Insert Documents"
method: POST
path: "/action/insertMany"
---

# Insert Documents

`POST /action/insertMany`

Insert multiple documents into a collection.

## Request body

- InsertManyRequestBody
  - `dataSource` string, required — The name of a linked MongoDB Atlas data source. This is commonly `"mongodb-atlas"` though it may be different in your App if you chose a different name when you created the data source.
  - `database` string, required — The name of a database in the specified data source.
  - `collection` string, required — The name of a collection in the specified database.
  - `documents` object[], required — A list of documents to insert into the collection.

## Response `200`

Inserted

- object — The result of an insertMany operation.
  - `insertedIds` string[] — A list of the `_id` values of the inserted documents.

## Other responses

- `400` — The request was malformed or incomplete.
- `401` — The authenticated user does not have permission to access this endpoint.

## Changes

- **2026-07-17** `6fcb7dd3fcd6` — 1 breaking
  - the `allOf[subschema #1: InsertManyResponseBody]/insertedIds/items/` response's property type/format changed from `string`/`` to ``/`` for status `200` (media type: application/json)
- **2025-01-23** `0a0b869afb08` — 1 breaking
  - the `allOf[subschema #1: InsertManyResponseBody]/insertedIds/items/` response's property type/format changed from ``/`` to `string`/`` for status `200` (media type: application/json)

[Change history](https://skmtc.dev/ferretdb/apis/ferretdb-data-api/changes/action/insertMany/post.md)

---

[API](https://skmtc.dev/ferretdb/apis/ferretdb-data-api.md) · [All operations](https://skmtc.dev/ferretdb/apis/ferretdb-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ferretdb/ferretdb-data-api/revisions/6fcb7dd3fcd6/schema)
