Update MO Operation
PUT/api/manufacturing/mo-operations/:moOperation
Update an MO operation. Allowed on both source='manual' AND source='from_bom' rows — edits to from_bom rows do NOT propagate back to the BOM master.
manufacturing:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
All body fields are 'sometimes' (omit to leave unchanged):
sequence(integer, min 0)name(string, max 255)type(enum: process, setup, per_unit, fixed_cost) — maps to operation_type columnwork_center_id(integer, exists:work_centers,id, nullable)default_operator_id(integer, exists:users,id, nullable)expected_duration_minutes(integer, min 0, nullable)hourly_rate(numeric, min 0, nullable)fixed_cost(numeric, min 0, nullable) — flat per-run cost added additively to labour. Changing it re-derives actual_cost as (time × rate) + fixed_cost.notes(string, max 1000, nullable)
When the row is source='from_bom' and any of {sequence, name, operation_type, work_center_id, default_operator_id, expected_duration_minutes, hourly_rate, fixed_cost} now differs from the linked BOM operation, the response field is_modified_from_bom flips to true.
Refused with 422 {code:'mo_locked'} when MO status is completed | closed | cancelled.
The response also carries a cost_source field: 'none' (no actual_cost yet), 'actual' (cost backed by logged time, or a fixed_cost operation), 'estimated' (cost fell back to planned duration because no timer was logged), or 'manual' (an explicitly supplied actual_cost). Sending actual_cost in the body stamps cost_source='manual' and locks the cost against automatic re-derivation — rate, fixed-cost, or type edits no longer recompute it; only another explicit actual_cost (null clears both cost and source), or an explicitly logged positive time, replaces it.
cost_classification (optional, labor|overhead, default labor) sets the expense classification independently of the rate basis: labor posts the operation's variable cost to the Labor bucket (marked up by the work center's overhead %); overhead posts machine/tooling-style cost to the Overhead bucket with no additional markup.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.