# Insert One Document **POST /action/insertOne** Insert a single document into a collection. ## Servers - Global App: https://data.mongodb-api.com/app/your-app-id/endpoint/data/v1 (Global App) - Local App: https://us-east-1.aws.data.mongodb-api.com/app/your-app-id/endpoint/data/v1 (Local App) ## Authentication methods - Access token - Email & Password - Api key - Custom jwt ## Parameters ### Body: application/json (object) - **dataSource** (string) 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) The name of a database in the specified data source. - **collection** (string) The name of a collection in the specified database. - **document** (object) A document to insert into the collection. ## Responses ### 200 Inserted #### Body: application/json (object) - **insertedId** () The `_id` value of the inserted document. ### 400 The request was malformed or incomplete. #### Body: application/json (object) - **error** (string) A message that describes the error. - **error_code** (string) The error type. - **link** (string) A link to a [log entry](https://www.mongodb.com/zh-cn/docs/atlas/app-services/logs/endpoint/) for the failed operation. ### 401 The authenticated user does not have permission to access this endpoint. #### Body: application/json (object) - **error** (string) A message that describes the error. - **error_code** (string) The error type. - **link** (string) A link to a [log entry](https://www.mongodb.com/zh-cn/docs/atlas/app-services/logs/endpoint/) for the failed operation. [Powered by Bump.sh](https://bump.sh)