API Overview
The Factory AI API provides comprehensive REST interfaces for both the Prevent (maintenance management) and Predict (predictive maintenance) products.
Base URL
All API requests are made to your tenant's API endpoint:
https://api.<your-subdomain>.f7i.ai/prod
For example:
https://api.acme.f7i.ai/prod- Dedicated tenanthttps://api.app.f7i.ai/prod- Standard tenant
Authentication
All API endpoints require authentication using an API key. You can generate API keys from Settings > API Keys in the application. Include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY
When creating an API key, you can configure:
- Permissions: Read-only or Read/Write access
- Expiry Date: Optional expiration for temporary access (leave empty for production keys)
Your API key is only displayed once after creation - make sure to copy and store it securely.
Request/Response Format
- Content Type: All requests should use
application/json - Response Format: All responses are in JSON format
- HTTP Methods: Standard REST methods (GET, POST, PUT, DELETE)
CORS Support
The API supports Cross-Origin Resource Sharing (CORS) with the following configuration:
- Allowed Origins: All origins (
*) - Allowed Methods: All HTTP methods
- Allowed Headers:
Content-TypeX-Amz-DateAuthorizationX-Api-KeyX-Amz-Security-TokenX-Amz-User-AgentAccess-Control-Allow-OriginAccess-Control-Allow-HeadersAccess-Control-Allow-Methods
Error Handling
The API uses standard HTTP status codes:
- 200: Success
- 400: Bad Request - Invalid request format or parameters
- 401: Unauthorized - Authentication required or invalid
- 403: Forbidden - Insufficient permissions
- 404: Not Found - Resource doesn't exist
- 500: Internal Server Error
Error responses include a JSON object with error details:
{
"error": "Error message description",
"code": "ERROR_CODE",
"timestamp": "2024-01-01T00:00:00Z"
}
Rate Limiting
API requests are subject to rate limiting. If you exceed the rate limit, you'll receive a 429 Too Many Requests response.
Prevent Resources
The Prevent API provides endpoints for managing maintenance operations:
- Assets: Physical assets and equipment
- Components: Asset components and hierarchical structures
- Failure Codes: Equipment failure classification
- Maintenance Strategies: Maintenance approaches and procedures
- PM Procedures: Preventive maintenance procedures
- Work Orders: Maintenance work orders and tasks
- Parts: Spare parts and components
- Inventory: Parts inventory management
- Part Orders: Parts ordering and procurement
- Documents: Document management and storage
- Customer Settings: Customer configuration settings
- Schedules: Maintenance scheduling
Predict Resources
The Predict API provides endpoints for predictive analytics and sensor monitoring:
- Sensor Reports (Insights): AI-generated anomaly analysis reports
- Monitored Assets: Registry of assets being monitored by sensors
- Sensor Data: Time-series sensor readings (vibration, temperature, acceleration)
- Notifications: Predictive alerts and notifications
- FFT Data: Frequency analysis data from sensors
- Feedback: User feedback on predictions
- Metrics: System and asset metrics
- External Events: External event tracking
- Gateways: IoT gateway management
- Asset Resources Chat: Asset-related chat resources
Getting Started
- Generate API Key: Navigate to Settings > API Keys in the application to create your API key
- Choose Your Resource: Review the available endpoints for your use case
- Make Your First Request: Start with a simple GET request to list resources
- Handle Responses: Parse JSON responses and handle errors appropriately
Examples
Basic Request
curl -X GET "https://api.acme.f7i.ai/prod/assets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Creating a Resource
curl -X POST "https://api.acme.f7i.ai/prod/assets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Pump A1",
"type": "Centrifugal Pump",
"location": "Building 1"
}'