Skip to main content

API Reference

FacilFlow REST API documentation.

Base URL

https://api.flow.facilis.ai/api

Development: http://localhost:3002/api

Authentication

All API requests require a Firebase JWT token:

Authorization: Bearer <firebase-jwt-token>

Pipelines

List Pipelines

GET /pipelines

Response:

{
"pipelines": [
{
"id": "pipeline-123",
"name": "Temperature Monitoring",
"status": "running",
"nodes": 3,
"createdAt": "2024-01-15T12:00:00Z"
}
],
"total": 1
}

Create Pipeline

POST /pipelines
Content-Type: application/json

{
"name": "My Pipeline",
"description": "Pipeline description",
"nodes": []
}

Start Pipeline

POST /pipelines/:id/start

Stop Pipeline

POST /pipelines/:id/stop

Query Pipeline Data

GET /pipelines/:id/data?start=-1h&aggregation=1m

Agents

List Agents

GET /agents

Get Agent Status

GET /agents/:id/status

Restart Agent

POST /agents/:id/restart

Catalog

List Data Sources

GET /catalog/sources

List Source Tags

GET /catalog/sources/:id/tags

Query Data

POST /catalog/query
Content-Type: application/json

{
"sourceId": "pi-server-1",
"tags": ["TI-101", "PI-102"],
"startTime": "-24h",
"endTime": "now",
"aggregation": "5m"
}

Object Storage

List Buckets

GET /buckets

Response:

{
"buckets": [
{
"name": "data-lake",
"creationDate": "2024-01-15T12:00:00Z"
}
]
}

Create Bucket

POST /buckets
Content-Type: application/json

{
"name": "my-bucket"
}

Delete Bucket

DELETE /buckets/:name

List Objects

GET /buckets/:name/objects?prefix=folder/

Response:

{
"bucket": "my-bucket",
"prefix": "folder/",
"objects": [
{
"name": "folder/file.csv",
"size": 1024,
"lastModified": "2024-01-15T12:00:00Z",
"etag": "abc123",
"isFolder": false
}
]
}

Upload Object

POST /buckets/:name/objects
Content-Type: multipart/form-data

file: <binary>
key: folder/file.csv (optional)

Delete Object

DELETE /buckets/:name/objects/:key

Get Download URL

GET /buckets/:name/objects/:key/url?expiry=3600

Response:

{
"url": "https://storage.example.com/bucket/file?signature=..."
}

Storage Providers

List Providers

GET /storage/providers

Response:

[
{
"id": "default-minio",
"name": "Local MinIO",
"type": "minio",
"endpoint": "localhost",
"port": 9000,
"isDefault": true,
"createdAt": "2024-01-15T12:00:00Z"
}
]

Get Supported Types

GET /storage/providers/types

Response:

["minio", "s3", "azure-blob", "gcs"]

Create Provider

POST /storage/providers
Content-Type: application/json

{
"name": "AWS Production",
"type": "s3",
"endpoint": "s3.amazonaws.com",
"region": "us-east-1",
"credentials": {
"accessKey": "AKIA...",
"secretKey": "..."
},
"isDefault": false
}

Update Provider

PUT /storage/providers/:id
Content-Type: application/json

{
"name": "Updated Name",
"isDefault": true
}
warning

Provider type cannot be changed after creation.

Delete Provider

DELETE /storage/providers/:id

Test Connection

POST /storage/providers/:id/test

Response:

{
"success": true,
"message": "Connection successful"
}

Health

Health Check

GET /health

Response:

{
"status": "healthy",
"version": "0.3.0",
"uptime": 3600
}