Skip to main content

Developers

This guide covers everything you need to integrate with or build on top of the Powoflow platform — API access, authentication, real-time events, and the integration framework.


API Documentation

Powoflow provides interactive Swagger UI documentation for both APIs.

User API

The User API is the primary API for all end-user operations — assets, work orders, inventory, alarms, sensors, and more.

EnvironmentSwagger UI
Developmenthttps://api.dev1.powoflow.com/docs
Productionhttps://api.powoflow.com/docs

Management API

The Management API is used for platform administration — tenant management, user provisioning, billing, and system configuration.

EnvironmentSwagger UI
Developmenthttps://mgmt.dev1.powoflow.com/docs
Productionhttps://mgmt.powoflow.com/docs
tip

Use the Swagger UI to explore endpoints, view request/response schemas, and test API calls interactively. You can authorize with your JWT token directly in the UI.


Authentication

Powoflow uses Auth0 OAuth2 with the PKCE (Proof Key for Code Exchange) flow for secure authentication.

Auth0 Domains

EnvironmentAuth0 Domain
Developmentkiowa-dev1.us.auth0.com
Productionkiowa-prod.us.auth0.com

Authentication Flow

  1. Your application initiates the Auth0 PKCE flow with the appropriate domain
  2. The user authenticates via the Auth0 Universal Login page
  3. Auth0 returns an authorization code
  4. Your application exchanges the code for an access token (JWT)
  5. Include the JWT in all API requests via the Authorization header

API Request Format

Authorization: Bearer <access_token>

JWT Token Claims

The access token contains the following claims relevant to Powoflow:

ClaimDescription
tenant_idThe user's organization identifier
rolesArray of assigned roles (e.g., ["admin", "member"])
platform_adminBoolean flag for platform-level administrators
subAuth0 user ID
expToken expiration timestamp
warning

Tokens expire after the configured TTL (typically 1 hour). Use refresh tokens to obtain new access tokens without requiring the user to re-authenticate.

Client Libraries

PlatformLibrary
Flutter (mobile)auth0_flutter
Next.js (web)@auth0/nextjs-auth0 v4

API Overview

The Powoflow User API is organized into the following endpoint groups. Endpoint counts reflect the total number of unique operations available.

GroupEndpointsDescription
Resources37CRUD, hierarchy, items, links, external IDs
Work Orders49CRUD, tasks, assignments, time, costs, comments, signatures, PM schedules
Inventory26Parts, stock, mutations, kits, serials, valuation
Integrations23Vendors, geo-data, geo-alerts, subscriptions
Location & Telemetry19GNSS positions, sensor data, fleet locations
User & Account19Profile, settings, team, personalization
Video & Camera17Streams, recordings, screenshots, ONVIF, PTZ
Alarms15CRUD, state transitions, ISA 18.2
Checklists12Templates, tasks, reorder
Meters8CRUD, readings
AI Assistant1Multi-turn chat with tool calling

Resources (37 endpoints)

Core asset and resource management:

  • Create, read, update, delete resources
  • Hierarchy management (parent/child relationships)
  • Items (sub-records attached to resources)
  • Links (relationships between resources: parent, child, related, depends_on, etc.)
  • External ID mapping (for ERP/CMMS bidirectional sync)
  • Bulk operations

Work Orders (49 endpoints)

Full maintenance management lifecycle:

  • Work order CRUD and status transitions
  • Task management (8 task types with validation)
  • Assignments (assign/unassign technicians)
  • Time tracking (labor hour entries)
  • Cost tracking (labor, material, equipment)
  • Comments (threaded discussion)
  • Signatures (digital sign-off capture)
  • Maintenance requests (simplified submission)
  • PM Schedules (recurring work order generation)
  • Checklist templates (reusable task lists)

Inventory (26 endpoints)

Spare parts and stock management:

  • Parts catalog CRUD
  • Stock operations (receive, issue, transfer, adjust, return)
  • Transaction history and audit trail
  • Part kits (grouped assemblies)
  • Serialized inventory (individual serial number tracking)
  • Stock valuation (weighted average cost)

Alarms (15 endpoints)

ISA 18.2-compliant alarm management:

  • Alarm configuration and thresholds
  • State transitions: triggered, acknowledged, shelved, suppressed, cleared
  • Alarm history and statistics
  • Priority and severity classification
info

The full OpenAPI specification is available at the Swagger UI URLs listed above. Use the spec to generate client libraries in any language.


WebSocket API

Powoflow provides a WebSocket API for real-time updates. Use this to build live dashboards, real-time monitoring, and instant notifications.

Connection

wss://ws.dev1.powoflow.com?token={accessToken}

Replace {accessToken} with a valid JWT access token. The WebSocket server validates the token on connection and associates the session with the user's tenant.

Subscribe to Resource Updates

Send a subscribe message to receive real-time updates for a specific resource:

{
"action": "subscribe",
"resourceId": "res_01HQ..."
}

Subscribe to Activity Feed

Receive all activity events for your tenant:

{
"action": "subscribe_activity"
}

Real-Time Event Types

Once subscribed, you'll receive events as JSON messages:

Event TypeDescriptionPayload
location_updateDevice GPS position changedlat, lng, speed, heading, timestamp
sensor_readingNew sensor value receivedsensorId, value, unit, timestamp
camera_eventCamera event detectedcameraId, eventType, timestamp
status_changeResource status changedresourceId, oldStatus, newStatus
alarm_triggeredAlarm condition metalarmId, severity, resourceId
alarm_clearedAlarm condition resolvedalarmId, resourceId
work_order_updateWork order changedworkOrderId, field, oldValue, newValue
activityGeneral activity eventtype, userId, resourceId, details
tip

Subscribe only to the resources you need. Each subscription creates a filtered stream — subscribing to too many resources increases message volume and bandwidth usage.


EventBridge Events

Powoflow publishes events to AWS EventBridge for integration developers who need to react to platform events asynchronously.

Event Bus

Events are published to the Powoflow platform event bus. Integration developers can create EventBridge rules to route events to their own targets (Lambda, SQS, SNS, etc.).

Event Types

Event TypeDescription
resource.createdA new resource was created
resource.updatedA resource was modified
resource.deletedA resource was deleted
sensor_readingA new sensor reading was received
location_updateA device reported a new GPS position
camera_motionMotion detected on a camera
device_statusDevice went online/offline
integration_syncedAn integration completed a sync cycle
alarm.triggeredAn alarm condition was met
alarm.clearedAn alarm condition was resolved
alarm.acknowledgedAn alarm was acknowledged by a user
work_order.createdA new work order was created
work_order.status_changedA work order status transitioned
work_order.completedA work order was completed
inventory.stock_changedInventory stock level changed
inventory.serial_status_changedA serialized part changed status
checklist.completedA checklist was fully completed
user.invitedA new user was invited to the tenant
info

EventBridge events include the full resource payload and metadata (tenant ID, user ID, timestamp). See the EventBridge console for detailed schema definitions.


Integration Framework

Build custom integrations using Powoflow's integration pipeline.

Webhook Handler

Receive real-time data from external systems via webhooks.

Endpoint:

POST /integrations/{vendorId}/webhook

5-Step Pipeline

Every inbound integration (webhook or poll) passes through a standardized pipeline:

StepDescription
1. AuthenticateValidate the request source (API key, HMAC signature, IP allowlist)
2. ParseExtract structured data from the raw payload
3. ValidateVerify data integrity and required fields
4. SyncCreate or update resources in Powoflow (idempotent)
5. TelemetryRecord sensor readings, location updates, or status changes

Adapter Base Classes

Powoflow provides base classes for building custom adapters:

Base ClassUse Case
base_adapter.pyGeneral-purpose poll adapter
base_geo_adapter.pyGeo-data feed adapter (inherits standard geo-data processing)
base_webhook_handler.pyReal-time webhook receiver

Sync Engine

The sync engine handles create/update operations with built-in safety:

  • Idempotent creates — duplicate data is detected and skipped using external ID mapping
  • Conflict resolution — configurable strategy for handling concurrent updates (last-write-wins, manual review)
  • External ID mapping — each synced record maintains a mapping between the Powoflow resource ID and the external system's ID for bidirectional tracking
warning

When building custom adapters, always implement idempotency. The sync engine supports this via external ID lookups — check for an existing mapping before creating a new resource.


SDKs & Libraries

Current Status

There is no official Powoflow SDK at this time. The recommended approach is to use the OpenAPI specification to generate client libraries in your language of choice.

Generating a Client

  1. Download the OpenAPI spec from the Swagger UI (/docs endpoint)
  2. Use a code generator such as OpenAPI Generator or Swagger Codegen
  3. Generate a client in your preferred language (Python, TypeScript, Java, Go, C#, etc.)
# Example: generate a TypeScript client
openapi-generator-cli generate \
-i https://api.powoflow.com/docs/openapi.json \
-g typescript-fetch \
-o ./powoflow-client

Authentication Libraries

PlatformLibraryUsage
Flutterauth0_flutterMobile app authentication with PKCE
Next.js@auth0/nextjs-auth0 v4Server-side and client-side authentication
GenericAny OAuth2/OIDC libraryUse the Auth0 domain and PKCE flow
tip

When generating API clients, configure the base URL to point to your environment (api.dev1.powoflow.com for development, api.powoflow.com for production) and set up an interceptor to attach the Authorization: Bearer header to all requests.