Complete MaintainX integration skill pack with 24 skills covering work orders, preventive maintenance, asset management, and CMMS workflows. Flagship tier vendor pack.
Installation
Open Claude Code and run this command:
/plugin install maintainx-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (24)
Integrate MaintainX API testing into CI/CD pipelines.
MaintainX CI Integration
Overview
Configure CI/CD pipelines for MaintainX integrations with unit tests (mocked), integration tests (live API), and automated quality gates.
Prerequisites
- Git repository with MaintainX integration
- GitHub Actions (or GitLab CI)
- Test environment MaintainX API key stored as CI secret
Instructions
Step 1: GitHub Actions Workflow
# .github/workflows/maintainx-ci.yml
name: MaintainX Integration CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
NODE_VERSION: '20'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run test -- --coverage
- uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
integration-tests:
runs-on: ubuntu-latest
needs: unit-tests
environment: staging
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run test:integration
env:
MAINTAINX_API_KEY: ${{ secrets.MAINTAINX_API_KEY_STAGING }}
MAINTAINX_ENV: staging
- run: npm run lint
- run: npm run typecheck
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for secrets
run: npx gitleaks detect --source . --no-git --verbose
- name: Audit dependencies
run: npm audit --production --audit-level=high
Step 2: Unit Tests with Mocked API
// tests/work-orders.test.ts
import { describe, it, expect, vi, beforeEach } from 'vitest';
import axios from 'axios';
vi.mock('axios');
describe('Work Order Service', () => {
beforeEach(() => {
process.env.MAINTAINX_API_KEY = 'test-key';
vi.resetAllMocks();
});
it('creates a work order with required fields', async () => {
const mockWO = { id: 1, title: 'Test WO', status: 'OPEN', priority: 'LOW' };
vi.mocked(axios.create).mockReturnValue({
post: vi.fn().mockResolvedValue({ data: mockWO }),
interceptors: { response: { use: vi.fn() } },
} as any);
const { MaintainXClient } = await import('../src/client');
const client = new MaintainXClient();
const result = await client.createWorkOrder({ title: 'Test WO' });
expect(result.data.id).toBe(1);
expect(result.data.status).toBe('OPEN');
});
it('handles 429 rate limit with retry', async () => {
const rateLimitErr = {
response: { status: 429, headers: { 'rDebug and resolve common MaintainX API errors.
MaintainX Common Errors
Overview
Quick reference for diagnosing and resolving common MaintainX API errors with concrete solutions and diagnostic commands.
Prerequisites
MAINTAINXAPIKEYenvironment variable configuredcurlandjqavailable- Access to application logs
Instructions
Step 1: Diagnostic Quick Check
Run this first to validate connectivity and auth:
# Test 1: Verify API key is valid
curl -s -o /dev/null -w "%{http_code}" \
https://api.getmaintainx.com/v1/users?limit=1 \
-H "Authorization: Bearer $MAINTAINX_API_KEY"
# Expected: 200
# Test 2: Check API key is set
echo "Key length: ${#MAINTAINX_API_KEY}"
# Should be > 0
# Test 3: Verify DNS resolution
nslookup api.getmaintainx.com
# Should resolve to an IP
Step 2: Identify the Error
Error Handling
400 Bad Request
Cause: Invalid request body, missing required fields, or malformed JSON.
# Diagnose: Send a minimal valid request
curl -X POST https://api.getmaintainx.com/v1/workorders \
-H "Authorization: Bearer $MAINTAINX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Diagnostic test order"}' -v 2>&1 | tail -5
Common fixes:
- Work orders require at minimum a
titlefield - Priority must be one of:
NONE,LOW,MEDIUM,HIGH - Status must be one of:
OPEN,INPROGRESS,ONHOLD,COMPLETED,CLOSED - Dates must be ISO 8601 format:
2026-03-19T12:00:00Z
401 Unauthorized
Cause: Missing, invalid, or expired API key.
// Diagnostic wrapper
async function diagAuth() {
try {
const res = await fetch('https://api.getmaintainx.com/v1/users?limit=1', {
headers: { Authorization: `Bearer ${process.env.MAINTAINX_API_KEY}` },
});
if (res.status === 401) {
console.error('API key is invalid or expired.');
console.error('Generate a new key: MaintainX > Settings > Integrations > New Key');
} else {
console.log('Auth OK - status:', res.status);
}
} catch (e) {
console.error('Network error:', e);
}
}
Fixes:
- Regenerate key in MaintainX: Settings > Integrations > Generate Key
- Check for whitespace:
echo "'$MAINTAINXAPIKEY'" | cat -A - Ensure
Bearerprefix (notBasicorToken)
403 Forbidden
Cause: Val
Execute MaintainX primary workflow: Work Order lifecycle management.
MaintainX Core Workflow A: Work Order Lifecycle
Overview
Master the complete work order lifecycle in MaintainX -- from creation through completion. Work orders are the core unit of maintenance operations.
Prerequisites
- Completed
maintainx-install-authsetup MAINTAINXAPIKEYenvironment variable configured- MaintainX account with work order permissions
Status Transition Flow
OPEN ──→ IN_PROGRESS ──→ COMPLETED ──→ CLOSED
│ │ ↑
│ ↓ │
│ ON_HOLD ───────────┘
│
└──→ CLOSED (cancelled)
Instructions
Step 1: Create a Work Order
import { MaintainXClient } from './maintainx/client';
const client = new MaintainXClient();
// Create a corrective work order
const { data: wo } = await client.createWorkOrder({
title: 'Pump Station #3 - Seal Leak Repair',
description: 'Detected water leak at the mechanical seal. Needs immediate attention.',
priority: 'HIGH',
status: 'OPEN',
assignees: [{ type: 'USER', id: 4521 }],
assetId: 8901,
locationId: 2345,
dueDate: '2026-03-21T17:00:00Z',
categories: ['CORRECTIVE'],
});
console.log(`Work order #${wo.id} created`);
Step 2: Update Status Through Lifecycle
// Technician starts work
await client.updateWorkOrder(wo.id, {
status: 'IN_PROGRESS',
});
// Put on hold (waiting for parts)
await client.updateWorkOrder(wo.id, {
status: 'ON_HOLD',
onHoldReason: 'Waiting for replacement seal kit from supplier',
});
// Resume and complete
await client.updateWorkOrder(wo.id, {
status: 'IN_PROGRESS',
});
await client.updateWorkOrder(wo.id, {
status: 'COMPLETED',
completionNotes: 'Replaced mechanical seal. Tested for 30 min with no leaks.',
});
Step 3: Query Work Orders
// Fetch open work orders sorted by priority
const { data: openOrders } = await client.getWorkOrders({
status: 'OPEN',
limit: 25,
});
for (const order of openOrders.workOrders) {
console.log(`#${order.id} [${order.priority}] ${order.title}`);
}
// Paginate through all IN_PROGRESS orders
async function getAllInProgress() {
const allOrders = [];
let cursor: string | undefined;
do {
const { data } = await client.getWorkOrders({
status: 'IN_PROGRESS',
limit: 100,
cursor,
});
allOrders.push(...data.workOrders);
cursor = data.cursor;
} while (cursor);
return allOrders;
}
Step 4: Add Comments and Attachments
// Add a technician note
await client.request('POST', `/workorders/${wo.id}/comments`, {
body: 'Arrived on site. Isolating pumpExecute MaintainX secondary workflow: Asset and Location management.
MaintainX Core Workflow B: Asset & Location Management
Overview
Manage equipment assets and facility locations in MaintainX. Assets represent equipment that requires maintenance; locations organize your facilities into a manageable hierarchy.
Prerequisites
- Completed
maintainx-install-authsetup MAINTAINXAPIKEYenvironment variable configured- MaintainX account with asset management permissions
Instructions
Step 1: Create a Location Hierarchy
import { MaintainXClient } from './maintainx/client';
const client = new MaintainXClient();
// Create top-level facility
const { data: plant } = await client.request('POST', '/locations', {
name: 'Manufacturing Plant - Austin',
description: 'Main production facility',
address: '1234 Industrial Blvd, Austin, TX 78701',
});
// Create sub-locations
const { data: floor } = await client.request('POST', '/locations', {
name: 'Production Floor - Building A',
parentId: plant.id,
description: 'Primary manufacturing area with 12 production lines',
});
const { data: mechRoom } = await client.request('POST', '/locations', {
name: 'Mechanical Room - B2',
parentId: plant.id,
description: 'Pumps, compressors, and HVAC equipment',
});
console.log(`Location hierarchy created: ${plant.id} → ${floor.id}, ${mechRoom.id}`);
Step 2: Register Assets
// Create an asset linked to a location
const { data: pump } = await client.request('POST', '/assets', {
name: 'Centrifugal Pump #3',
description: 'Grundfos CR 45-2, 15HP, installed 2023',
locationId: mechRoom.id,
serialNumber: 'GF-CR45-2-00891',
model: 'CR 45-2',
manufacturer: 'Grundfos',
});
const { data: conveyor } = await client.request('POST', '/assets', {
name: 'Conveyor Belt - Line 7',
description: 'Main assembly line conveyor, 120ft span',
locationId: floor.id,
serialNumber: 'DRV-CONV-7-2024',
model: 'Heavy Duty BD-120',
manufacturer: 'Dorner',
});
console.log(`Assets registered: Pump #${pump.id}, Conveyor #${conveyor.id}`);
Step 3: List and Filter Assets
// Get all assets at a location
const { data: locationAssets } = await client.getAssets({
locationId: mechRoom.id,
limit: 50,
});
for (const asset of locationAssets.assets) {
console.log(` ${asset.name} (SN: ${asset.serialNumber || 'N/A'})`);
}
// Paginate through all assets
async function getAllAssets() {
const all = [];
let cursor: string | undefined;
do {
const { data } = await client.getAssets({ limit: 100, cursor });
all.push(...data.assets);
cursor =Optimize MaintainX API usage for cost efficiency.
MaintainX Cost Tuning
Overview
Reduce MaintainX API request volume and optimize costs through caching, webhook-driven sync, request batching, and smart polling strategies.
Prerequisites
- MaintainX integration deployed and working
- Redis or in-memory cache available
- Baseline API usage metrics
Instructions
Step 1: Request Volume Tracking
// src/cost/usage-tracker.ts
class ApiUsageTracker {
private counts: Map<string, number> = new Map();
private startTime = Date.now();
record(endpoint: string) {
const key = endpoint.split('?')[0]; // Strip query params
this.counts.set(key, (this.counts.get(key) || 0) + 1);
}
report() {
const elapsed = (Date.now() - this.startTime) / 1000 / 60; // minutes
console.log(`\n=== API Usage Report (${elapsed.toFixed(1)} min) ===`);
const sorted = [...this.counts.entries()].sort((a, b) => b[1] - a[1]);
for (const [endpoint, count] of sorted) {
const rate = (count / elapsed).toFixed(1);
console.log(` ${endpoint}: ${count} calls (${rate}/min)`);
}
console.log(` TOTAL: ${[...this.counts.values()].reduce((a, b) => a + b, 0)} calls`);
}
}
export const tracker = new ApiUsageTracker();
// Report every 10 minutes
setInterval(() => tracker.report(), 600_000);
Step 2: Response Caching
// src/cost/cached-client.ts
interface CacheEntry<T> {
data: T;
expiresAt: number;
}
class CachedMaintainXClient {
private cache = new Map<string, CacheEntry<any>>();
private client: MaintainXClient;
// TTL per resource type (in seconds)
private ttl: Record<string, number> = {
'/users': 300, // 5 min - users rarely change
'/locations': 300, // 5 min - locations are static
'/assets': 120, // 2 min - assets change infrequently
'/workorders': 30, // 30 sec - work orders change often
'/teams': 600, // 10 min - teams are very static
};
constructor(client: MaintainXClient) {
this.client = client;
}
async get<T>(endpoint: string, params?: any): Promise<T> {
const cacheKey = `${endpoint}:${JSON.stringify(params || {})}`;
const cached = this.cache.get(cacheKey);
if (cached && cached.expiresAt > Date.now()) {
console.log(`[CACHE HIT] ${endpoint}`);
return cached.data;
}
const basePath = '/' + endpoint.split('/').filter(Boolean)[0];
const ttlSec = this.ttl[basePath] || 60;
const data = await this.client.request('GET', endpoint, undefined, params);
this.cache.set(cacheKey, {
data,
expiresAt: Date.now() + ttlSec * 1000,
});
tracker.record(endpoint);
return data as T;
}
invalidate(pattern: string) {
for (const key of this.cache.keys()) {
if (kData synchronization, ETL patterns, and data management for MaintainX.
MaintainX Data Handling
Overview
Patterns for synchronizing, transforming, and exporting data between MaintainX and external systems (databases, data warehouses, ERPs).
Prerequisites
- MaintainX API access configured
- Node.js 18+ with
axios - Target database or data warehouse available
Instructions
Step 1: Incremental Sync with Cursor Pagination
import { MaintainXClient } from './client';
import { writeFileSync, existsSync, readFileSync } from 'fs';
const SYNC_STATE_FILE = '.maintainx-sync-state.json';
interface SyncState {
lastSyncAt: string;
workOrderCursor?: string;
assetCursor?: string;
}
function loadSyncState(): SyncState {
if (existsSync(SYNC_STATE_FILE)) {
return JSON.parse(readFileSync(SYNC_STATE_FILE, 'utf-8'));
}
return { lastSyncAt: new Date(0).toISOString() };
}
function saveSyncState(state: SyncState) {
writeFileSync(SYNC_STATE_FILE, JSON.stringify(state, null, 2));
}
async function incrementalSync(client: MaintainXClient) {
const state = loadSyncState();
const syncStart = new Date().toISOString();
console.log(`Syncing changes since ${state.lastSyncAt}`);
// Sync work orders updated since last run
let cursor: string | undefined;
let totalWOs = 0;
do {
const response = await client.getWorkOrders({
updatedAtGte: state.lastSyncAt,
limit: 100,
cursor,
});
for (const wo of response.workOrders) {
await upsertWorkOrder(wo); // Your DB write function
totalWOs++;
}
cursor = response.cursor ?? undefined;
} while (cursor);
// Sync assets updated since last run
let assetCursor: string | undefined;
let totalAssets = 0;
do {
const response = await client.getAssets({
updatedAtGte: state.lastSyncAt,
limit: 100,
cursor: assetCursor,
});
for (const asset of response.assets) {
await upsertAsset(asset); // Your DB write function
totalAssets++;
}
assetCursor = response.cursor ?? undefined;
} while (assetCursor);
saveSyncState({ lastSyncAt: syncStart });
console.log(`Synced ${totalWOs} work orders, ${totalAssets} assets`);
}
Step 2: Export to CSV
import { createWriteStream } from 'fs';
async function exportWorkOrdersToCSV(client: MaintainXClient, outputPath: string) {
const stream = createWriteStream(outputPath);
stream.write('id,title,status,priority,assignee,asset,location,created_at,completed_at\n');
let cursor: string | undefined;
let count = 0;
do {
const response = await client.getWorkOrders({ limit: 100, cursor });
for (const wo of response.workOrders) {
const row = [
wo.id,
`"${(wo.title || '').replace(/"/g, '""')}"`,
wo.status,
wo.priority,
wo.assigComprehensive debugging toolkit for MaintainX integrations.
MaintainX Debug Bundle
Current State
!node --version 2>/dev/null || echo 'N/A'
!python3 --version 2>/dev/null || echo 'N/A'
!echo "API key set: $([ -n "$MAINTAINXAPIKEY" ] && echo 'yes' || echo 'no')"
Overview
Complete debugging toolkit for diagnosing and resolving MaintainX integration issues with diagnostic scripts, request logging, and health checks.
Prerequisites
- MaintainX API access configured
- Node.js 18+ or curl
MAINTAINXAPIKEYenvironment variable set
Instructions
Step 1: Environment Diagnostic Script
#!/bin/bash
echo "=== MaintainX Debug Report ==="
echo "Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "Node.js: $(node --version 2>/dev/null || echo 'not installed')"
echo "npm: $(npm --version 2>/dev/null || echo 'not installed')"
echo "API key set: $([ -n "$MAINTAINX_API_KEY" ] && echo 'yes (length: '${#MAINTAINX_API_KEY}')' || echo 'NO')"
echo ""
echo "=== API Connectivity ==="
HTTP_CODE=$(curl -s -o /tmp/mx-debug.json -w "%{http_code}" \
"https://api.getmaintainx.com/v1/users?limit=1" \
-H "Authorization: Bearer $MAINTAINX_API_KEY")
echo "Auth status: $HTTP_CODE"
if [ "$HTTP_CODE" = "200" ]; then
echo "Response: $(cat /tmp/mx-debug.json | jq -c '{users: (.users | length)}')"
else
echo "Error: $(cat /tmp/mx-debug.json | jq -r '.message // .error // "unknown"')"
fi
echo ""
echo "=== DNS Resolution ==="
nslookup api.getmaintainx.com 2>/dev/null | grep -A1 "Name:"
echo ""
echo "=== Response Timing ==="
curl -s -o /dev/null -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" \
"https://api.getmaintainx.com/v1/users?limit=1" \
-H "Authorization: Bearer $MAINTAINX_API_KEY"
Step 2: Request/Response Logger
// src/debug/request-logger.ts
import axios, { AxiosInstance, AxiosError } from 'axios';
export function createDebugClient(): AxiosInstance {
const client = axios.create({
baseURL: 'https://api.getmaintainx.com/v1',
headers: {
Authorization: `Bearer ${process.env.MAINTAINX_API_KEY}`,
'Content-Type': 'application/json',
},
});
// Request interceptor
client.interceptors.request.use((config) => {
const startTime = Date.now();
(config as any).__startTime = startTime;
console.log(`[REQ] ${config.method?.toUpperCase()} ${config.url}`);
if (config.data) console.log(' Body:', JSON.stringify(confiDeploy MaintainX integrations to production environments.
MaintainX Deploy Integration
Overview
Deploy MaintainX integrations to production using Docker, Google Cloud Run, and Kubernetes with proper health checks and secret management.
Prerequisites
- MaintainX integration tested and passing CI
- Docker installed
- Cloud platform account (GCP recommended)
MAINTAINXAPIKEYfor production environment
Instructions
Step 1: Dockerfile
# Dockerfile
FROM node:20-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --production=false
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
FROM node:20-slim
WORKDIR /app
RUN addgroup --system app && adduser --system --ingroup app app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY package*.json ./
USER app
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
CMD ["node", "dist/index.js"]
Step 2: Health Check Endpoint
// src/health.ts
import express from 'express';
import { MaintainXClient } from './client';
const app = express();
app.get('/health', async (req, res) => {
const checks: Record<string, string> = {
server: 'ok',
apiKey: process.env.MAINTAINX_API_KEY ? 'configured' : 'missing',
};
try {
const client = new MaintainXClient();
await client.getUsers({ limit: 1 });
checks.maintainxApi = 'ok';
} catch (err: any) {
checks.maintainxApi = `error: ${err.response?.status || err.message}`;
}
const allOk = Object.values(checks).every((v) => v === 'ok' || v === 'configured');
res.status(allOk ? 200 : 503).json({
status: allOk ? 'healthy' : 'degraded',
checks,
uptime: process.uptime(),
timestamp: new Date().toISOString(),
});
});
app.get('/ready', (req, res) => {
res.status(process.env.MAINTAINX_API_KEY ? 200 : 503).json({
ready: !!process.env.MAINTAINX_API_KEY,
});
});
export { app };
Step 3: Deploy to Google Cloud Run
# Build and push container
PROJECT_ID="your-gcp-project"
REGION="us-central1"
SERVICE="maintainx-integration"
gcloud builds submit --tag gcr.io/$PROJECT_ID/$SERVICE
# Deploy with secrets
gcloud run deploy $SERVICE \
--image gcr.io/$PROJECT_ID/$SERVICE \
--region $REGION \
--platform managed \
--set-secrets "MAINTAINX_API_KEY=maintainx-api-key:latest" \
--min-instances 1 \
--max-instances 10 \
--memory 512Mi \
--cpu 1 \
--port 3000 \
--allow-unauthenticated # Only if webhook endpoint
Step 4: Docker Compose for Multi-Service
# docker-compose.yml
services:
maConfigure enterprise role-based access control for MaintainX integrations.
MaintainX Enterprise RBAC
Overview
Configure enterprise role-based access control for MaintainX integrations with role definitions, location-scoped permissions, and audit logging.
Prerequisites
- MaintainX Enterprise plan
- Understanding of RBAC concepts
- Node.js 18+
MaintainX Role Hierarchy
Organization Admin
├── can manage all locations, users, teams, and settings
├── Full API access
│
Location Manager
├── can manage work orders, assets at assigned locations
├── API: filtered by locationId
│
Technician
├── can view/update assigned work orders
├── API: filtered by assigneeId
│
Viewer (Read-Only)
└── can view work orders, assets, locations
└── API: GET endpoints only
Instructions
Step 1: Role Definitions
// src/rbac/roles.ts
export type Role = 'admin' | 'manager' | 'technician' | 'viewer';
interface Permission {
resource: string;
actions: Array<'create' | 'read' | 'update' | 'delete'>;
scope?: 'all' | 'location' | 'assigned';
}
export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
admin: [
{ resource: 'workorders', actions: ['create', 'read', 'update', 'delete'], scope: 'all' },
{ resource: 'assets', actions: ['create', 'read', 'update', 'delete'], scope: 'all' },
{ resource: 'locations', actions: ['create', 'read', 'update', 'delete'], scope: 'all' },
{ resource: 'users', actions: ['create', 'read', 'update', 'delete'], scope: 'all' },
{ resource: 'teams', actions: ['create', 'read', 'update', 'delete'], scope: 'all' },
],
manager: [
{ resource: 'workorders', actions: ['create', 'read', 'update'], scope: 'location' },
{ resource: 'assets', actions: ['create', 'read', 'update'], scope: 'location' },
{ resource: 'locations', actions: ['read'], scope: 'location' },
{ resource: 'users', actions: ['read'], scope: 'all' },
{ resource: 'teams', actions: ['read'], scope: 'all' },
],
technician: [
{ resource: 'workorders', actions: ['read', 'update'], scope: 'assigned' },
{ resource: 'assets', actions: ['read'], scope: 'location' },
{ resource: 'locations', actions: ['read'], scope: 'location' },
],
viewer: [
{ resource: 'workorders', actions: ['read'], scope: 'all' },
{ resource: 'assets', actions: ['read'],Create a minimal working MaintainX example - your first work order.
MaintainX Hello World
Overview
Create your first work order using the MaintainX REST API -- the core building block of CMMS operations.
Prerequisites
- Completed
maintainx-install-authsetup - Valid
MAINTAINXAPIKEYenvironment variable - Node.js 18+ or curl
Instructions
Step 1: Create a Work Order (curl)
curl -X POST https://api.getmaintainx.com/v1/workorders \
-H "Authorization: Bearer $MAINTAINX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Hello World - Test Work Order",
"description": "First API-created work order. Safe to delete.",
"priority": "LOW",
"status": "OPEN"
}' | jq .
Expected response:
{
"id": 12345,
"title": "Hello World - Test Work Order",
"status": "OPEN",
"priority": "LOW",
"createdAt": "2026-03-19T12:00:00Z"
}
Step 2: Create a Work Order (TypeScript)
// hello-maintainx.ts
import { MaintainXClient } from './maintainx/client';
async function helloMaintainX() {
const client = new MaintainXClient();
// Create a basic work order
const { data: workOrder } = await client.createWorkOrder({
title: 'HVAC Filter Replacement - Building A',
description: 'Replace air filters in units 1-4 on the 3rd floor.',
priority: 'MEDIUM',
});
console.log('Created work order:', workOrder.id);
// Retrieve it back to confirm
const { data: fetched } = await client.getWorkOrder(workOrder.id);
console.log('Work order status:', fetched.status);
console.log('Created at:', fetched.createdAt);
// List open work orders
const { data: list } = await client.getWorkOrders({
status: 'OPEN',
limit: 5,
});
console.log(`Found ${list.workOrders.length} open work orders`);
}
helloMaintainX();
Step 3: Verify and Clean Up
# List recent work orders to confirm creation
curl -s "https://api.getmaintainx.com/v1/workorders?limit=3" \
-H "Authorization: Bearer $MAINTAINX_API_KEY" | jq '.workOrders[] | {id, title, status}'
# Delete the test work order (replace ID)
curl -X DELETE "https://api.getmaintainx.com/v1/workorders/12345" \
-H "Authorization: Bearer $MAINTAINX_API_KEY"
Output
- Working code file that creates a MaintainX work order via REST API
- Console output showing the created work order ID, status, and timestamp
- Verified retrieval of the created work order
Error Handling
|
Manage incident response for MaintainX integration failures.
ReadWriteEditBash(curl:*)Bash(npm:*)
MaintainX Incident RunbookOverviewStep-by-step procedures for responding to MaintainX integration incidents, from detection through resolution and post-mortem. Prerequisites
Severity Classification
InstructionsStep 1: Immediate Triage (First 5 Minutes)
Step 2: Determine Root Cause
Step 3: Apply MitigationAPI Key Expired (SEV-1): Install and configure MaintainX REST API authentication.
ReadWriteEditBash(npm:*)Bash(pip:*)Bash(curl:*)Grep
MaintainX Install & AuthOverviewSet up MaintainX REST API authentication and configure your development environment for CMMS integration. Prerequisites
InstructionsStep 1: Generate API Key
Step 2: Configure Environment Variables
Step 3: Create API Client WrapperSet up a local development loop for MaintainX integration development.
ReadWriteEditBash(npm:*)Bash(node:*)Bash(docker:*)
MaintainX Local Dev LoopOverviewSet up an efficient local development workflow for building and testing MaintainX integrations with hot reload, mock servers, and automated testing. Prerequisites
InstructionsStep 1: Initialize TypeScript Project
Create
Step 2: Project Structure
Step 3: Dev Scripts in package.json
Step 4: Write Unit Tests with Mocked APIExecute complete platform migrations to or from MaintainX.
ReadWriteEditBash(npm:*)Bash(node:*)
MaintainX Migration Deep DiveCurrent State! OverviewComprehensive guide for migrating to MaintainX from legacy CMMS systems (Maximo, UpKeep, Fiix), spreadsheets, or custom databases. Prerequisites
Migration Phases
InstructionsStep 1: Source System Assessment
Step 2: Schema MappingConfigure multiple MaintainX environments (dev, staging, production).
ReadWriteEditBash(npm:*)
MaintainX Multi-Environment SetupOverviewConfigure and manage multiple MaintainX environments for development, staging, and production with proper secret management and client isolation. Prerequisites
InstructionsStep 1: Environment Configuration
Step 2: Client Factory
Step 3: Environment FilesImplement comprehensive observability for MaintainX integrations.
ReadWriteEditBash(npm:*)
MaintainX ObservabilityOverviewImplement metrics, structured logging, and alerting for MaintainX integrations to ensure reliability and rapid issue detection. Prerequisites
InstructionsStep 1: Prometheus Metrics
Step 2: Instrumented API ClientOptimize MaintainX API integration performance.
ReadWriteEditBash(npm:*)
MaintainX Performance TuningOverviewOptimize MaintainX integration performance with caching, connection pooling, efficient pagination, and request deduplication. Prerequisites
InstructionsStep 1: Connection Pooling with Keep-Alive
Step 2: Multi-Level CachingProduction deployment checklist for MaintainX integrations.
ReadWriteEditBash(npm:*)Bash(node:*)
MaintainX Production ChecklistOverviewComprehensive pre-deployment and post-deployment checklist for MaintainX integrations covering security, reliability, observability, and data integrity. Prerequisites
InstructionsStep 1: Authentication & Security
Step 2: Error Handling & Resilience
Step 3: Data Integrity
Step 4: Observability
Step 5: Performance
Step 6: Deployment
Implement MaintainX API rate limiting, pagination, and backoff patterns.
ReadWriteEdit
MaintainX Rate LimitsOverviewHandle MaintainX API rate limits gracefully with exponential backoff, cursor-based pagination, and request queuing to maximize throughput without triggering 429 errors. Prerequisites
InstructionsStep 1: Rate-Limited Client WrapperProduction-grade architecture patterns for MaintainX integrations.
ReadWriteEdit
MaintainX Reference ArchitectureOverviewProduction-grade architecture patterns for building scalable, maintainable integrations between MaintainX and enterprise systems (ERP, SCADA, data warehouses). Prerequisites
InstructionsStep 1: Event-Driven Sync ArchitectureThe recommended architecture for most MaintainX integrations. Uses webhooks for real-time updates and scheduled jobs for reconciliation.
Step 2: Bi-Directional Sync GatewayFor integrating MaintainX with ERP systems (SAP, Oracle) where changes flow both ways.
Learn MaintainX REST API patterns, pagination, filtering, and client architecture.
ReadWriteEditBash(npm:*)Grep
MaintainX SDK PatternsOverviewProduction-grade patterns for building robust MaintainX API integrations with proper error handling, cursor-based pagination, retry logic, and type safety. Prerequisites
InstructionsStep 1: Type-Safe Client with GenericsConfigure MaintainX API security, credential management, and access control.
ReadWriteEditBash(npm:*)
MaintainX Security BasicsOverviewSecure your MaintainX integration with proper credential management, input validation, audit logging, and key rotation procedures. Prerequisites
InstructionsStep 1: Secure Credential StorageNever hardcode API keys. Use environment variables or a secret manager.
Step 2: Git Hook to Prevent Secret Commits
Or use
Step 3: Input ValidationValidate all user input before sending to the MaintainX API:
Step 4: Audit LoggingMigrate MaintainX API versions and handle breaking changes.
ReadWriteEditBash(npm:*)Grep
MaintainX Upgrade & MigrationCurrent State! OverviewHandle MaintainX API version upgrades, deprecations, and breaking changes with a safe, incremental migration strategy. Prerequisites
InstructionsStep 1: Audit Current API Usage
Step 2: Version Compatibility LayerImplement MaintainX webhook handling and event-driven integrations.
ReadWriteEditBash(curl:*)Bash(npm:*)
MaintainX Webhooks & EventsOverviewBuild real-time integrations with MaintainX using webhooks for work order updates, asset changes, and maintenance notifications. MaintainX fires webhook events when key resources change. Prerequisites
InstructionsStep 1: Register a Webhook
Step 2: Webhook Receiver (Express)
Step 3: Event RouterReady to use maintainx-pack?
Tags
maintainxcmmswork-ordersmaintenanceassetsfacilitiesoperations
|
|---|