> For the complete documentation index, see [llms.txt](https://flapjax.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flapjax.gitbook.io/docs/rest-api/reference/record-events/batch-create-records.md).

# Batch Create Records

## Batch create records

> Creates up to \*\*100 records\*\* in a single request. Each record is processed independently — partial success is possible.  The response contains a result object per record indicating success or failure.<br>

```json
{"openapi":"3.0.3","info":{"title":"Listener API","version":"1.0.0"},"tags":[{"name":"batch-create-records"}],"servers":[{"url":"https://{domain}/v1","variables":{"domain":{"default":"your-domain","description":"Your deployment domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token with the required scope for the endpoint. Pass via the `Authorization: Bearer <token>` header.\n"}},"parameters":{"StackKey":{"name":"stack_key","in":"path","required":true,"description":"The unique key identifying the stack.","schema":{"type":"string"}}},"schemas":{"Record":{"type":"object","description":"A record object within a stack.","properties":{"record_id":{"type":"string","description":"Internal MongoDB ObjectID."},"external_id":{"type":"string","description":"External identifier."}},"additionalProperties":{"description":"Attribute values as defined by the stack's schema."}},"BatchResult":{"type":"object","description":"Result of a single record in a batch operation.","properties":{"index":{"type":"integer","description":"Zero-based index of the record in the request array."},"success":{"type":"boolean","description":"Whether the operation succeeded for this record."},"error":{"type":"string","nullable":true,"description":"Error message if the operation failed (null on success)."}}},"ErrorResponse":{"type":"object","description":"Standard error response envelope.","properties":{"error":{"type":"string","description":"Machine-readable error type. Use this for programmatic error handling.\n","enum":["operation_failed","failed_binding_json","invalid_json","invalid_parameter","not_found","duplicate_entry","rate_limit_exceeded"]},"errorstack":{"type":"object","nullable":true,"description":"Detailed error stack (only present for server errors)."}}}}},"paths":{"/stacks/{stack_key}/batch":{"post":{"summary":"Batch create records","operationId":"batchCreateRecords","tags":["batch-create-records"],"description":"Creates up to **100 records** in a single request. Each record is processed independently — partial success is possible.  The response contains a result object per record indicating success or failure.\n","parameters":[{"$ref":"#/components/parameters/StackKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/Record"}}}}},"responses":{"201":{"description":"Batch processed. Each element reports its own success/failure.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchResult"}}}}},"400":{"description":"Request body is invalid or empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
