Reference
API & Sending Data
Beyond uploading CSV files, you can send event data to Flow Myna programmatically—straight from your applications, ETL pipelines, and integrations—for continuous, real-time process monitoring.
Why Use the API?
CSV upload is perfect for analyzing historical data. The API is for keeping Flow Myna up to date as your process runs:
- Push events the moment they happen in your systems
- Monitor processes continuously instead of in batches
- Combine live data with historical CSV imports in the same dataset
If you can emit an event when something happens—an order is placed, a ticket is resolved, an invoice is paid—you can stream your process into Flow Myna.
Step 1: Create an API Key
- Go to Workspace → Data → API Keys (under the Integrations section)
- Click Create API Key
- Enter a name (e.g., "Production ETL")
- Choose a dataset: Create new (default, auto-named) or Use existing
- Copy the key immediately—it's only shown once
The dataset you choose is where events from this key will land.
Keep Your Key Secret
An API key can write data to your workspace. Store it as a secret (environment variable or secrets manager) and never commit it to source control or expose it in client-side code.
Step 2: Authenticate
Include your API key in the Authorization header on every request:
Authorization: Bearer fm_live_xxxxx
Or use the custom header:
X-FlowMyna-Api-Key: fm_live_xxxxx
The base URL is https://api.flowmyna.com/v1.
Step 3: Send Events
The simplest call records a single event and the objects it touches. Objects are auto-created if they don't exist yet—the dataset is determined by your API key.
curl -X POST 'https://api.flowmyna.com/v1/event' \
-H 'Authorization: Bearer fm_live_your_key_here' \
-H 'Content-Type: application/json' \
-d '{
"event": "Order Placed",
"timestamp": "2024-01-15T10:30:00Z",
"objects": [
{"type": "Order", "id": "ORD-123"},
{"type": "Customer", "id": "CUST-456"}
],
"properties": {
"total": 149.99,
"items_count": 3
}
}'
That event is now in Flow Myna and will appear in your process map.
Usage Patterns
Pattern 1: Events Only (Simplest)
Just send events—objects are created automatically, and you can include object properties inline (they're merged if the object already exists):
curl -X POST '.../v1/event' \
-d '{
"event": "Ticket Created",
"objects": [
{"type": "Ticket", "id": "TKT-123", "properties": {"priority": "high"}}
]
}'
Pattern 2: Upsert Objects, Then Record Events (Richer Data)
For processes with rich object data, pre-register objects with their properties, then reference them in events:
# Register the customer once
curl -X POST '.../v1/object/upsert' \
-d '{
"type": "Customer",
"id": "CUST-456",
"properties": { "name": "Jane Doe", "tier": "gold", "lifetime_value": 5420.00 }
}'
# Then record events that reference it
curl -X POST '.../v1/event' \
-d '{
"event": "Order Created",
"objects": [
{"type": "Order", "id": "ORD-789"},
{"type": "Customer", "id": "CUST-456"}
]
}'
/object/upsert uses upsert semantics—properties are merged, not replaced—so you can enrich an object over time.
Pattern 3: Batch (ETL & Data Pipelines)
For historical imports or scheduled syncs, send many records in one request (up to 100 per call) via /event/batch and /object/batch:
curl -X POST '.../v1/event/batch' \
-d '{
"events": [
{ "event": "Case Opened", "timestamp": "2024-01-01T09:00:00Z", "objects": [{"type": "Case", "id": "CASE-001"}] },
{ "event": "Case Closed", "timestamp": "2024-01-03T16:00:00Z", "objects": [{"type": "Case", "id": "CASE-001"}] }
]
}'
Endpoints at a Glance
| Endpoint | Purpose |
|---|---|
POST /v1/event | Record a single event (auto-creates objects) |
POST /v1/event/batch | Record up to 100 events in one request |
POST /v1/object/upsert | Create or update one object (merges properties) |
POST /v1/object/batch | Create or update up to 100 objects |
GET /v1/health | Check the API is reachable and your key is valid |
Client SDKs
Prefer your own language to raw HTTP? Official SDKs handle auth, batching, and retries for you:
- Python
- Node.js / TypeScript
- .NET
- Ruby
Each wraps the same endpoints above. Contact us for installation details and the latest versions.
Next Steps
- What Data Do You Need? - The events, timestamps, and IDs to send
- Uploading Your Data - Import historical data via CSV alongside the API
- Object-Centric Approach - How objects and events relate
Need API Access?
Create an API key from Workspace → Data → API Keys to get started, or contact us to discuss your integration and SDK setup.