> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oncanary.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read work-order parts and available operations



## OpenAPI

````yaml /openapi.yaml get /work-orders/{id}/parts
openapi: 3.1.0
info:
  title: Canary API
  version: '1.0'
  description: >
    Build integrations around Canary work orders, requests, equipment,
    inventory, meters,

    custom fields, and scannable identifiers.


    ## Authentication


    All API requests require authentication using an API key. Include your API
    key in the `Authorization` header:


    ```

    Authorization: Bearer sk_live_your_api_key_here

    ```


    ## Rate Limits


    - **Live keys**: 1,000 requests per minute

    - **Test keys**: 100 requests per minute


    Both key prefixes access the same organization data. The prefix selects the
    rate-limit bucket.


    Successful authenticated responses include rate limit headers:

    - `X-RateLimit-Limit`: Maximum requests per window

    - `X-RateLimit-Remaining`: Requests remaining in current window

    - `X-RateLimit-Reset`: Unix timestamp when the window resets


    ## Pagination


    Canary-native list endpoints use ID cursors and the standard `data`/`meta`
    envelope.

    MaintainX-compatible request endpoints use their compatibility response
    wrappers and

    encoded offset cursors. Follow each operation's response schema.


    Native list responses include:

    - `data`: Array of items

    - `meta.pagination.cursor`: Cursor for the next page (if `has_more` is true)

    - `meta.pagination.has_more`: Whether more items exist


    Use the cursor value in your next request: `?cursor=<cursor_value>`
servers:
  - url: https://api.oncanary.com/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local Development
security:
  - bearerAuth: []
tags:
  - name: Meters
    description: Meters track equipment usage and readings
  - name: Meter Readings
    description: Record and retrieve meter readings
  - name: Work Orders
    description: Maintenance work orders
  - name: Work Requests
    description: Requests that can be reviewed and converted into work orders
  - name: Work Request Portals
    description: Public request portal configuration
  - name: Assets
    description: Equipment and machinery
  - name: Locations
    description: Physical places where assets, parts, and meters are assigned
  - name: Parts
    description: Spare parts and inventory records
  - name: Identifiers
    description: Scannable identifiers for assets, locations, and parts
  - name: Custom Fields
    description: Typed custom-field definitions shared by maintenance resources
paths:
  /work-orders/{id}/parts:
    get:
      tags:
        - Work Orders
      summary: Read work-order parts and available operations
      operationId: getWorkOrderParts
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: >-
            Direct section object with effective quantities, costs when
            authorized, capabilities and aggregate version
          content:
            application/json:
              schema:
                type: object
                required:
                  - workOrderId
                  - partStatus
                  - partAvailability
                  - aggregateVersion
                  - items
                  - competingDemands
                  - capabilities
                  - historyOnly
                properties:
                  workOrderId:
                    type: string
                  partStatus:
                    $ref: '#/components/schemas/WorkOrderPartStatus'
                  partAvailability:
                    type: string
                    enum:
                      - available
                      - partial
                      - unavailable
                  aggregateVersion:
                    type: string
                    pattern: ^[0-9a-f]{64}$
                  items:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - partId
                        - locationId
                        - quantity
                        - quantityUsed
                        - part
                        - location
                        - inStockQuantity
                        - availableQuantity
                        - readiness
                        - issuedSnapshot
                        - linkable
                      properties:
                        id:
                          type: string
                        partId:
                          type: string
                        locationId:
                          type: string
                        quantity:
                          type: integer
                          minimum: 1
                        quantityUsed:
                          type:
                            - integer
                            - 'null'
                          minimum: 0
                        unitCost:
                          description: >-
                            Omitted when cost access is denied; null when no
                            cost is available.
                          anyOf:
                            - $ref: '#/components/schemas/PartMoney'
                            - type: 'null'
                        part:
                          type:
                            - object
                            - 'null'
                          required:
                            - id
                            - name
                            - partNumber
                            - imageUrl
                            - imageBlur
                            - archived
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            partNumber:
                              type:
                                - string
                                - 'null'
                            imageUrl:
                              type:
                                - string
                                - 'null'
                            imageBlur:
                              type:
                                - string
                                - 'null'
                            archived:
                              type: boolean
                        location:
                          type:
                            - object
                            - 'null'
                          required:
                            - id
                            - name
                            - area
                            - imageUrl
                            - imageBlur
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            area:
                              type:
                                - string
                                - 'null'
                            imageUrl:
                              type:
                                - string
                                - 'null'
                            imageBlur:
                              type:
                                - string
                                - 'null'
                        inStockQuantity:
                          type:
                            - integer
                            - 'null'
                        availableQuantity:
                          type:
                            - integer
                            - 'null'
                        readiness:
                          type: string
                          enum:
                            - available
                            - partial
                            - unavailable
                        linkable:
                          type: boolean
                        issuedSnapshot:
                          type:
                            - object
                            - 'null'
                          required:
                            - quantityUsed
                            - issuedAt
                            - partName
                            - partNumber
                            - locationName
                            - locationArea
                            - snapshotKind
                          properties:
                            quantityUsed:
                              type: integer
                              minimum: 0
                            issuedAt:
                              type: string
                              format: date-time
                            partName:
                              type: string
                            partNumber:
                              type:
                                - string
                                - 'null'
                            locationName:
                              type: string
                            locationArea:
                              type:
                                - string
                                - 'null'
                            snapshotKind:
                              type: string
                              enum:
                                - exact
                                - current_at_migration
                            unitCost:
                              description: Omitted when cost access is denied.
                              anyOf:
                                - $ref: '#/components/schemas/PartMoney'
                                - type: 'null'
                  competingDemands:
                    type: array
                    items:
                      type: object
                      required:
                        - workOrderId
                        - title
                        - partId
                        - locationId
                        - partStatus
                        - quantity
                      properties:
                        workOrderId:
                          type: string
                        title:
                          type: string
                        partId:
                          type: string
                        locationId:
                          type: string
                        partStatus:
                          type: string
                          enum:
                            - reserved
                            - kitted
                            - staged
                        quantity:
                          type: integer
                  capabilities:
                    type: object
                    required:
                      - canEditParts
                      - canRemoveParts
                      - canTransitionPartStatus
                      - canRelease
                      - canOverrideOvercommit
                      - canReconcile
                      - canViewCost
                      - canOverrideUnitCost
                      - allowedTransitions
                    properties:
                      canEditParts:
                        type: boolean
                      canRemoveParts:
                        type: boolean
                      canTransitionPartStatus:
                        type: boolean
                      canRelease:
                        type: boolean
                      canOverrideOvercommit:
                        type: boolean
                      canReconcile:
                        type: boolean
                      canViewCost:
                        type: boolean
                      canOverrideUnitCost:
                        type: boolean
                      allowedTransitions:
                        type: array
                        items:
                          $ref: '#/components/schemas/WorkOrderPartStatus'
                  historyOnly:
                    type: boolean
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    id:
      name: id
      in: path
      required: true
      description: Resource ID
      schema:
        type: string
  schemas:
    WorkOrderPartStatus:
      type: string
      enum:
        - assigned
        - reserved
        - kitted
        - staged
        - issued
    PartMoney:
      type: object
      required:
        - minor
        - currency
      properties:
        minor:
          type: integer
          description: Amount in the currency's minor units.
        currency:
          type: string
          description: Supported ISO 4217 currency code.
    ProblemDetails:
      type: object
      description: RFC 7807 Problem Details
      required:
        - type
        - title
        - status
        - detail
        - request_id
        - code
      example:
        type: https://api.oncanary.com/errors/validation_error
        title: Validation Error
        status: 400
        detail: Request validation failed
        request_id: req_01JAY8FVDM6CH4R3X9Q2T7K5NP
        code: validation_error
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        request_id:
          type: string
        code:
          type: string
        validation_errors:
          type: array
          items:
            type: object
            required:
              - field
              - message
            properties:
              field:
                type: string
              message:
                type: string
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    Forbidden:
      description: >-
        Forbidden - `insufficient_scope` when the API key lacks the scope, or
        `module_disabled` when the organization module is disabled
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    NotFound:
      description: Resource not found
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    RateLimited:
      description: Rate limit exceeded
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          description: Seconds until rate limit resets
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  headers:
    RequestId:
      description: Unique request identifier to include with support requests
      schema:
        type: string
        example: req_01JAY8FVDM6CH4R3X9Q2T7K5NP
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Organization API key with an `sk_live_` or `sk_test_` prefix

````