# Create a production record Creates a new production record to add units to an open session. Requires JWT token authentication in the Authorization header. Key features: - Only the session owner can create records - Session must be open - Supports idempotency via clientEventId and optional idempotencyKey - Optimized for high-performance processing Endpoint: POST /api/control/production/records Version: 2.0.0 Security: bearerAuth ## Request fields (application/json): - `sessionId` (string, required) Session identifier Example: "6507f1e3c9d8e2a4b1f9c3d5" - `workerId` (string, required) Worker identifier Example: "JS0315" - `worker_name` (string, required) Worker full name Example: "John Smith" - `units` (number) Number of units to record (defaults to 1) Example: 5 - `recordedAtUtc` (string, required) Timestamp when the record was created (ISO 8601 UTC) Example: "2025-10-19T14:30:00.000Z" - `idempotencyKey` (string) Idempotency key for deduplication Example: "mobile-app-key-timestamp-123456" - `clientEventId` (string, required) Unique client-side event identifier for idempotency Example: "evt_1234567890abcdef" - `auth0Id` (string, required) User identifier (internal use, derived from JWT token) Example: "user_123456789" ## Response 200 fields (application/json): - `status` (string) Example: "success" - `data` (object) - `data.payloadPreview` (object) - `data.payloadPreview.recordId` (string) Generated record identifier Example: "rec_1234567890abcdef" - `data.payloadPreview.sessionId` (string) Example: "6507f1e3c9d8e2a4b1f9c3d5" - `data.payloadPreview.workerId` (string) Example: "JS0315" - `data.payloadPreview.units` (number) Example: 5 - `data.idempotent` (boolean) Whether this was an idempotent replay Example: true ## Response 201 fields (application/json): - `status` (string) Example: "success" - `data` (object) - `data.payloadPreview` (object) - `data.payloadPreview.recordId` (string) Generated record identifier Example: "rec_1234567890abcdef" - `data.payloadPreview.sessionId` (string) Example: "6507f1e3c9d8e2a4b1f9c3d5" - `data.payloadPreview.workerId` (string) Example: "JS0315" - `data.payloadPreview.units` (number) Example: 5 - `data.idempotent` (boolean) Whether this was an idempotent replay ## Response 400 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 401 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 403 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 404 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 409 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 500 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information"