openapi: 3.1.0 info: title: API Key accounts workOrders API version: 1.0.0 servers: - url: https://api.coperniq.io/v1 description: Production server tags: - name: workOrders paths: /work-orders: get: operationId: list-work-orders summary: List Work Orders description: 'Retrieve a paginated list of work orders across all projects. Supports: - Pagination (`page_size`, `page`) - Date filtering (`updated_after`, `updated_before`) - Sorting (`order_by`) ' tags: - workOrders parameters: - name: page_size in: query description: Number of items per page (max 100) required: false schema: type: integer default: 20 - name: page in: query description: Page number (1-based) required: false schema: type: integer default: 1 - name: updated_after in: query description: Filter items updated after this timestamp (ISO 8601) required: false schema: type: string format: date-time - name: updated_before in: query description: Filter items updated before this timestamp (ISO 8601) required: false schema: type: string format: date-time - name: order_by in: query description: Sort order for results required: false schema: $ref: '#/components/schemas/WorkOrdersGetParametersOrderBy' - name: x-api-key in: header required: true schema: type: string responses: '200': description: List of work orders content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkOrder' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/ListWorkOrdersRequestUnauthorizedError' /projects/{projectId}/work-orders: get: operationId: list-project-work-orders summary: List Project Work Orders description: 'Retrieve work orders for a specific project. Supports: - Pagination (`page_size`, `page`) - Date filtering (`updated_after`, `updated_before`) - Sorting (`order_by`) ' tags: - workOrders parameters: - name: projectId in: path description: Project identifier required: true schema: type: integer - name: page_size in: query description: Number of items per page (max 100) required: false schema: type: integer default: 20 - name: page in: query description: Page number (1-based) required: false schema: type: integer default: 1 - name: updated_after in: query description: Filter items updated after this timestamp (ISO 8601) required: false schema: type: string format: date-time - name: updated_before in: query description: Filter items updated before this timestamp (ISO 8601) required: false schema: type: string format: date-time - name: order_by in: query description: Sort order for results required: false schema: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersGetParametersOrderBy' - name: x-api-key in: header required: true schema: type: string responses: '200': description: List of work orders content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkOrder' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/ListProjectWorkOrdersRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/ListProjectWorkOrdersRequestNotFoundError' post: operationId: create-project-work-order summary: Create Project Work Order description: 'Create a new work order in a project. Notes: - `templateId` is required. - `phaseInstanceId` is optional; if provided the referenced phase must be started (active) for creation to succeed. ' tags: - workOrders parameters: - name: projectId in: path description: Project identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '201': description: Work order created successfully content: application/json: schema: $ref: '#/components/schemas/WorkOrderCreateResponse' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/CreateProjectWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/CreateProjectWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/CreateProjectWorkOrderRequestNotFoundError' requestBody: content: application/json: schema: type: object properties: templateId: type: integer description: Template to use for the work order phaseInstanceId: type: integer description: Optional. Phase instance id where the work order will be created (phase must be started). You can gather phase instance ids from the get project endpoint. required: - templateId /opportunities/{opportunityId}/work-orders: get: operationId: list-opportunity-work-orders summary: List Opportunity Work Orders description: 'Retrieve work orders for a specific opportunity **Note:** The `/requests` path is an alias for `/opportunities` and will continue to work until users are individually notified and migrated. ' tags: - workOrders parameters: - name: opportunityId in: path description: Opportunity identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: List of work orders content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkOrder' post: operationId: create-opportunity-work-order summary: Create Opportunity Work Order description: 'Create a new work order for an opportunity. Notes: - `templateId` is required. - `phaseInstanceId` is optional. The phase does not need to be started to create an opportunity work order. **Note:** The `/requests` path is an alias for `/opportunities` and will continue to work until users are individually notified and migrated. ' tags: - workOrders parameters: - name: opportunityId in: path description: Opportunity identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '201': description: Work order created successfully content: application/json: schema: $ref: '#/components/schemas/WorkOrderCreateResponse' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/CreateOpportunityWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/CreateOpportunityWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/CreateOpportunityWorkOrderRequestNotFoundError' requestBody: content: application/json: schema: type: object properties: templateId: type: integer description: The ID of the work order template to use phaseInstanceId: type: integer description: Optional. The ID of the phase instance to use. If provided, the phase does not need to be started to create an opportunity work order. You can gather phase instance ids from the get opportunity endpoint. required: - templateId /accounts/{accountId}/work-orders: get: operationId: list-account-work-orders summary: List Account Work Orders description: 'Retrieve work orders for a specific account **Note:** The `/clients` path is an alias for `/accounts` and will continue to work until users are individually notified and migrated. ' tags: - workOrders parameters: - name: accountId in: path description: Account identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: List of work orders content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkOrder' post: operationId: create-account-work-order summary: Create Account Work Order description: 'Create a new work order for an account (no phases) **Note:** The `/clients` path is an alias for `/accounts` and will continue to work until users are individually notified and migrated. ' tags: - workOrders parameters: - name: accountId in: path description: Account identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '201': description: Work order created successfully content: application/json: schema: $ref: '#/components/schemas/WorkOrderCreateResponse' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/CreateAccountWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/CreateAccountWorkOrderRequestUnauthorizedError' requestBody: content: application/json: schema: type: object properties: templateId: type: integer required: - templateId /work-orders/{workOrderId}: get: operationId: get-work-order summary: Get Work Order description: 'Retrieve a specific work order by ID. The `lineItems` property is returned **only** for service work orders on an **account** (parent project type `ACCOUNT`), and **only** when at least one line item exists. Otherwise the field is omitted from the JSON object. ' tags: - workOrders parameters: - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Work order details content: application/json: schema: $ref: '#/components/schemas/WorkOrder' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/GetWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/GetWorkOrderRequestNotFoundError' /work-orders/templates: get: operationId: list-work-order-templates summary: List Work Order Templates description: Retrieve available work order templates. Returns all templates (not paginated). tags: - workOrders parameters: - name: x-api-key in: header required: true schema: type: string responses: '200': description: List of work order templates content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkOrderTemplate' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/ListWorkOrderTemplatesRequestUnauthorizedError' /projects/{projectId}/work-orders/{workOrderId}: patch: operationId: update-project-work-order summary: Update Project Work Order description: "Update a project's work order. Supports partial updates.\n\nUpdatable fields:\n- title, description, priority\n- startDate, endDate, startDateAllDay, endDateAllDay\n- status (label string)\n- assigneeId\n- visits: Only applicable on field work orders. When provided, the `visits` array REPLACES the full set of visits for the work order. Include all existing visits you wish to keep or update (with their `id`), and include new visits without an `id`. Any existing visit not included in the request will be removed. Visit booleans default to false when omitted.\n- checklist: Update the checklist for the work order.\n When this field is provided, the `checklist` array REPLACES the full set of checklist items on the work order.\n - Include every existing item you want to keep or modify (identified by `id`). \n - Any existing item NOT included in this array will be removed.\n - Each item MUST include an `id`. Items without an `id` are ignored (checklist item creation is not supported).\n" tags: - workOrders parameters: - name: projectId in: path description: Project identifier required: true schema: type: integer - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Work order updated successfully content: application/json: schema: $ref: '#/components/schemas/WorkOrder' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/UpdateProjectWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/UpdateProjectWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/UpdateProjectWorkOrderRequestNotFoundError' requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkOrderUpdate' delete: operationId: delete-project-work-order summary: Delete Project Work Order description: Delete a specific work order from a project tags: - workOrders parameters: - name: projectId in: path description: Project identifier required: true schema: type: integer - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Successful response '400': description: Invalid request (missing or invalid parameters) content: application/json: schema: $ref: '#/components/schemas/DeleteProjectWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/DeleteProjectWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/DeleteProjectWorkOrderRequestNotFoundError' /opportunities/{opportunityId}/work-orders/{workOrderId}: patch: operationId: update-opportunity-work-order summary: Update Opportunity Work Order description: "Update an opportunity's work order. Supports partial updates.\n\n**Note:** The `/requests` path is an alias for `/opportunities` and will continue to work until users are individually notified and migrated.\n\nUpdatable fields:\n- title, description, priority\n- startDate, endDate, startDateAllDay, endDateAllDay\n- status (label string)\n- assigneeId\n- visits: Only applicable on field work orders. When provided, the `visits` array REPLACES the full set of visits for the work order. Include all existing visits you wish to keep or update (with their `id`), and include new visits without an `id`. Any existing visit not included in the request will be removed. Visit booleans default to false when omitted.\n- checklist: Update the checklist for the work order.\n When this field is provided, the `checklist` array REPLACES the full set of checklist items on the work order.\n - Include every existing item you want to keep or modify (identified by `id`). \n - Any existing item NOT included in this array will be removed.\n - Each item MUST include an `id`. Items without an `id` are ignored (checklist item creation is not supported).\n" tags: - workOrders parameters: - name: opportunityId in: path description: Opportunity identifier required: true schema: type: integer - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Work order updated successfully content: application/json: schema: $ref: '#/components/schemas/WorkOrder' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/UpdateOpportunityWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/UpdateOpportunityWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/UpdateOpportunityWorkOrderRequestNotFoundError' requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkOrderUpdate' delete: operationId: delete-opportunity-work-order summary: Delete Opportunity Work Order description: 'Delete an opportunity''s work order by ID **Note:** The `/requests` path is an alias for `/opportunities` and will continue to work until users are individually notified and migrated. ' tags: - workOrders parameters: - name: opportunityId in: path description: Opportunity identifier required: true schema: type: integer - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Successful response '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/DeleteOpportunityWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/DeleteOpportunityWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/DeleteOpportunityWorkOrderRequestNotFoundError' /accounts/{accountId}/work-orders/{workOrderId}: patch: operationId: update-account-work-order summary: Update Account Work Order description: "Update an account's work order. Supports partial updates.\n\n**Note:** The `/clients` path is an alias for `/accounts` and will continue to work until users are individually notified and migrated.\n\nUpdatable fields:\n- title, description, priority\n- startDate, endDate, startDateAllDay, endDateAllDay\n- status (label string)\n- assigneeId\n- visits: Only applicable on field work orders. When provided, the `visits` array REPLACES the full set of visits for the work order. Include all existing visits you wish to keep or update (with their `id`), and include new visits without an `id`. Any existing visit not included in the request will be removed. Visit booleans default to false when omitted.\n- checklist: Update the checklist for the work order.\n When this field is provided, the `checklist` array REPLACES the full set of checklist items on the work order.\n - Include every existing item you want to keep or modify (identified by `id`). \n - Any existing item NOT included in this array will be removed.\n - Each item MUST include an `id`. Items without an `id` are ignored (checklist item creation is not supported).\n\n**Line items** are not updated here. For account (service) work orders, replace quote line items with **`PUT /work-orders/{workOrderId}/line-items`** (see **Line Items** in this reference).\n" tags: - workOrders parameters: - name: accountId in: path description: Account identifier required: true schema: type: integer - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Work order updated successfully content: application/json: schema: $ref: '#/components/schemas/WorkOrder' '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/UpdateAccountWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/UpdateAccountWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/UpdateAccountWorkOrderRequestNotFoundError' requestBody: content: application/json: schema: $ref: '#/components/schemas/WorkOrderUpdate' delete: operationId: delete-account-work-order summary: Delete Account Work Order description: 'Delete a specific work order for an account **Note:** The `/clients` path is an alias for `/accounts` and will continue to work until users are individually notified and migrated. ' tags: - workOrders parameters: - name: accountId in: path description: Account identifier required: true schema: type: integer - name: workOrderId in: path description: Work order identifier required: true schema: type: integer - name: x-api-key in: header required: true schema: type: string responses: '200': description: Successful response '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/DeleteAccountWorkOrderRequestBadRequestError' '401': description: Authentication failed content: application/json: schema: $ref: '#/components/schemas/DeleteAccountWorkOrderRequestUnauthorizedError' '404': description: Resource not found content: application/json: schema: $ref: '#/components/schemas/DeleteAccountWorkOrderRequestNotFoundError' components: schemas: WorkOrderVisits: type: object properties: visits: type: array items: $ref: '#/components/schemas/Visit' description: List of visits description: Site visits associated with the work order (legacy shape) title: WorkOrderVisits WorkOrderTemplate: type: object properties: id: type: integer description: Template identifier createdAt: type: - string - 'null' format: date-time updatedAt: type: - string - 'null' format: date-time title: type: - string - 'null' description: Template title description: type: - string - 'null' description: Template description instructions: type: - string - 'null' description: Template instructions (same text as description) type: type: - string - 'null' description: Work order type (e.g. FIELD, OFFICE) priority: type: - integer - 'null' dueDate: type: - string - 'null' description: Deadline for work orders created from this template yellowSla: type: - integer - 'null' description: Yellow SLA threshold (days) redSla: type: - integer - 'null' description: Red SLA threshold (days) assignee: oneOf: - $ref: '#/components/schemas/TemplateUser' - type: 'null' assigneeProperty: type: - string - 'null' description: Set when the assignee is a role rather than a specific user (e.g. SALES_REP, PROJECT_MANAGER). collaborators: type: array items: $ref: '#/components/schemas/TemplateUser' collaboratorProperties: type: array items: type: string description: Role-based collaborators (e.g. SALES_REP, PROJECT_MANAGER) as property keys. labels: type: array items: $ref: '#/components/schemas/WorkOrderTemplateLabelsItems' checklists: type: array items: $ref: '#/components/schemas/WorkOrderTemplateChecklistsItems' lineItems: type: array items: $ref: '#/components/schemas/WorkOrderTemplateLineItemsItems' description: Present only when the template has line items. title: WorkOrderTemplate UpdateAccountWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' title: UpdateAccountWorkOrderRequestUnauthorizedError WorkOrderTemplateLabelsItems: type: object properties: label: $ref: '#/components/schemas/WorkOrderTemplateLabelsItemsLabel' title: WorkOrderTemplateLabelsItems TemplateUser: type: object properties: id: type: integer firstName: type: - string - 'null' lastName: type: - string - 'null' description: A user reference reduced to non-sensitive identity fields. title: TemplateUser WorkOrderTemplateChecklistsItems: type: object properties: id: type: integer detail: type: - string - 'null' title: WorkOrderTemplateChecklistsItems ChecklistItemUpdate: type: object properties: id: type: integer description: Checklist item identifier to update (required). detail: type: string description: New detail text. isCompleted: type: boolean description: Completion flag. required: - id description: Checklist item update payload. Only fields provided are updated. title: ChecklistItemUpdate CreateProjectWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' title: CreateProjectWorkOrderRequestNotFoundError WorkOrderFormItemType: type: string enum: - FORM title: WorkOrderFormItemType VisitUpsert: type: object properties: id: type: integer description: Include to update an existing visit; omit to create new. When `visits` is sent, any existing visit not included will be deleted. description: type: string startDate: type: string format: date-time endDate: type: string format: date-time startDateAllDay: type: boolean default: false endDateAllDay: type: boolean default: false isCompleted: type: boolean description: Shape used to create or update visits in work order PATCH requests. title: VisitUpsert ProjectsProjectIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: ProjectsProjectIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode DeleteProjectWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' title: DeleteProjectWorkOrderRequestUnauthorizedError ProjectsProjectIdWorkOrdersGetParametersOrderBy: type: string enum: - asc - desc default: asc title: ProjectsProjectIdWorkOrdersGetParametersOrderBy CreateAccountWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: CreateAccountWorkOrderRequestBadRequestError UpdateProjectWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' title: UpdateProjectWorkOrderRequestUnauthorizedError ProjectsProjectIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: ProjectsProjectIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode TradeGroup: type: string enum: - ENERGY - MECHANICAL - ELECTRICAL - PLUMBING - LOW_VOLTAGE - ENVELOPE - OTHER description: High-level trade group for catalog items. title: TradeGroup GetWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/WorkOrdersWorkOrderIdGetResponsesContentApplicationJsonSchemaCode' title: GetWorkOrderRequestUnauthorizedError DeleteOpportunityWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' title: DeleteOpportunityWorkOrderRequestNotFoundError WorkOrderLineItemCatalogItem: type: object properties: id: type: integer name: type: string sku: type: - string - 'null' type: type: - string - 'null' manufacturer: type: - string - 'null' title: WorkOrderLineItemCatalogItem CreateAccountWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' title: CreateAccountWorkOrderRequestUnauthorizedError UpdateOpportunityWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: UpdateOpportunityWorkOrderRequestBadRequestError WorkOrdersTemplatesGetResponsesContentApplicationJsonSchemaCode: type: string enum: - UNAUTHORIZED title: WorkOrdersTemplatesGetResponsesContentApplicationJsonSchemaCode WorkOrderProject: type: object properties: id: type: integer description: Project identifier uid: type: integer description: Project number title: type: string description: Project title address: type: array items: type: string description: Project address stage: type: - string - 'null' description: Project stage (if available) description: Project associated with the work order title: WorkOrderProject CreateOpportunityWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' title: CreateOpportunityWorkOrderRequestUnauthorizedError ListProjectWorkOrdersRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersGetResponsesContentApplicationJsonSchemaCode' title: ListProjectWorkOrdersRequestNotFoundError DeleteAccountWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' title: DeleteAccountWorkOrderRequestUnauthorizedError UpdateOpportunityWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' title: UpdateOpportunityWorkOrderRequestNotFoundError UpdateAccountWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' title: UpdateAccountWorkOrderRequestNotFoundError AccountsAccountIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: AccountsAccountIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode UpdateProjectWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: UpdateProjectWorkOrderRequestBadRequestError OpportunitiesOpportunityIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: OpportunitiesOpportunityIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode WorkOrderTemplateLabelsItemsLabel: type: object properties: id: type: - integer - 'null' label: type: - string - 'null' color: type: - string - 'null' title: WorkOrderTemplateLabelsItemsLabel OpportunitiesOpportunityIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: OpportunitiesOpportunityIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode DeleteAccountWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: DeleteAccountWorkOrderRequestBadRequestError UpdateProjectWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' title: UpdateProjectWorkOrderRequestNotFoundError UpdateAccountWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: UpdateAccountWorkOrderRequestBadRequestError Visit: type: object properties: id: type: integer description: Visit identifier description: type: - string - 'null' startDate: type: - string - 'null' format: date-time endDate: type: - string - 'null' format: date-time startDateAllDay: type: boolean default: false endDateAllDay: type: boolean default: false isCompleted: type: boolean description: Only applicable on field work orders. title: Visit WorkOrdersGetParametersOrderBy: type: string enum: - asc - desc default: asc title: WorkOrdersGetParametersOrderBy DeleteOpportunityWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: DeleteOpportunityWorkOrderRequestBadRequestError CatalogItem: type: object properties: id: type: integer description: Catalog item identifier name: type: string description: Catalog item name catalog: oneOf: - $ref: '#/components/schemas/TradeGroup' - type: 'null' description: High-level trade group for this item. type: $ref: '#/components/schemas/CatalogItemType' description: Catalog item type category: $ref: '#/components/schemas/CatalogCategoryCode' description: Catalog item category code (ProductCategory or ServiceCategory) manufacturer: type: - string - 'null' description: Catalog item manufacturer sku: type: - string - 'null' description: Catalog item SKU code: type: - string - 'null' description: Catalog item code cost: type: - number - 'null' format: double description: Catalog item cost price: type: - number - 'null' format: double description: Catalog item price description: type: - string - 'null' description: Catalog item description image: oneOf: - $ref: '#/components/schemas/CatalogItemImage' - type: 'null' isArchived: type: - boolean - 'null' description: Whether the catalog item is archived createdById: type: integer description: Identifier of the user who created the catalog item createdAt: type: - string - 'null' format: date-time updatedAt: type: - string - 'null' format: date-time preferredVendorId: type: - integer - 'null' description: ID of the preferred vendor (must be an existing active vendor for this company) required: - id - name - catalog - type - category - cost - price title: CatalogItem WorkOrderAssignee: type: object properties: id: type: integer description: User identifier firstName: type: string description: User's first name lastName: type: string description: User's last name email: type: string description: User's email address description: User assigned to the work order title: WorkOrderAssignee WorkOrdersGetResponsesContentApplicationJsonSchemaCode: type: string enum: - UNAUTHORIZED title: WorkOrdersGetResponsesContentApplicationJsonSchemaCode GetWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/WorkOrdersWorkOrderIdGetResponsesContentApplicationJsonSchemaCode' title: GetWorkOrderRequestNotFoundError ListWorkOrderTemplatesRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/WorkOrdersTemplatesGetResponsesContentApplicationJsonSchemaCode' title: ListWorkOrderTemplatesRequestUnauthorizedError AccountsAccountIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode: type: string enum: - UNAUTHORIZED title: AccountsAccountIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode WorkOrdersWorkOrderIdGetResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: WorkOrdersWorkOrderIdGetResponsesContentApplicationJsonSchemaCode ChecklistItem: type: object properties: id: type: integer description: Checklist item identifier detail: type: string description: Checklist task detail isCompleted: type: boolean description: Whether the checklist item is completed completedAt: type: - string - 'null' format: date-time description: Completion timestamp, if completed title: ChecklistItem WorkOrderStatusesItems: type: object properties: count: type: string description: Number of times this status was entered endedAt: type: string format: date-time description: When the status ended spentTime: type: number format: double description: Time spent in this status in seconds startedAt: type: string format: date-time description: When the status started status: type: string description: Status identifier title: WorkOrderStatusesItems CreateProjectWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' title: CreateProjectWorkOrderRequestUnauthorizedError WorkOrderStatus: type: object properties: id: type: - string - 'null' description: Status identifier label: type: - string - 'null' description: Human readable status label description: Current status of the work order title: WorkOrderStatus WorkOrderUpdate: type: object properties: title: type: string description: type: string priority: type: integer startDate: type: string format: date-time startDateAllDay: type: boolean endDate: type: string format: date-time endDateAllDay: type: boolean status: type: string description: Status label assigneeId: type: integer description: User identifier to assign to the work order collaborators: type: array items: type: integer description: User identifiers to assign as collaborators to the work order visits: type: array items: $ref: '#/components/schemas/VisitUpsert' description: Only applicable on field work orders. When provided, the `visits` array REPLACES the full set of visits for the work order. Include all existing visits you wish to keep or update (with their `id`), and include new visits without an `id`. Any existing visit not included in the request will be removed. Visit booleans default to false when omitted. checklist: type: array items: $ref: '#/components/schemas/ChecklistItemUpdate' description: "Update the checklist for the work order.\nWhen this field is provided, the `checklist` array REPLACES the full set of checklist items on the work order.\n- Include every existing item you want to keep or modify (identified by `id`). \n- Any existing item NOT included in this array will be removed.\n- Each item MUST include an `id`. Items without an `id` are ignored (checklist item creation is not supported).\n" description: Payload for updating a work order. Supports partial updates. title: WorkOrderUpdate WorkOrderLabelsItemsLabel: type: object properties: id: type: integer description: Label identifier label: type: string description: Label name color: type: string description: Label color (hex code) title: WorkOrderLabelsItemsLabel ServiceCategory: type: string enum: - ADJUSTMENT - BALANCING - CALIBRATION - CLEANING - COMMISSIONING - DECOMMISSIONING - DIAGNOSTICS - ENGINEERING - EQUIPMENT_RENTAL - INSPECTION - INSTALLATION - MAINTENANCE - MONITORING - OPTIMIZATION - PERMITTING - RELOCATION - REMOVAL - REPAIR - REPLACEMENT - RETROFIT - SITE_SURVEY - TESTING - TRAINING - OTHER description: Service catalog category. title: ServiceCategory WorkOrderFileRequestItemType: type: string enum: - FILE_REQUEST title: WorkOrderFileRequestItemType CatalogItemImage: type: object properties: id: type: integer name: type: string url: type: string description: URL to download the image title: CatalogItemImage AccountsAccountIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: AccountsAccountIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode WorkOrderLabelsItems: type: object properties: label: $ref: '#/components/schemas/WorkOrderLabelsItemsLabel' title: WorkOrderLabelsItems DeleteAccountWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/AccountsAccountIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' title: DeleteAccountWorkOrderRequestNotFoundError ProjectsProjectIdWorkOrdersGetResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: ProjectsProjectIdWorkOrdersGetResponsesContentApplicationJsonSchemaCode CatalogItemType: type: string enum: - PRODUCT - SERVICE description: Catalog item type title: CatalogItemType DeleteProjectWorkOrderRequestBadRequestError: type: object properties: message: type: string code: type: string title: DeleteProjectWorkOrderRequestBadRequestError DeleteProjectWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' title: DeleteProjectWorkOrderRequestNotFoundError UpdateOpportunityWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode' title: UpdateOpportunityWorkOrderRequestUnauthorizedError WorkOrder: type: object properties: id: type: integer description: Work order identifier uid: type: integer description: Unique work order number within the project templateId: type: integer description: Template identifier for the work order createdAt: type: string format: date-time description: Creation timestamp updatedAt: type: string format: date-time description: Last update timestamp title: type: string description: Work order title description: type: string description: Work order description priority: type: integer description: Priority level startDate: type: - string - 'null' format: date-time description: Scheduled start date startDateAllDay: type: boolean description: Whether the start date is an all-day event endDate: type: - string - 'null' format: date-time description: Scheduled end date endDateAllDay: type: boolean description: Whether the end date is an all-day event completedAt: type: - string - 'null' format: date-time description: Timestamp when the work order was completed isArchived: type: boolean description: Whether the work order is archived isCompleted: type: boolean description: Whether the work order is completed isField: type: boolean description: Whether the work order is a field task labels: type: array items: $ref: '#/components/schemas/WorkOrderLabelsItems' description: Labels associated with the work order project: $ref: '#/components/schemas/WorkOrderProject' description: Project associated with the work order assignee: oneOf: - $ref: '#/components/schemas/WorkOrderAssignee' - type: 'null' description: User assigned to the work order collaborators: type: array items: $ref: '#/components/schemas/UserSummary' description: Additional users collaborating on the work order visits: $ref: '#/components/schemas/WorkOrderVisits' description: Site visits associated with the work order (legacy shape) statuses: type: array items: $ref: '#/components/schemas/WorkOrderStatusesItems' description: History of status changes and time spent in each status status: oneOf: - $ref: '#/components/schemas/WorkOrderStatus' - type: 'null' description: Current status of the work order checklist: type: array items: $ref: '#/components/schemas/ChecklistItem' description: Checklist items for the work order workItems: type: array items: $ref: '#/components/schemas/WorkOrderWorkItem' description: Work items linked to this work order via Blueprint workflow. Includes forms (`FORM`) and file requests (`FILE_REQUEST`). Returns [] when none are linked. lineItems: type: array items: $ref: '#/components/schemas/WorkOrderLineItem' description: 'Present only for service work orders on an **account** (parent project type `ACCOUNT`), and only when at least one line item exists. Amounts are in dollars with cent precision. Replace via `PUT /work-orders/{workOrderId}/line-items`. Omitted from the response when not applicable or when there are no line items. ' title: WorkOrder ProjectsProjectIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: ProjectsProjectIdWorkOrdersWorkOrderIdPatchResponsesContentApplicationJsonSchemaCode ProductCategory: type: string enum: - BATTERY_SYSTEM - BATTERY_MANAGEMENT_SYSTEM - CHARGING_GATEWAY - COMBINER_BOX - EV_CHARGER - LOAD_CENTER - MICROINVERTER - MOUNTING - POWER_OPTIMIZER - PRODUCTION_METER - PV_INVERTER - PV_MODULE - RACKING - RAPID_SHUTDOWN_DEVICE - TRACKER - WEATHER_STATION - AIR_CONDITIONER - AIR_HANDLING_UNIT - BOILER - CHILLER - COOLING_TOWER - FAN - HEAT_EXCHANGER - HEAT_PUMP - MAKE_UP_AIR_UNIT - PUMP - ROOFTOP_UNIT - THERMOSTAT - VARIABLE_FREQUENCY_DRIVE - AUTOMATIC_TRANSFER_SWITCH - BREAKER - DISCONNECT_SWITCH - ELECTRIC_METER - GENERATOR - LIGHTING_PANEL - PANELBOARD - SWITCHGEAR - TRANSFORMER - UNINTERRUPTIBLE_POWER_SUPPLY - WIRE - BACKFLOW_PREVENTER - BOOSTER_PUMP - GREASE_INTERCEPTOR - STORAGE_TANK - SUMP_PUMP - VALVE - WATER_FILTRATION_SYSTEM - WATER_HEATER - WATER_SOFTENER - ACCESS_CONTROLLER - AUTOMATION_CONTROLLER - CAMERA - CARD_READER - DOOR_STRIKE - MAGLOCK - NETWORK_SWITCH - NETWORK_VIDEO_RECORDER - SENSOR - WIRELESS_ACCESS_POINT - ROOF_COVERING - ROOF_UNDERLAYMENT - ROOF_MEMBRANE - ROOF_FLASHING - ROOF_VENT - WALL_CLADDING - WALL_TRIM - WEATHER_BARRIER - WINDOW - EXTERIOR_DOOR - SKYLIGHT - OPENING_FLASHING - GUTTER - DOWNSPOUT - INSULATION - SEALANT - SHEATHING - OTHER description: Product catalog category. title: ProductCategory CreateProjectWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: CreateProjectWorkOrderRequestBadRequestError CreateOpportunityWorkOrderRequestNotFoundError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' title: CreateOpportunityWorkOrderRequestNotFoundError DeleteOpportunityWorkOrderRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode' title: DeleteOpportunityWorkOrderRequestUnauthorizedError ListProjectWorkOrdersRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/ProjectsProjectIdWorkOrdersGetResponsesContentApplicationJsonSchemaCode' title: ListProjectWorkOrdersRequestUnauthorizedError ListWorkOrdersRequestUnauthorizedError: type: object properties: message: type: string code: $ref: '#/components/schemas/WorkOrdersGetResponsesContentApplicationJsonSchemaCode' title: ListWorkOrdersRequestUnauthorizedError CreateOpportunityWorkOrderRequestBadRequestError: type: object properties: message: type: string code: $ref: '#/components/schemas/OpportunitiesOpportunityIdWorkOrdersPostResponsesContentApplicationJsonSchemaCode' field: type: string description: Field that caused the validation error (if applicable) title: CreateOpportunityWorkOrderRequestBadRequestError WorkOrderCreateResponse: type: object properties: id: type: integer description: Created workflow element (task) identifier createdAt: type: string format: date-time updatedAt: type: string format: date-time description: type: - string - 'null' position: type: integer description: Position within phase phaseInstanceId: type: integer projectId: type: integer createdById: type: integer title: WorkOrderCreateResponse WorkOrderLineItem: type: object properties: id: type: integer quantity: type: integer description: type: - string - 'null' unitCost: type: number format: double totalCost: type: - number - 'null' format: double unitPrice: type: number format: double totalPrice: type: - number - 'null' format: double sectionName: type: - string - 'null' catalogItem: oneOf: - $ref: '#/components/schemas/WorkOrderLineItemCatalogItem' - type: 'null' title: WorkOrderLineItem OpportunitiesOpportunityIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode: type: string enum: - NOT_FOUND title: OpportunitiesOpportunityIdWorkOrdersWorkOrderIdDeleteResponsesContentApplicationJsonSchemaCode UserSummary: type: object properties: id: type: integer firstName: type: - string - 'null' lastName: type: - string - 'null' email: type: - string - 'null' format: email avatarUrl: type: - string - 'null' description: Minimal user representation used in responses title: UserSummary WorkOrderTemplateLineItemsItems: type: object properties: id: type: integer quantity: type: number format: double description: type: - string - 'null' unitCost: type: number format: double totalCost: type: number format: double unitPrice: type: number format: double totalPrice: type: number format: double catalogItem: oneOf: - $ref: '#/components/schemas/CatalogItem' - type: 'null' description: The linked catalog item, in the same shape as GET /catalog-items/{catalogItemId}. title: WorkOrderTemplateLineItemsItems WorkOrderWorkItem: oneOf: - type: object properties: type: $ref: '#/components/schemas/WorkOrderFormItemType' id: type: integer description: Form instance ID name: type: - string - 'null' description: Form name templateId: type: - integer - 'null' description: Template the form was created from dueDate: type: - string - 'null' format: date-time description: Due date ISO string status: type: - string - 'null' description: Form status (e.g. OPEN, IN_PROGRESS, COMPLETED) isCompleted: type: boolean completedAt: type: - string - 'null' format: date-time required: - type - id description: A form work item linked to the work order via Blueprint workflow. - type: object properties: type: $ref: '#/components/schemas/WorkOrderFileRequestItemType' id: type: integer description: Action instance ID name: type: - string - 'null' description: File request title status: type: - string - 'null' description: Element instance status (e.g. OPEN, IN_PROGRESS, COMPLETED) required: - type - id description: A file request (document upload) work item linked to the work order via Blueprint workflow. discriminator: propertyName: type title: WorkOrderWorkItem CatalogCategoryCode: oneOf: - $ref: '#/components/schemas/ProductCategory' - $ref: '#/components/schemas/ServiceCategory' description: 'Catalog item category code. Must be: - one of `ProductCategory` when `type` is `PRODUCT`, or - one of `ServiceCategory` when `type` is `SERVICE`. ' title: CatalogCategoryCode securitySchemes: BasicAuth: type: http scheme: basic