openapi: 3.2.0 info: title: Operations Hub Dispatch.workorders API version: 0.1.1 description: '' servers: [] tags: - name: dispatch.workorders paths: /api/dispatch/v1/workorders: get: operationId: dispatch_api_workorders_list_workorders summary: List Workorders parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: status schema: anyOf: - type: string - type: 'null' title: Status required: false - in: query name: customer_id schema: anyOf: - type: integer - type: 'null' title: Customer Id required: false - in: query name: project_id schema: anyOf: - type: integer - type: 'null' title: Project Id required: false - in: query name: windpark_id schema: anyOf: - type: integer - type: 'null' title: Windpark Id required: false - in: query name: type schema: anyOf: - type: string - type: 'null' title: Type required: false - in: query name: service_order_id schema: anyOf: - type: integer - type: 'null' title: Service Order Id required: false - in: query name: planned_start_datetime schema: anyOf: - format: date-time type: string - type: 'null' title: Planned Start Datetime required: false - in: query name: planned_start_datetime__gte schema: anyOf: - format: date-time type: string - type: 'null' title: Planned Start Datetime Gte required: false - in: query name: planned_start_datetime__lte schema: anyOf: - format: date-time type: string - type: 'null' title: Planned Start Datetime Lte required: false - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/Workorder' title: Response type: array description: List workorders. tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: dispatch_api_workorders_create_workorder summary: Create Workorder parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Workorder' description: 'Create a workorder. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorders/summary: get: operationId: dispatch_api_workorders_get_workorder_summary summary: Get Workorder Summary parameters: - in: query name: service_order_id schema: anyOf: - type: integer - type: 'null' title: Service Order Id required: false responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderSummary' description: 'Summarize workorders. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorders/activity-counts: get: operationId: dispatch_api_workorders_get_workorder_activity_counts summary: Get Workorder Activity Counts parameters: - in: query name: service_order_id schema: anyOf: - type: integer - type: 'null' title: Service Order Id required: false - in: query name: workorder_ids schema: anyOf: - type: string - type: 'null' title: Workorder Ids required: false responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderActivityCountsResponse' description: 'Return workorder activity counts. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-activities: get: operationId: dispatch_api_workorders_list_workorder_activities summary: List Workorder Activities parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: workorder_id schema: anyOf: - type: integer - type: 'null' title: Workorder Id required: false - in: query name: service_item_id schema: anyOf: - type: integer - type: 'null' title: Service Item Id required: false - in: query name: service_item_activity_id schema: anyOf: - type: integer - type: 'null' title: Service Item Activity Id required: false - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/WorkorderActivity' title: Response type: array description: List workorder activities. tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: dispatch_api_workorders_create_workorder_activity summary: Create Workorder Activity parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderActivity' description: Create a workorder activity. tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderActivityCreateInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorders/bulk: post: operationId: dispatch_api_workorders_bulk_create_workorders summary: Bulk Create Workorders parameters: [] responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/Workorder' title: Response type: array description: Create multiple workorders in a single transaction. tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderBulkInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorders/{workorder_id}: get: operationId: dispatch_api_workorders_get_workorder summary: Get Workorder parameters: - in: path name: workorder_id schema: title: Workorder Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Workorder' description: 'Retrieve a workorder. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] put: operationId: dispatch_api_workorders_update_workorder summary: Update Workorder parameters: - in: path name: workorder_id schema: title: Workorder Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Workorder' description: 'Update a workorder. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: dispatch_api_workorders_patch_workorder summary: Patch Workorder parameters: - in: path name: workorder_id schema: title: Workorder Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Workorder' description: 'Partially update a workorder. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: dispatch_api_workorders_delete_workorder summary: Delete Workorder parameters: - in: path name: workorder_id schema: title: Workorder Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: 'Soft-delete a workorder (sets deleted_at via SoftDeleteMixinDeletedAt). NOTE: The admin UI no longer offers delete. Use the cancel endpoint (POST /workorders/{id}/cancel) instead — soft delete hides the workorder from default queries and loses visibility into why it went away, whereas cancel keeps the workorder addressable with status=CANCELLED, a recorded reason, and a status change log entry capturing the actor. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorders/{workorder_id}/cancel: post: operationId: dispatch_api_workorders_cancel_workorder summary: Cancel Workorder parameters: - in: path name: workorder_id schema: title: Workorder Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Workorder' description: 'Cancel a workorder with a recorded reason. Sets status to CANCELLED, persists the reason on the workorder, and appends a row to WorkorderStatusChangeLog with reason and actor. Replaces the soft-delete flow on the admin UI — cancellation keeps the workorder visible and audit-traceable instead of hiding it via deleted_at.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderCancelInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-activities/{activity_id}: get: operationId: dispatch_api_workorders_get_workorder_activity summary: Get Workorder Activity parameters: - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderActivity' description: Retrieve a workorder activity. tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] put: operationId: dispatch_api_workorders_update_workorder_activity summary: Update Workorder Activity parameters: - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderActivity' description: Update a workorder activity. tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderActivityInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: dispatch_api_workorders_patch_workorder_activity summary: Patch Workorder Activity parameters: - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderActivity' description: Partially update a workorder activity. tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderActivityInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: dispatch_api_workorders_delete_workorder_activity summary: Delete Workorder Activity parameters: - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: Delete a workorder activity. tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-activities/bulk/update: patch: operationId: dispatch_api_workorders_bulk_patch_workorder_activities summary: Bulk Patch Workorder Activities parameters: [] responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/WorkorderActivity' title: Response type: array description: Bulk partially update workorder activities and delay teams. tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderActivityBulkUpdateInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-activities/{activity_id}/time-edits: get: operationId: dispatch_api_workorders_list_workorder_activity_time_edits summary: List Workorder Activity Time Edits parameters: - in: path name: activity_id schema: title: Activity Id type: integer required: true responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/WorkorderActivityTimeEdit' title: Response type: array description: List the start/end time edit history for a workorder activity. tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-plans: get: operationId: dispatch_api_workorders_list_workorder_plans summary: List Workorder Plans parameters: - in: query name: workorder_id schema: anyOf: - type: integer - type: 'null' title: Workorder Id required: false - in: query name: status schema: anyOf: - type: string - type: 'null' title: Status required: false - in: query name: resource_type schema: anyOf: - type: string - type: 'null' title: Resource Type required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/WorkorderPlan' title: Response type: array description: 'List workorder plans. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: dispatch_api_workorders_create_workorder_plan summary: Create Workorder Plan parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderPlan' description: 'Create a workorder plan. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderPlanInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-plans/{plan_id}: get: operationId: dispatch_api_workorders_get_workorder_plan summary: Get Workorder Plan parameters: - in: path name: plan_id schema: title: Plan Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderPlan' description: 'Retrieve a workorder plan. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] put: operationId: dispatch_api_workorders_update_workorder_plan summary: Update Workorder Plan parameters: - in: path name: plan_id schema: title: Plan Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderPlan' description: 'Update a workorder plan. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderPlanInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: dispatch_api_workorders_patch_workorder_plan summary: Patch Workorder Plan parameters: - in: path name: plan_id schema: title: Plan Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderPlan' description: 'Partially update a workorder plan. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkorderPlanInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: dispatch_api_workorders_delete_workorder_plan summary: Delete Workorder Plan parameters: - in: path name: plan_id schema: title: Plan Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: 'Delete a workorder plan. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/work-time-logs: get: operationId: dispatch_api_workorders_list_work_time_logs summary: List Work Time Logs parameters: - in: query name: workorder_id schema: anyOf: - type: integer - type: 'null' title: Workorder Id required: false - in: query name: activity_id schema: anyOf: - type: integer - type: 'null' title: Activity Id required: false - in: query name: resource_id schema: anyOf: - type: integer - type: 'null' title: Resource Id required: false - in: query name: started_at schema: anyOf: - format: date-time type: string - type: 'null' title: Started At required: false - in: query name: ended_at schema: anyOf: - format: date-time type: string - type: 'null' title: Ended At required: false - in: query name: work_time_category_id schema: anyOf: - type: integer - type: 'null' title: Work Time Category Id required: false - in: query name: status schema: anyOf: - type: string - type: 'null' title: Status required: false - in: query name: robot_set_id schema: anyOf: - type: integer - type: 'null' title: Robot Set Id required: false - in: query name: project_id schema: anyOf: - type: integer - type: 'null' title: Project Id required: false - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/WorkTimeLog' title: Response type: array description: 'List work time logs. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: dispatch_api_workorders_create_work_time_log summary: Create Work Time Log parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkTimeLog' description: 'Create a work time log. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkTimeLogInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/work-time-logs/{log_id}: get: operationId: dispatch_api_workorders_get_work_time_log summary: Get Work Time Log parameters: - in: path name: log_id schema: title: Log Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkTimeLog' description: 'Retrieve a work time log. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: dispatch_api_workorders_patch_work_time_log summary: Patch Work Time Log parameters: - in: path name: log_id schema: title: Log Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkTimeLog' description: 'Partially update a work time log. TODO: this is not yet fully implemented. Needs tests.' tags: - dispatch.workorders requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkTimeLogInput' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: dispatch_api_workorders_delete_work_time_log summary: Delete Work Time Log parameters: - in: path name: log_id schema: title: Log Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: 'Delete a work time log. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-status-changes: get: operationId: dispatch_api_workorders_list_workorder_status_changes summary: List Workorder Status Changes parameters: - in: query name: workorder_id schema: anyOf: - type: integer - type: 'null' title: Workorder Id required: false responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/WorkorderStatusChange' title: Response type: array description: 'List workorder status changes. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] /api/dispatch/v1/workorder-status-changes/{change_id}: get: operationId: dispatch_api_workorders_get_workorder_status_change summary: Get Workorder Status Change parameters: - in: path name: change_id schema: title: Change Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/WorkorderStatusChange' description: 'Retrieve a workorder status change. TODO: this is not yet fully implemented. Needs async conversion needs tests.' tags: - dispatch.workorders security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: Workorder: additionalProperties: false description: Dispatch workorder. properties: id: title: Id type: integer service_order: anyOf: - type: integer - type: 'null' title: Service Order service_order_line: anyOf: - type: integer - type: 'null' title: Service Order Line service_item: anyOf: - type: integer - type: 'null' title: Service Item project_id: anyOf: - type: integer - type: 'null' title: Project Id customer_id: anyOf: - type: integer - type: 'null' title: Customer Id name: anyOf: - type: string - type: 'null' title: Name description: anyOf: - type: string - type: 'null' title: Description status: anyOf: - type: string - type: 'null' title: Status planned_start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Planned Start Datetime planned_end_datetime: anyOf: - format: date-time type: string - type: 'null' title: Planned End Datetime windpark_id: anyOf: - type: integer - type: 'null' title: Windpark Id location_id: anyOf: - type: integer - type: 'null' title: Location Id turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id is_internal: anyOf: - type: boolean - type: 'null' title: Is Internal is_optional: default: false title: Is Optional type: boolean status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason status_change_by: anyOf: - type: integer - type: 'null' title: Status Change By type: anyOf: - type: string - type: 'null' title: Type mandatory_start_date: anyOf: - format: date-time type: string - type: 'null' title: Mandatory Start Date mandatory_due_date: anyOf: - format: date-time type: string - type: 'null' title: Mandatory Due Date service_code: anyOf: - type: string - type: 'null' title: Service Code assignee_user_id: anyOf: - type: integer - type: 'null' title: Assignee User Id activities_total: anyOf: - type: integer - type: 'null' title: Activities Total activities_completed: anyOf: - type: integer - type: 'null' title: Activities Completed required: - id title: Workorder type: object WorkorderActivityInput: additionalProperties: false description: Payload for creating/updating workorder activities. properties: workorder: anyOf: - type: integer - type: 'null' title: Workorder service_item: anyOf: - type: integer - type: 'null' title: Service Item service_item_activity_id: anyOf: - type: integer - type: 'null' title: Service Item Activity Id portal_service_activity_id: anyOf: - type: integer - type: 'null' title: Portal Service Activity Id start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Start Datetime end_datetime: anyOf: - format: date-time type: string - type: 'null' title: End Datetime resources: anyOf: - items: {} type: array - type: 'null' title: Resources robot_set_id: anyOf: - type: integer - type: 'null' title: Robot Set Id status: anyOf: - type: string - type: 'null' title: Status is_internal: anyOf: - type: boolean - type: 'null' title: Is Internal location_id: anyOf: - type: integer - type: 'null' title: Location Id turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id component_type_id: anyOf: - type: integer - type: 'null' title: Component Type Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id activity_description: anyOf: - type: string - type: 'null' title: Activity Description anomaly_id: anyOf: - type: integer - type: 'null' title: Anomaly Id status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason status_change_by: anyOf: - type: integer - type: 'null' title: Status Change By custom_fields: anyOf: - items: {} type: array - type: object - type: 'null' title: Custom Fields sort_order: anyOf: - type: integer - type: 'null' title: Sort Order comment: anyOf: - type: string - type: 'null' title: Comment ref_id: anyOf: - type: string - type: 'null' title: Ref Id preset_id: anyOf: - type: integer - type: 'null' title: Preset Id title: WorkorderActivityInput type: object WorkorderActivityCreateInput: additionalProperties: false description: 'Payload for creating a workorder activity. Extends the base input with `is_optional`, which is only valid on create. Clients may send `is_optional=True` when a sibling already exists for the same workorder+SIA (duplicate); the backend rejects it with a ValidationError otherwise. Omitting the field triggers auto-detection. See Wrike 4462483155.' properties: workorder: anyOf: - type: integer - type: 'null' title: Workorder service_item: anyOf: - type: integer - type: 'null' title: Service Item service_item_activity_id: anyOf: - type: integer - type: 'null' title: Service Item Activity Id portal_service_activity_id: anyOf: - type: integer - type: 'null' title: Portal Service Activity Id start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Start Datetime end_datetime: anyOf: - format: date-time type: string - type: 'null' title: End Datetime resources: anyOf: - items: {} type: array - type: 'null' title: Resources robot_set_id: anyOf: - type: integer - type: 'null' title: Robot Set Id status: anyOf: - type: string - type: 'null' title: Status is_internal: anyOf: - type: boolean - type: 'null' title: Is Internal location_id: anyOf: - type: integer - type: 'null' title: Location Id turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id component_type_id: anyOf: - type: integer - type: 'null' title: Component Type Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id activity_description: anyOf: - type: string - type: 'null' title: Activity Description anomaly_id: anyOf: - type: integer - type: 'null' title: Anomaly Id status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason status_change_by: anyOf: - type: integer - type: 'null' title: Status Change By custom_fields: anyOf: - items: {} type: array - type: object - type: 'null' title: Custom Fields sort_order: anyOf: - type: integer - type: 'null' title: Sort Order comment: anyOf: - type: string - type: 'null' title: Comment ref_id: anyOf: - type: string - type: 'null' title: Ref Id preset_id: anyOf: - type: integer - type: 'null' title: Preset Id is_optional: anyOf: - type: boolean - type: 'null' title: Is Optional title: WorkorderActivityCreateInput type: object WorkorderActivityCount: additionalProperties: false description: Workorder activity count. properties: workorder_id: title: Workorder Id type: integer count: title: Count type: integer required: - workorder_id - count title: WorkorderActivityCount type: object WorkorderStatusChange: additionalProperties: false description: Dispatch workorder status change log. properties: id: title: Id type: integer workorder: anyOf: - type: integer - type: 'null' title: Workorder old_status: anyOf: - type: string - type: 'null' title: Old Status change_reason: anyOf: - type: string - type: 'null' title: Change Reason change_note: anyOf: - type: string - type: 'null' title: Change Note new_status: anyOf: - type: string - type: 'null' title: New Status created_at: anyOf: - format: date-time type: string - type: 'null' title: Created At created_by: anyOf: - type: integer - type: 'null' title: Created By required: - id title: WorkorderStatusChange type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object WorkorderInput: additionalProperties: false description: Payload for creating/updating workorders. properties: service_order: anyOf: - type: integer - type: 'null' title: Service Order service_order_line: anyOf: - type: integer - type: 'null' title: Service Order Line service_item: anyOf: - type: integer - type: 'null' title: Service Item project_id: anyOf: - type: integer - type: 'null' title: Project Id customer_id: anyOf: - type: integer - type: 'null' title: Customer Id name: anyOf: - type: string - type: 'null' title: Name description: anyOf: - type: string - type: 'null' title: Description status: anyOf: - type: string - type: 'null' title: Status planned_start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Planned Start Datetime planned_end_datetime: anyOf: - format: date-time type: string - type: 'null' title: Planned End Datetime windpark_id: anyOf: - type: integer - type: 'null' title: Windpark Id turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id is_internal: anyOf: - type: boolean - type: 'null' title: Is Internal is_rework: anyOf: - type: boolean - type: 'null' title: Is Rework status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason status_change_by: anyOf: - type: integer - type: 'null' title: Status Change By type: anyOf: - type: string - type: 'null' title: Type mandatory_start_date: anyOf: - format: date-time type: string - type: 'null' title: Mandatory Start Date mandatory_due_date: anyOf: - format: date-time type: string - type: 'null' title: Mandatory Due Date assignee_user_id: anyOf: - type: integer - type: 'null' title: Assignee User Id activities: anyOf: - items: $ref: '#/components/schemas/AdminWorkorderActivityInput' type: array - type: 'null' title: Activities title: WorkorderInput type: object WorkorderPlanInput: additionalProperties: false description: Payload for creating/updating workorder plans. properties: workorder: anyOf: - type: integer - type: 'null' title: Workorder workorder_activity_id: anyOf: - type: integer - type: 'null' title: Workorder Activity Id resource_type: anyOf: - type: string - type: 'null' title: Resource Type planned_start_at: anyOf: - format: date-time type: string - type: 'null' title: Planned Start At planned_end_at: anyOf: - format: date-time type: string - type: 'null' title: Planned End At actual_start_at: anyOf: - format: date-time type: string - type: 'null' title: Actual Start At actual_end_at: anyOf: - format: date-time type: string - type: 'null' title: Actual End At status: anyOf: - type: string - type: 'null' title: Status resources: anyOf: - items: {} type: array - type: 'null' title: Resources title: WorkorderPlanInput type: object WorkorderActivityBulkUpdateInput: additionalProperties: false description: Payload for bulk-updating workorder activities (and optionally delay teams). properties: activities: default: [] items: $ref: '#/components/schemas/WorkorderActivityBulkUpdateItem' title: Activities type: array delays: default: [] items: $ref: '#/components/schemas/DelayBulkTeamUpdateItem' title: Delays type: array resource_change_comment: anyOf: - type: string - type: 'null' title: Resource Change Comment preset_id: anyOf: - type: integer - type: 'null' title: Preset Id title: WorkorderActivityBulkUpdateInput type: object WorkorderActivityBulkUpdateItem: additionalProperties: false description: Single workorder activity patch item for bulk update. properties: workorder: anyOf: - type: integer - type: 'null' title: Workorder service_item: anyOf: - type: integer - type: 'null' title: Service Item service_item_activity_id: anyOf: - type: integer - type: 'null' title: Service Item Activity Id portal_service_activity_id: anyOf: - type: integer - type: 'null' title: Portal Service Activity Id start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Start Datetime end_datetime: anyOf: - format: date-time type: string - type: 'null' title: End Datetime resources: anyOf: - items: {} type: array - type: 'null' title: Resources robot_set_id: anyOf: - type: integer - type: 'null' title: Robot Set Id status: anyOf: - type: string - type: 'null' title: Status is_internal: anyOf: - type: boolean - type: 'null' title: Is Internal location_id: anyOf: - type: integer - type: 'null' title: Location Id turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id component_type_id: anyOf: - type: integer - type: 'null' title: Component Type Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id activity_description: anyOf: - type: string - type: 'null' title: Activity Description anomaly_id: anyOf: - type: integer - type: 'null' title: Anomaly Id status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason status_change_by: anyOf: - type: integer - type: 'null' title: Status Change By custom_fields: anyOf: - items: {} type: array - type: object - type: 'null' title: Custom Fields sort_order: anyOf: - type: integer - type: 'null' title: Sort Order comment: anyOf: - type: string - type: 'null' title: Comment ref_id: anyOf: - type: string - type: 'null' title: Ref Id preset_id: anyOf: - type: integer - type: 'null' title: Preset Id activity_id: title: Activity Id type: integer required: - activity_id title: WorkorderActivityBulkUpdateItem type: object WorkorderActivityTimeEdit: additionalProperties: false description: Audit row for a start/end datetime change on a workorder activity. properties: id: title: Id type: integer workorder_activity_id: title: Workorder Activity Id type: integer old_start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Old Start Datetime new_start_datetime: anyOf: - format: date-time type: string - type: 'null' title: New Start Datetime old_end_datetime: anyOf: - format: date-time type: string - type: 'null' title: Old End Datetime new_end_datetime: anyOf: - format: date-time type: string - type: 'null' title: New End Datetime reason_code: anyOf: - type: string - type: 'null' title: Reason Code reason_name: anyOf: - type: string - type: 'null' title: Reason Name comment: anyOf: - type: string - type: 'null' title: Comment source: title: Source type: string edited_at: format: date-time title: Edited At type: string edited_by: anyOf: - type: string - type: 'null' title: Edited By required: - id - workorder_activity_id - source - edited_at title: WorkorderActivityTimeEdit type: object WorkorderActivityCountsResponse: additionalProperties: false description: Workorder activity counts response. properties: results: items: $ref: '#/components/schemas/WorkorderActivityCount' title: Results type: array required: - results title: WorkorderActivityCountsResponse type: object WorkorderSummary: additionalProperties: false description: Workorder summary response. properties: total: title: Total type: integer by_status: items: type: object title: By Status type: array by_type: items: type: object title: By Type type: array required: - total - by_status - by_type title: WorkorderSummary type: object WorkorderPlan: additionalProperties: false description: Dispatch workorder plan. properties: plan_id: title: Plan Id type: integer workorder: title: Workorder type: integer workorder_activity_id: anyOf: - type: integer - type: 'null' title: Workorder Activity Id resource_type: title: Resource Type type: string planned_start_at: format: date-time title: Planned Start At type: string planned_end_at: format: date-time title: Planned End At type: string actual_start_at: anyOf: - format: date-time type: string - type: 'null' title: Actual Start At actual_end_at: anyOf: - format: date-time type: string - type: 'null' title: Actual End At status: title: Status type: string created_at: anyOf: - format: date-time type: string - type: 'null' title: Created At updated_at: anyOf: - format: date-time type: string - type: 'null' title: Updated At resources: anyOf: - items: {} type: array - type: 'null' title: Resources required: - plan_id - workorder - resource_type - planned_start_at - planned_end_at - status title: WorkorderPlan type: object WorkorderActivity: additionalProperties: false description: Dispatch workorder activity. properties: id: title: Id type: integer workorder: anyOf: - type: integer - type: 'null' title: Workorder service_item: anyOf: - type: integer - type: 'null' title: Service Item service_item_activity_id: anyOf: - type: integer - type: 'null' title: Service Item Activity Id portal_service_activity_id: anyOf: - type: integer - type: 'null' title: Portal Service Activity Id start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Start Datetime end_datetime: anyOf: - format: date-time type: string - type: 'null' title: End Datetime resources: anyOf: - items: {} type: array - type: 'null' title: Resources team_lead_resource_ids: default: [] items: type: integer title: Team Lead Resource Ids type: array robot_set_id: anyOf: - type: integer - type: 'null' title: Robot Set Id status: anyOf: - type: string - type: 'null' title: Status is_internal: anyOf: - type: boolean - type: 'null' title: Is Internal location_id: anyOf: - type: integer - type: 'null' title: Location Id turbine_id: anyOf: - type: integer - type: 'null' title: Turbine Id component_type_id: anyOf: - type: integer - type: 'null' title: Component Type Id turbine_component_id: anyOf: - type: integer - type: 'null' title: Turbine Component Id activity_description: anyOf: - type: string - type: 'null' title: Activity Description anomaly_id: anyOf: - type: integer - type: 'null' title: Anomaly Id status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason status_change_by: anyOf: - type: integer - type: 'null' title: Status Change By custom_fields: anyOf: - items: {} type: array - type: object - type: 'null' title: Custom Fields sort_order: anyOf: - type: integer - type: 'null' title: Sort Order is_optional: anyOf: - type: boolean - type: 'null' title: Is Optional estimated_duration: anyOf: - type: integer - type: 'null' title: Estimated Duration required: - id title: WorkorderActivity type: object AdminWorkorderActivityInput: additionalProperties: false description: Input for admin workorder activities (simplified). properties: id: anyOf: - type: integer - type: 'null' title: Id activity_description: title: Activity Description type: string start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Start Datetime end_datetime: anyOf: - format: date-time type: string - type: 'null' title: End Datetime preset_id: anyOf: - type: integer - type: 'null' title: Preset Id team: anyOf: - type: integer - type: 'null' title: Team required: - activity_description title: AdminWorkorderActivityInput type: object WorkTimeLogInput: additionalProperties: false description: Payload for creating/updating work time logs. properties: workorder_id: anyOf: - type: integer - type: 'null' title: Workorder Id activity_id: anyOf: - type: integer - type: 'null' title: Activity Id resource: anyOf: - type: integer - type: 'null' title: Resource started_at: anyOf: - format: date-time type: string - type: 'null' title: Started At ended_at: anyOf: - format: date-time type: string - type: 'null' title: Ended At duration_min: anyOf: - type: integer - type: 'null' title: Duration Min comment: anyOf: - type: string - type: 'null' title: Comment timezone_id: anyOf: - type: integer - type: 'null' title: Timezone Id project_id: anyOf: - type: integer - type: 'null' title: Project Id activity_start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Activity Start Datetime activity_end_datetime: anyOf: - format: date-time type: string - type: 'null' title: Activity End Datetime custom_fields: anyOf: - type: object - items: {} type: array - type: 'null' title: Custom Fields created_by: anyOf: - type: integer - type: 'null' title: Created By corrected_entry_id: anyOf: - type: integer - type: 'null' title: Corrected Entry Id work_time_category_id: anyOf: - type: integer - type: 'null' title: Work Time Category Id status: anyOf: - type: string - type: 'null' title: Status status_changed_by: anyOf: - type: integer - type: 'null' title: Status Changed By status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason robot_set_id: anyOf: - type: integer - type: 'null' title: Robot Set Id pay_type: anyOf: - type: string - type: 'null' title: Pay Type approved_by: anyOf: - type: integer - type: 'null' title: Approved By approved_at: anyOf: - format: date-time type: string - type: 'null' title: Approved At approver_comment: anyOf: - type: string - type: 'null' title: Approver Comment is_approved: anyOf: - type: boolean - type: 'null' title: Is Approved service_order_line_id: anyOf: - type: integer - type: 'null' title: Service Order Line Id title: WorkTimeLogInput type: object DelayBulkTeamUpdateItem: additionalProperties: false description: Single delay team update item for bulk update. properties: delay_id: title: Delay Id type: integer team_resources: anyOf: - items: {} type: array - type: 'null' title: Team Resources team_robot_set_id: anyOf: - type: integer - type: 'null' title: Team Robot Set Id required: - delay_id title: DelayBulkTeamUpdateItem type: object WorkorderBulkInput: additionalProperties: false description: Payload for bulk-creating workorders. properties: workorders: items: $ref: '#/components/schemas/WorkorderInput' title: Workorders type: array required: - workorders title: WorkorderBulkInput type: object WorkTimeLog: additionalProperties: false description: Dispatch work time log. properties: id: title: Id type: integer workorder_id: anyOf: - type: integer - type: 'null' title: Workorder Id activity_id: anyOf: - type: integer - type: 'null' title: Activity Id resource: anyOf: - type: integer - type: 'null' title: Resource started_at: anyOf: - format: date-time type: string - type: 'null' title: Started At ended_at: anyOf: - format: date-time type: string - type: 'null' title: Ended At duration_min: anyOf: - type: integer - type: 'null' title: Duration Min comment: anyOf: - type: string - type: 'null' title: Comment timezone_id: anyOf: - type: integer - type: 'null' title: Timezone Id project_id: anyOf: - type: integer - type: 'null' title: Project Id activity_start_datetime: anyOf: - format: date-time type: string - type: 'null' title: Activity Start Datetime activity_end_datetime: anyOf: - format: date-time type: string - type: 'null' title: Activity End Datetime custom_fields: anyOf: - type: object - items: {} type: array - type: 'null' title: Custom Fields created_at: anyOf: - format: date-time type: string - type: 'null' title: Created At created_by: anyOf: - type: integer - type: 'null' title: Created By corrected_entry_id: anyOf: - type: integer - type: 'null' title: Corrected Entry Id work_time_category_id: anyOf: - type: integer - type: 'null' title: Work Time Category Id status: anyOf: - type: string - type: 'null' title: Status status_changed_by: anyOf: - type: integer - type: 'null' title: Status Changed By status_change_reason: anyOf: - type: string - type: 'null' title: Status Change Reason robot_set_id: anyOf: - type: integer - type: 'null' title: Robot Set Id pay_type: anyOf: - type: string - type: 'null' title: Pay Type approved_by: anyOf: - type: integer - type: 'null' title: Approved By approved_at: anyOf: - format: date-time type: string - type: 'null' title: Approved At approver_comment: anyOf: - type: string - type: 'null' title: Approver Comment is_approved: anyOf: - type: boolean - type: 'null' title: Is Approved service_order_line_id: anyOf: - type: integer - type: 'null' title: Service Order Line Id required: - id title: WorkTimeLog type: object WorkorderCancelInput: additionalProperties: false description: Payload for cancelling a workorder. properties: reason: title: Reason type: string required: - reason title: WorkorderCancelInput type: object securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer