UpKeep Preventive Maintenance API

Preventive maintenance schedules and triggers

OpenAPI Specification

upkeep-preventive-maintenance-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: UpKeep Assets Preventive Maintenance API
  description: UpKeep is an asset operations management and CMMS (Computerized Maintenance Management System) platform. The UpKeep API provides programmatic access to work orders, assets, parts, locations, preventive maintenance schedules, purchase orders, meters, and webhooks for maintenance teams and facility managers.
  version: '2022-09-14'
  contact:
    name: UpKeep Developer Support
    url: https://developers.onupkeep.com/
  termsOfService: https://upkeep.com/terms/
servers:
- url: https://api.onupkeep.com/api/v2
  description: UpKeep Production API
security:
- SessionToken: []
tags:
- name: Preventive Maintenance
  description: Preventive maintenance schedules and triggers
paths:
  /preventive-maintenances:
    get:
      operationId: listPreventiveMaintenances
      summary: List Preventive Maintenances
      description: Retrieve a list of preventive maintenance schedules.
      tags:
      - Preventive Maintenance
      parameters:
      - name: page
        in: query
        schema:
          type: integer
          default: 0
      - name: limit
        in: query
        schema:
          type: integer
          default: 25
      responses:
        '200':
          description: List of preventive maintenance schedules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreventiveMaintenanceList'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createPreventiveMaintenance
      summary: Create Preventive Maintenance
      description: Create a new preventive maintenance schedule.
      tags:
      - Preventive Maintenance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreventiveMaintenanceRequest'
      responses:
        '200':
          description: Preventive maintenance schedule created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreventiveMaintenance'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /preventive-maintenances/{id}:
    get:
      operationId: getPreventiveMaintenance
      summary: Get Preventive Maintenance
      description: Retrieve details of a specific preventive maintenance schedule.
      tags:
      - Preventive Maintenance
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Preventive maintenance details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreventiveMaintenance'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updatePreventiveMaintenance
      summary: Update Preventive Maintenance
      description: Update a preventive maintenance schedule.
      tags:
      - Preventive Maintenance
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreventiveMaintenanceRequest'
      responses:
        '200':
          description: Preventive maintenance updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreventiveMaintenance'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deletePreventiveMaintenance
      summary: Delete Preventive Maintenance
      description: Delete a preventive maintenance schedule.
      tags:
      - Preventive Maintenance
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Preventive maintenance deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Session token missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Invalid request body or parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    PreventiveMaintenanceList:
      type: object
      properties:
        success:
          type: boolean
        total:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/PreventiveMaintenance'
    PreventiveMaintenance:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        assetId:
          type: string
        locationId:
          type: string
        frequency:
          type: string
          enum:
          - daily
          - weekly
          - monthly
          - quarterly
          - annually
          - custom
        startDate:
          type: string
          format: date
        assignedToId:
          type: string
        estimatedHours:
          type: number
        active:
          type: boolean
    PreventiveMaintenanceRequest:
      type: object
      required:
      - title
      - frequency
      - startDate
      properties:
        title:
          type: string
        description:
          type: string
        assetId:
          type: string
        locationId:
          type: string
        frequency:
          type: string
          enum:
          - daily
          - weekly
          - monthly
          - quarterly
          - annually
          - custom
        startDate:
          type: string
          format: date
        assignedToId:
          type: string
        estimatedHours:
          type: number
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Error message
  securitySchemes:
    SessionToken:
      type: apiKey
      in: header
      name: session-token
      description: Session token obtained from POST /auth