Skip to content

POST /operation

Create Operation

POST
/operation

Create a new operation template.

Inserts an Operation document into the database, pre-populating its
default_phase_parameters from the default_operation_parameters system
config if one exists.

Emits: (direct transaction — no event class)

Required scope: process:template:create

Authorizations

OAuth2PasswordBearer
password Flow
Token URL"/api/auth"
Scopes:
  • "admin"User can access and edit users and system settings
  • "library"User can access and edit products
  • "production"User can access and edit production plans
  • "operator"User can access the operator panel and make production declarations

Request Body

application/json
JSON
{
  
"_id": "string",
  
"_key": "string",
  
"_rev": "string",
  
"name": "Surface Inspection",
  
"code": "OP-INSPECT-01",
  
"description": "Visual and dimensional inspection of machined surfaces.",
  
"default_phase_parameters": {
  
  
"parallel_job_allowed": true,
  
  
"step_check": false,
  
  
"step_check_force_order": false,
  
  
"production_batch_qt": 1,
  
  
"max_offline": 60,
  
  
"auto_new_batch": true,
  
  
"std_processing_time": 60,
  
  
"unsupervised_work_allowed": false,
  
  
"display_job_timer": false
  
},
  
"default_phase_notes": "Refer to drawing REV-C for tolerance callouts.",
  
"default_phase_steps": [
  
  
{
  
  
  
"_key": "step-001",
  
  
  
"title": "Inspect weld joints",
  
  
  
"description": "Check all weld joints for porosity defects per IPC-A-610.",
  
  
  
"type": "instruction",
  
  
  
"form_fields": [
  
  
  
  
{
  
  
  
  
  
"_key": "ffd-001",
  
  
  
  
  
"custom_field_key": "cf-001",
  
  
  
  
  
"multiple": false,
  
  
  
  
  
"label": "Colour Code",
  
  
  
  
  
"hint": "Verify against approved colour chart",
  
  
  
  
  
"default": "pass",
  
  
  
  
  
"mandatory": false,
  
  
  
  
  
"hidden": false
  
  
  
  
}
  
  
  
],
  
  
  
"print_templates": [
  
  
  
  
"string"
  
  
  
],
  
  
  
"media": [
  
  
  
  
"string"
  
  
  
]
  
  
}
  
]
}

Responses

Successful Response

application/json
JSON
{
  
"status": 200,
  
"message": "string",
  
"detail": "string"
}

Samples

Powered by VitePress OpenAPI

Released under the Apache 2.0 License.