curl --request POST \
--url https://api.example.com/{collection}/batch \
--header 'Content-Type: application/json' \
--data '
{
"documents": [
{}
]
}
'{
"created": [
{}
],
"failed": [
{
"index": 123,
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create multiple documents in a single request with validation and hooks support
curl --request POST \
--url https://api.example.com/{collection}/batch \
--header 'Content-Type: application/json' \
--data '
{
"documents": [
{}
]
}
'{
"created": [
{}
],
"failed": [
{
"index": 123,
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KTS-o7/permission-mongo/llms.txt
Use this file to discover all available pages before exploring further.
{
"documents": [
{
"name": "Alice Johnson",
"email": "alice@example.com",
"role": "manager",
"department": "Engineering"
},
{
"name": "Bob Smith",
"email": "bob@example.com",
"role": "developer",
"department": "Engineering"
},
{
"name": "Carol White",
"email": "carol@example.com",
"role": "designer",
"department": "Product"
}
]
}
{
"created": [
"65f1a2b3c4d5e6f7a8b9c0d1",
"65f1a2b3c4d5e6f7a8b9c0d2"
],
"failed": [
{
"index": 2,
"error": {
"code": "schema_validation",
"message": "Field 'email' is required"
}
}
]
}
created_by: Set to the authenticated user’s IDcreated_at: Set to current UTC timestampupdated_at: Set to current UTC timestampcreate permission for the collectionfailed arrayhandlers_batch.go:212-284:
collection_not_found: Collection does not existforbidden: User lacks create permissionbad_request: Invalid request format or batch size exceededschema_validation: One or more documents failed validation{
"error": {
"code": "bad_request",
"message": "Batch size exceeds maximum limit of 1000",
"details": {
"max_batch_size": 1000,
"requested": 1500
}
}
}
pkg/api/handlers_batch.go:113-300