REST API reference
Build any integration. Bearer-key auth with per-resource scopes, JSON in / JSON out, signed outbound webhooks. Custom-store devs: load history with the bulk v1 API and send live changes through Event ingestion — one endpoint for every business event.
Base URL
https://flowgration.comFormat
application/jsonAuth
Bearer sk_live_…Authentication
Every authenticated request must include an Authorization header with a Bearer key in the format sk_live_…. Generate one from Settings → Team & Access → API Keys in your workspace, or visit /app/api-keys directly.
Authorization: Bearer sk_live_d3f8a5e6b9c… Content-Type: application/json
How keys work
- Keys are 32 random bytes prefixed with
sk_live_; only a SHA-256 hash is stored server-side. - The full value is shown once at creation — store it in your secret manager immediately.
- Scopes limit what a key can do:
readorwritefor the whole data API, or one per resource such as contacts:write. See Scopes below. The bridge converts your key into a 5-minute JWT internally on every call. - You can soft-revoke (and later un-revoke) keys via the UI or
PATCH /api/api-keys/{id}(signed-in session). - Keys are revoked instantly when the issuing user is deleted, deactivated, or the workspace is cancelled.
- Free plan: 1 active key. Paid plans: unlimited.
Create a key programmatically
curl -X POST "https://flowgration.com/api/api-keys" \
-H "Authorization: Bearer <session-JWT-of-an-owner-or-admin>" \
-H "Content-Type: application/json" \
-d '{"name":"My custom store","scopes":["contacts:write","orders:write","schema:write"]}'
# 201 response — copy the "key" field NOW, you cannot retrieve it again.
{ "id": 7, "name": "My custom store", "prefix": "sk_live_d3f",
"scopes": ["contacts:write","orders:write","schema:write"],
"revoked": false, "key": "sk_live_d3f8a5e6b9c…" }Creating, listing and revoking keys needs a signed-in session of an owner or admin (Settings → API keys). A key cannot manage keys. Creation is limited to 10 per hour per organization.
Scopes and permissions
Every key carries a list of scopes, chosen when you create it. A request is allowed only when the key holds the scope for the resource it touches. The scope is read for GET and write for every other method; analytics and export are read-only whatever the method.
Scope model
- Coarse scopes:
readlets the key read (GET) every resource below;writelets it write (POST, PUT, PATCH, DELETE) every resource below. - Per-resource scopes:
<resource>:read/<resource>:writegrant access to one resource only, for example contacts:write (create and update contacts) or invoices:read (read invoices). Prefer these: a key that only syncs orders should hold orders:write and nothing else. - Admin endpoints are never reachable with a key. Team, billing, plan, settings, SSO, audit log, API keys, inbox, HR, AI and superadmin routes answer 403 insufficient_scope even if the key holds
admin(accepted for compatibility, it grants nothing extra). - Legacy keys: keys created before scopes were enforced keep working as read + write over the whole data API, whatever scopes they show. They lose access to the admin endpoints above. Create a new key with narrower scopes and revoke the old one.
- A key acts as the user who created it: that user's module and section permissions and record visibility also apply to every request.
Resources and the paths they cover
| Scope resource | What it covers | Paths |
|---|---|---|
contacts:readcontacts:write | Contacts, imports and duplicates | /api/v1/contacts, /api/entity/contact, /api/import, duplicates |
companies:readcompanies:write | Companies | /api/companies |
deals:readdeals:write | Opportunities and pipelines | /api/pipelines, /api/entity/opportunity |
activities:readactivities:write | Activities | /api/activities, /api/entity/activity |
tasks:readtasks:write | Workspace tasks and projects | /api/workspace |
orders:readorders:write | Orders, products and subscriptions | /api/v1/orders, /api/orders, /api/products, /api/unified-products, /api/import/orders, /api/entity/orders, subscriptions |
bookings:readbookings:write | Bookings | /api/bookings |
invoices:readinvoices:write | Invoices and proformas | /api/invoicing |
sales:readsales:write | Quotes, sales orders and delivery notes | /api/sales |
treasury:readtreasury:write | Treasury | /api/treasury |
schema:readschema:write | Custom fields (schema) | /api/v1/schema, /api/schema |
campaigns:readcampaigns:write | Marketing campaign records | /api/campaign |
flow:readflow:write | Journeys, segments and mass sends | /api/flow |
analytics:readanalytics:write | Analytics (read only) | /api/analytics, /api/dashboard |
export:readexport:write | Data export (read only) | /api/export |
media:readmedia:write | Media library | /api/media |
plugin:readplugin:write | Plugin / integration sync | /api/plugin |
crm:readcrm:write | Other CRM data (search, stats) | /api/search, /api/entity (other) |
List the scopes a key can be given
curl "https://flowgration.com/api/api-keys/scopes" \
-H "Authorization: Bearer <session-JWT>"
# 200
{ "coarse": ["read", "write"],
"resources": [
{ "resource": "contacts", "description": "Contacts, imports and duplicates" },
{ "resource": "invoices", "description": "Invoices and proformas" },
… ] }When a scope is missing
The response names the scope the request needed, so you can add it to a new key.
# a key with only "contacts:read" calling POST /api/v1/contacts/batch
{ "error": "insufficient_scope",
"required_scope": "contacts:write",
"message": "This API key lacks the "contacts:write" scope." }
# any key calling an admin endpoint such as /api/team or /api/organization
{ "error": "insufficient_scope",
"message": "API keys cannot access this endpoint. Use a signed-in session." }/api/api-keys/scopesList the resources a new key can be scoped to. Requires a signed-in session.
curl -X GET "https://flowgration.com/api/api-keys/scopes" \ -H "Authorization: Bearer sk_live_…"
/api/api-keysCreate a key. Pass scopes as coarse (read, write) and/or per resource (contacts:write). Unknown scopes return 400 invalid_scopes. The full key is returned once. Requires a signed-in session.
curl -X POST "https://flowgration.com/api/api-keys" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"name": "Orders sync",
"scopes": [
"orders:write",
"contacts:write"
]
}'AI assistants (MCP connector)
Flowgration is a remote MCP server (Model Context Protocol), so Claude, ChatGPT, Cursor and any MCP client can work with your CRM. It speaks the Streamable HTTP transport (JSON-RPC 2.0 over POST) at the URL below.
Server URL
https://app.flowgration.com/mcp
- claude.ai and ChatGPT: add the URL as a custom connector. You sign in to Flowgration and approve access (OAuth 2.1 with PKCE and dynamic client registration). The assistant acts as you, with your role and permissions.
- Claude Code, Cursor, scripts: send a normal API key as a bearer token. The key's scopes decide which tools are offered.
- Same rules as the REST API: data is always scoped to your organization, your plan's daily API limit applies (one request per tool call) and every write is recorded in the audit log.
- Tools: search_contacts, get_contact, create_contact, update_contact, add_note, get_pipeline, list_deals, create_deal, update_deal_stage, list_tasks, create_task, search_conversations, get_conversation, list_invoices, get_account_summary.
- There are no tools to send emails or messages, start journeys or delete data. Inbox tools are available only with the OAuth sign-in, never with API keys.
Add it to Claude Code
claude mcp add --transport http flowgration https://app.flowgration.com/mcp \ --header "Authorization: Bearer sk_live_…"
Bulk import API (v1)
For systems that connect by API without a plugin (ERP, custom store, in-house app). Send up to 500 records per call; re-sending the same records updates them instead of duplicating. Unknown fields are kept and created as custom fields automatically, so your CRM takes the shape of your data.
- GET /api/v1/me — connection test: organization, plan, record counts and current custom fields.
- POST /api/v1/schema — declare your custom fields per entity (contact, order, opportunity). Adds or updates, never deletes.
- POST /api/v1/contacts/batch — upsert contacts. Matched by external_id, then by email.
- POST /api/v1/orders/batch — upsert orders with line items. The customer becomes a contact and products are created from the line items. Amounts accept decimals (49.99) or *_cents integers.
Connection test
curl "https://flowgration.com/api/v1/me" -H "Authorization: Bearer sk_live_…"
# 200
{ "organization": { "id": 12, "name": "Acme", "plan": "crm_growth", "plan_status": "active" },
"user": { "id": 31, "email": "owner@acme.example" },
"counts": { "contacts": 1240, "orders": 5678, "products": 312 },
"fields": { "contact": [ … ], "opportunity": [ … ], "order": [ … ] },
"limits": { "max_batch": 500 } }curl -X POST "https://flowgration.com/api/v1/schema" \
-H "Authorization: Bearer sk_live_…" -H "Content-Type: application/json" \
-d '{
"contact": [
{"key": "loyalty_tier", "label": "Loyalty tier", "type": "select", "options": ["gold","silver"]},
{"key": "customer_since", "type": "date"}
],
"order": [{"key": "warehouse", "type": "text"}]
}'curl -X POST "https://flowgration.com/api/v1/contacts/batch" \
-H "Authorization: Bearer sk_live_…" -H "Content-Type: application/json" \
-d '{
"records": [
{"external_id": "CUST-1001", "email": "ana@example.com", "first_name": "Ana",
"last_name": "García", "phone": "+34600000000", "city": "Sevilla",
"tags": ["vip"], "loyalty_tier": "gold", "customer_since": "2021-03-14"}
]
}'
# 200 → { "created": 1, "updated": 0, "errors": 0, "fields_created": [],
# "results": [{ "index": 0, "id": 381, "status": "created" }] }
# 207 when some records failed, e.g.
# { "index": 3, "status": "error", "error": "plan contact limit reached (500)" }curl -X POST "https://flowgration.com/api/v1/orders/batch" \
-H "Authorization: Bearer sk_live_…" -H "Content-Type: application/json" \
-d '{
"records": [
{"external_id": "ORD-5531", "order_number": "5531",
"customer_email": "ana@example.com", "customer_name": "Ana García",
"financial_status": "paid", "currency": "EUR",
"total": 59.90, "subtotal": 49.90, "shipping": 10,
"placed_at": "2026-10-01T10:00:00Z",
"line_items": [{"sku": "TSHIRT-M", "name": "T-shirt", "quantity": 2, "unit_price": 24.95}],
"custom_fields": {"warehouse": "MAD"}}
]
}'Scopes: /me works with any valid key. /schema needs schema:write, /contacts/batch needs contacts:write and /orders/batch needs orders:write (or the coarse write scope).
Each call accepts up to 500 records (413 above that). New contacts respect your plan's contact limit: records over the limit come back with status error and the rest still land.
Bulk imports do not trigger journeys by default (a history import should never email thousands of people). Send "trigger_journeys": true to fire contact_created / order_created / order_paid for NEW records.
Response: 200 when every record succeeded, 207 when some failed — check results[] (index, id, status, error). One bad record never blocks the rest.
Event ingestion (the canonical entrypoint)
This is the endpoint a custom store should use for 95% of writes. One POST per business event — contact created, order placed, product updated, form submitted, cart abandoned. The platform handles upsert, deduplication and journey triggers automatically.
Idempotency. Pass an external_id (your store's stable ID for the entity, e.g. "wc-1234"). Repeats on the same (api_key, event, external_id) tuple within 24h return {"deduplicated": true} and do not re-fire journeys.
Full event catalogue
Anything outside this list is rejected with 400 unknown_event:
customer.created customer.updated customer.deleted order.created order.updated order.refunded order.return_requested order.return_approved order.return_declined order.return_cancelled order.return_closed cart.abandoned product.created product.updated product.deleted subscription.created subscription.updated subscription.cancelled subscription.renewed subscription.payment_failed booking.created booking.updated booking.cancelled form.submitted coupon.created coupon.updated coupon.deleted discount.created discount.updated discount.deleted membership.created membership.updated membership.cancelled review.created page.published page.updated store.updated fulfillment.created fulfillment.updated inventory.updated location.created location.updated location.deleted collection.created collection.updated collection.deleted metafield.created metafield.updated metafield.deleted plugin.heartbeat
/api/plugin/syncSubmit any event. Auth: Bearer sk_live_…
curl -X POST "https://flowgration.com/api/plugin/sync" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"event": "order.created",
"platform": "custom",
"external_id": "ORD-12345",
"data": {
"order_number": "ORD-12345",
"customer_email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+34 600 123 456",
"total": 49.99,
"currency": "EUR",
"payment_status": "paid",
"shipping_status": "processing",
"line_items": [
{
"product_id": 42,
"sku": "WIDGET-RED",
"name": "Red Widget",
"quantity": 1,
"price": 49.99
}
],
"billing_address": {
"address_1": "Calle Mayor 1",
"city": "Madrid",
"postcode": "28001",
"country": "ES"
},
"utm_source": "google",
"utm_campaign": "spring_sale"
}
}'/api/plugin/synccustomer.created — creates / upserts a Contact (email is the dedupe key).
curl -X POST "https://flowgration.com/api/plugin/sync" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"event": "customer.created",
"platform": "custom",
"external_id": "user_8801",
"data": {
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+34 600 123 456",
"phone_prefix": "+34",
"phone_number": "600123456",
"street": "Calle Mayor 1",
"city": "Madrid",
"country": "ES",
"postal_code": "28001",
"commercial_consent": true,
"tags": [
"newsletter"
],
"custom_fields": {
"loyalty_tier": "gold"
}
}
}'/api/plugin/syncproduct.created / product.updated — keeps the merchant's product catalogue mirrored.
curl -X POST "https://flowgration.com/api/plugin/sync" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"event": "product.updated",
"platform": "custom",
"external_id": "prod_42",
"data": {
"id": 42,
"sku": "WIDGET-RED",
"name": "Red Widget",
"description": "Premium red widget, 200g.",
"price": 49.99,
"currency": "EUR",
"image_url": "https://cdn.example.com/widget-red.jpg",
"stock": 120,
"status": "publish",
"categories": [
"widgets",
"red"
]
}
}'/api/plugin/synccart.abandoned — opens an Opportunity in stage 'cart' and fires the cart_abandoned journey trigger.
curl -X POST "https://flowgration.com/api/plugin/sync" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"event": "cart.abandoned",
"platform": "custom",
"external_id": "cart_9912",
"data": {
"customer_email": "jane@example.com",
"cart_total": 79.5,
"currency": "EUR",
"recovery_url": "https://store.example.com/cart?token=abc",
"line_items": [
{
"product_id": 42,
"name": "Red Widget",
"quantity": 1,
"price": 49.99
},
{
"product_id": 88,
"name": "Blue Widget",
"quantity": 1,
"price": 29.51
}
]
}
}'/api/plugin/syncform.submitted — lead capture from a marketing form. Honours your duplicate_handling policy.
curl -X POST "https://flowgration.com/api/plugin/sync" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"event": "form.submitted",
"platform": "custom",
"external_id": "submission_771",
"data": {
"form_id": "contact-us",
"form_name": "Contact us",
"form_url": "https://www.example.com/contact",
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+34 600 123 456",
"message": "Interested in your enterprise plan.",
"utm_source": "facebook",
"utm_campaign": "leadgen_q2"
}
}'/api/plugin/syncorder.refunded — flips payment_status and posts a refund activity.
curl -X POST "https://flowgration.com/api/plugin/sync" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"event": "order.refunded",
"platform": "custom",
"external_id": "ORD-12345",
"data": {
"order_number": "ORD-12345",
"refund_amount": 49.99,
"currency": "EUR",
"reason": "Customer return"
}
}'Order ingest (platform adapters)
If your store already speaks a known platform format (Shopify, WooCommerce, PrestaShop, Magento, BigCommerce, Wix…) you can dump the raw native payload at this endpoint and the matching adapter will translate it into Flowgration's canonical Order + Contact shape. Use this when you're bridging an existing webhook stream you can't reshape.
For custom stores that don't match any of those formats, prefer POST /api/plugin/sync with event: order.created(the section above) — it accepts the canonical shape directly.
/api/plugin/orders/{source}source = shopify | woocommerce | prestashop | magento | bigcommerce | wix | api | manual | csv_import
curl -X POST "https://flowgration.com/api/plugin/orders/shopify" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"id": 12345,
"order_number": "ORD-12345",
"email": "jane@example.com",
"total_price": "49.99",
"currency": "EUR",
"line_items": [
{
"product_id": 42,
"title": "Red Widget",
"quantity": 1,
"price": "49.99"
}
],
"billing_address": {
"first_name": "Jane",
"last_name": "Doe",
"address1": "Calle Mayor 1",
"city": "Madrid",
"zip": "28001",
"country": "ES"
}
}'Contacts (direct CRUD)
For most use-cases preferPOST /api/plugin/sync with customer.created — it auto-creates the matching Opportunity and fires journey triggers. These direct CRUD endpoints are for back-office tools, data migrations, or admin UIs.
First-class columns
first_name last_name email (dedupe key)
phone phone_prefix phone_number
street city country postal_code
website job_title company_name
age gender
form_id form_name form_url landing_page
referrer utm_source utm_medium utm_campaign
utm_term utm_content gclid
commercial_consent privacy_consent
owner_user_id tags ([str]) source_campaigns ([int])
custom_fields ({…}) notes/api/entity/contactList contacts (paginated). Supports ?page=N&page_size=M&search=jane.
curl -X GET "https://flowgration.com/api/entity/contact" \ -H "Authorization: Bearer sk_live_…"
/api/entity/contact/{id}Get one contact, hydrated with custom fields, source campaigns and owner.
curl -X GET "https://flowgration.com/api/entity/contact/1" \ -H "Authorization: Bearer sk_live_…"
/api/entity/contactCreate a contact. Auto-creates the contact's first Opportunity and fires contact_created + opportunity_created journey triggers.
curl -X POST "https://flowgration.com/api/entity/contact" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Ada",
"last_name": "Lovelace",
"email": "ada@example.com",
"phone": "+44 20 7946 0958",
"phone_prefix": "+44",
"phone_number": "2079460958",
"street": "12 St James's Square",
"city": "London",
"country": "GB",
"postal_code": "SW1Y 4LE",
"commercial_consent": true,
"custom_fields": {
"loyalty_tier": "gold",
"source_store": "uk-online"
},
"source_campaigns": [
42
]
}'/api/entity/contact/{id}Update fields. Send only what changes. Partial custom_fields merges with what's stored.
curl -X PATCH "https://flowgration.com/api/entity/contact/1" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"phone": "+44 20 7946 9999",
"custom_fields": {
"loyalty_tier": "platinum"
}
}'/api/entity/contact/{id}Permanently delete the contact and everything attached to it (opportunities, activities, journey runs). This cannot be undone.
curl -X DELETE "https://flowgration.com/api/entity/contact/1" \ -H "Authorization: Bearer sk_live_…"
Opportunities (deals & pipeline)
An Opportunity is a deal / pipeline record attached to a contact. Every contact has at least one. Stages come from the active pipeline configured in Customize CRM; open | won | lost and is derived from the stage's flags unless you set it explicitly.
/api/entity/opportunityList deals.
curl -X GET "https://flowgration.com/api/entity/opportunity" \ -H "Authorization: Bearer sk_live_…"
/api/entity/opportunityCreate a deal linked to a contact.
curl -X POST "https://flowgration.com/api/entity/opportunity" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"contact_id": 1,
"title": "Q4 enterprise license",
"stage": "proposal",
"value": 12500,
"owner_user_id": 3,
"custom_fields": {
"competitor": "Acme",
"expected_close": "2026-08-31"
}
}'/api/entity/opportunity/{id}Move stage, set value, change owner. Fires opportunity.stage_changed for outbound webhooks.
curl -X PATCH "https://flowgration.com/api/entity/opportunity/1" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"stage": "won",
"value": 14000
}'/api/entity/opportunity/{id}Delete a deal. If it was the contact's only opportunity, a fresh empty one is created automatically.
curl -X DELETE "https://flowgration.com/api/entity/opportunity/1" \ -H "Authorization: Bearer sk_live_…"
Activities (timeline)
Activities are timeline events on a contact / opportunity — calls, emails, notes, meetings, purchases, journey steps. Use this to log anything that should appear in the contact's history without being a CRM mutation.
/api/entity/activityList activities. Filterable by ?contact_id, ?opportunity_id, ?type, ?channel.
curl -X GET "https://flowgration.com/api/entity/activity" \ -H "Authorization: Bearer sk_live_…"
/api/entity/activityLog an activity attached to a contact or opportunity.
curl -X POST "https://flowgration.com/api/entity/activity" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"contact_id": 1,
"type": "call",
"channel": "phone",
"title": "Discovery call",
"note": "Interested in the Plus plan. Follow up next Tuesday.",
"status": "completed",
"activity_metadata": {
"duration_seconds": 1820,
"recording_url": "https://…"
}
}'Orders (first-class + legacy Opportunity-backed)
Flowgration exposes orders on two surfaces:
/api/orders— the first-class Order table (LTV, revenue, exports). Use these for reads./api/entity/orders— the legacy Opportunity-backed surface, kept for the existing journey + segment engine.
For writes from a custom store, do not POST to either directly — usePOST /api/plugin/sync with event: order.created so both surfaces stay in sync and the order_paid / order_created journey triggers fire correctly.
/api/ordersList orders from the first-class Order table.
curl -X GET "https://flowgration.com/api/orders" \ -H "Authorization: Bearer sk_live_…"
/api/orders/{order_id}Hydrated order detail (line items, addresses, refunds).
curl -X GET "https://flowgration.com/api/orders/1" \ -H "Authorization: Bearer sk_live_…"
/api/entity/ordersDirect create on the Opportunity-backed surface (rarely used; prefer /api/plugin/sync).
curl -X POST "https://flowgration.com/api/entity/orders" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"contact_id": 1,
"order_number": "INV-1234",
"total": 129.99,
"currency": "EUR",
"payment_status": "paid",
"items": [
{
"name": "Tea",
"qty": 2,
"price": 14.99
}
]
}'/api/entity/orders/{order_id}Update payment / shipping status. Fires order_paid trigger on transition to 'paid'.
curl -X PATCH "https://flowgration.com/api/entity/orders/1" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"payment_status": "paid",
"shipping_status": "delivered",
"tracking_number": "ABCD1234"
}'Products
/api/productsList products mirrored into Flowgration.
curl -X GET "https://flowgration.com/api/products" \ -H "Authorization: Bearer sk_live_…"
/api/products/{product_id}Get one product.
curl -X GET "https://flowgration.com/api/products/1" \ -H "Authorization: Bearer sk_live_…"
/api/products/{product_id}/ordersOrders that contain this product.
curl -X GET "https://flowgration.com/api/products/1/orders" \ -H "Authorization: Bearer sk_live_…"
Custom fields (per-entity schema)
Custom fields are defined per entity type and stored as JSON on every row. The entity_type catalogue is fixed (typos return 400):
contact opportunity order activity booking campaign product activity_types
Important — the order vs opportunity split. Until launch, orders were a sub-shape of Opportunity, so the two shared a custom-field schema. Post-launch they are distinct surfaces: an "order_priority" field on order does not appear on opportunity, even though both surfaces accept the same system-mapped fields (sku, total, currency…). Pick the entity_type that matches where the field belongs.
Custom field values are written via the custom_fields object on the entity itself (e.g. POST /api/entity/contact with custom_fields: {loyalty_tier: "gold"}). The endpoints below let you read / write the schema (which fields exist, what types they have, what options they offer).
/api/schema/{entity_type}List custom field definitions for the entity.
curl -X GET "https://flowgration.com/api/schema/contact" \ -H "Authorization: Bearer sk_live_…"
/api/schema/{entity_type}/system-fieldsRead-only list of platform-mapped system fields (sku, total, currency…). Useful for showing 'already captured' chips in your UI.
curl -X GET "https://flowgration.com/api/schema/contact/system-fields" \ -H "Authorization: Bearer sk_live_…"
/api/schema/{entity_type}Replace the whole schema for the entity. Admin/edit access only.
curl -X PUT "https://flowgration.com/api/schema/contact" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"key": "loyalty_tier",
"label": "Loyalty tier",
"type": "select",
"options": [
"bronze",
"silver",
"gold",
"platinum"
]
},
{
"key": "lifetime_value_eur",
"label": "LTV (EUR)",
"type": "number"
}
]
}'Field mapping (custom-store inbound)
When your store doesn't run through the plugin you have two ways to map inbound fields onto Flowgration's contact / order columns:
- Send the canonical names directly. The
POST /api/plugin/syncendpoint accepts the field names listed in the Contacts and Event ingestion sections above (e.g.first_name,email,phone,order_number,total,currency). Anything unrecognised goes intocustom_fieldson the matching entity — nothing is dropped. - Persist a mapping_config server-side. Each integration row in
/app/integrationscarries amapping_configJSON object:{ "form_field_x": "first_name", "loyalty": "custom_fields.loyalty_tier" }. Dot-paths target custom field keys. The plugin uses this — a custom integration can store the same shape and apply it client-side before POSTing canonical payloads.
The system fields that are always mapped automatically (you don't need to declare them) come from GET /api/schema/contact/system-fields for contacts and GET /api/schema/order/system-fields for orders. Common aliases (billing_address.first_name, shipping_address.postcode…) are recognised out of the box.
Journey triggers
Journeys (automations) start automatically from the events you send. There is no manual enroll endpoint today — the platform fires the matching trigger inside the relevant route. Triggers that fire from API ingestion:
contact_created ← POST /api/entity/contact
← customer.created (via /api/plugin/sync)
opportunity_created ← POST /api/entity/opportunity
← created automatically with every new contact
opportunity_stage_change ← PATCH /api/entity/opportunity/<id> (when 'stage' differs)
order_created ← order.created (via /api/plugin/sync)
order_paid ← order.updated → payment_status='paid'
← order.created with payment_status='paid'
order_status_changed ← order.updated / store sync when the order status changes
order_refunded ← order.refunded
cart_abandoned ← cart.abandoned
form_submission ← form.submitted
campaign_member ← contact created with source_campaigns: [id]Bulk v1 calls fire journeys only when you send trigger_journeys: true. order_status_changed fires when an order's normalised status changes (for example processing to shipped) after an order.updated event or a store sync; historical imports never fire it.
The journey engine runs asynchronously: the API response returns immediately after the event is persisted; trigger evaluation happens in-process within milliseconds. To verify a run, query the contact timeline:
curl "https://flowgration.com/api/entity/contact/1/timeline" \ -H "Authorization: Bearer sk_live_…"
Plugin onboarding (magic link)
/api/plugin/onboarding/initiatePublic. Auto-mode: send a magic link to the store admin (rate-limited per IP). Connect-mode: attach a fresh plugin install to an existing org via api_key.
curl -X POST "https://flowgration.com/api/plugin/onboarding/initiate" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"platform": "woocommerce",
"platform_version": "8.5.0",
"store": {
"name": "Acme",
"url": "https://acme.example",
"currency": "EUR"
},
"admin": {
"email": "owner@acme.example",
"name": "Jane"
},
"schema": {
"customers": {
"count": 1234,
"fields": [
"email",
"phone",
"billing_address"
]
},
"orders": {
"count": 5678
}
}
}'/api/plugin/onboarding/verify?token={token}Public magic-link landing. Creates Org + User + CRM, mints an API key, redirects to /plugin-callback.
Outbound webhooks
Register HTTPS endpoints in Settings → Webhooks (or via POST /api/webhook-endpoints) to receive events in real time. Every payload carries three headers:
Endpoints are managed from the app (or with a signed-in session). API keys cannot create or change webhook endpoints.
X-Flowgration-Event: order.paid X-Flowgration-Timestamp: 1735000000 X-Flowgration-Signature: sha256=8f3b…d12c
How to verify a signature
Compute HMAC-SHA256(secret, "<timestamp>." + raw_body) and constant-time-compare against the sha256=… value. Reject if the timestamp is older than 5 minutes ( 300s) — that's Flowgration's replay window.
import hmac, hashlib, time
from flask import request, abort
SECRET = b"…" # the hex signing secret from Settings → Webhooks → Reveal secret
@app.post("/flowgration/webhook")
def receive():
ts = request.headers.get("X-Flowgration-Timestamp", "")
sig = request.headers.get("X-Flowgration-Signature", "").removeprefix("sha256=")
body = request.get_data() # raw bytes — DO NOT json.loads first
if abs(time.time() - int(ts)) > 300:
abort(401, "stale")
signed = ts.encode() + b"." + body
expected = hmac.new(SECRET, signed, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, sig):
abort(401, "bad signature")
event = request.headers["X-Flowgration-Event"]
payload = request.get_json()
# … handle event …
return "", 200const crypto = require("crypto");
const SECRET = process.env.FG_WEBHOOK_SECRET; // the hex signing secret (Reveal secret)
app.post("/flowgration/webhook",
express.raw({ type: "application/json" }), // raw body required
(req, res) => {
const ts = req.get("X-Flowgration-Timestamp");
const sig = (req.get("X-Flowgration-Signature") || "").replace(/^sha256=/, "");
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.status(401).end();
const expected = crypto.createHmac("sha256", SECRET)
.update(`${ts}.`).update(req.body).digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig))) {
return res.status(401).end();
}
const event = req.get("X-Flowgration-Event");
const payload = JSON.parse(req.body.toString("utf8"));
// … handle event …
res.status(200).end();
});Available events
contact.created·contact.updatedopportunity.created·opportunity.stage_changedorder.created·order.paid·order.shippedtask.created·task.completedjourney.completed·journey.failedweb.session_started·web.page_viewed·web.identified·web.custom_event
Website tracking events
The four web.* events come from the website tracker. web.page_viewed is only sent for the paths you list in the site settings. They are signed and retried like every other event, and need the Web analytics feature of your plan. The tracker endpoint itself is internal: install the snippet instead of calling it.
{
"event": "web.page_viewed",
"occurred_at": "2026-11-09T10:15:00Z",
"site": { "id": 4, "name": "flowgration.example" },
"visitor": { "uid": "v_8c1f…", "contact_id": 381 },
"path": "/pricing",
"title": "Pricing",
"referrer_host": "google.com",
"utm": { "source": "google", "medium": "cpc", "campaign": "spring" }
}{
"event": "web.custom_event",
"occurred_at": "2026-11-09T10:16:20Z",
"site": { "id": 4, "name": "flowgration.example" },
"visitor": { "uid": "v_8c1f…", "contact_id": null },
"name": "pricing_toggle",
"properties": { "plan": "growth" }
}{
"event": "web.identified",
"occurred_at": "2026-11-09T10:18:02Z",
"site": { "id": 4 },
"visitor": { "uid": "v_8c1f…", "contact_id": 381 },
"contact": { "id": 381 },
"via": "form",
"first_seen_at": "2026-11-02T08:01:11Z",
"sessions": 3,
"page_views": 9
}Retries: 3 attempts with exponential backoff (0.5s, 1s, 2s). Endpoints that return non-2xx (or time out at 10s) three times in a row are auto-disabled. Outbound URLs are SSRF-protected: localhost, RFC1918, link-local and cloud-metadata addresses are refused at create-time and at dispatch-time.
/api/webhook-endpointsList your registered endpoints.
curl -X GET "https://flowgration.com/api/webhook-endpoints" \ -H "Authorization: Bearer sk_live_…"
/api/webhook-endpointsRegister a new endpoint. Returns the signing secret ONCE.
curl -X POST "https://flowgration.com/api/webhook-endpoints" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"url": "https://store.example.com/flowgration/webhook",
"events": [
"order.paid",
"order.shipped",
"contact.created"
],
"description": "Order + contact bridge",
"active": true
}'/api/webhook-endpoints/{id}Update events, URL or active flag.
curl -X PUT "https://flowgration.com/api/webhook-endpoints/1" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"active": false
}'/api/webhook-endpoints/{id}Delete the endpoint and its delivery history.
curl -X DELETE "https://flowgration.com/api/webhook-endpoints/1" \ -H "Authorization: Bearer sk_live_…"
/api/webhook-endpoints/{id}/rotate-secretMint a new HMAC secret. The previous one is invalidated immediately.
curl -X POST "https://flowgration.com/api/webhook-endpoints/1/rotate-secret" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{}'/api/webhook-endpoints/{id}/testFire a synthetic webhook.test event so you can verify signing end-to-end.
curl -X POST "https://flowgration.com/api/webhook-endpoints/1/test" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{}'/api/webhook-endpoints/{id}/deliveriesLast delivery attempts (status, response excerpt, attempt number).
curl -X GET "https://flowgration.com/api/webhook-endpoints/1/deliveries" \ -H "Authorization: Bearer sk_live_…"
Form intake (any form tool)
Any form builder, landing page or script that can send an HTTP request can feed your CRM. For JotForm itself use the dedicated integration, which registers the webhook for you; for everything else there are two options.
Option 1: form webhook (no API key)
POST the answers as JSON to your private form address. The contact is created or updated by email, a Form submission entry is added to its timeline, it gets an opportunity if it has none, and every journey whose trigger is Form submission starts (filter by form_id; the form_name and fields are available to the journey).
Your address is /api/webhook/form/<token>. Copy it in the app under Connected apps, JotForm, Other form tools, or read it with GET /api/webhook/token (signed-in session). POST /api/webhook/token generates a new token and invalidates the old address. The token is a secret: send from a server or from a form tool's webhook settings, and regenerate it if it leaks.
curl -X POST "https://app.flowgration.com/api/webhook/form/<your_webhook_token>" \
-H "Content-Type: application/json" \
-d '{
"email": "ana@example.com",
"first_name": "Ana",
"last_name": "García",
"phone": "+34 600 000 000",
"form_name": "Contact form",
"form_id": "contact-1",
"form_url": "https://example.com/contact",
"source_channel": "website",
"utm_source": "google", "utm_medium": "cpc", "utm_campaign": "spring",
"fields": { "message": "I would like a quote", "budget": "5000" }
}'
# 201 new contact / 200 existing contact
# { "status": "ok", "contact_id": 381, "is_new_contact": true,
# "opportunity_id": 90, "activity_id": 4012 }
# 400 { "error": "email is required" } 401 { "error": "Invalid webhook token" }Body fields
email (required, the dedupe key) first_name last_name phone
form_name (timeline + journeys) form_id (journeys can filter on it) form_url
source_channel utm_source utm_medium utm_campaign
fields ({ any extra answers, stored as custom fields on the contact })
fg_vid (optional: the visitor id from the website tracker, links the visit history to the contact; never stored as a field)Tools such as Typeform, Tally or Google Forms post their own payload format, not this JSON. Point them at a small relay (Zapier, Make, n8n or a function of your own) that maps their answers to the body above.
Option 2: batch contacts API (API key)
With an API key that has the contacts:write scope, POST up to 500 contacts at once. It is idempotent (matched by external_id, then email) and, by default, does not fire journeys, so it is the right tool for imports. Add "trigger_journeys": true if you want them to run.
curl -X POST "https://flowgration.com/api/v1/contacts/batch" \
-H "Authorization: Bearer sk_live_…" -H "Content-Type: application/json" \
-d '{ "records": [
{ "email": "ana@example.com", "first_name": "Ana", "tags": ["web-form"],
"message": "I would like a quote" }
] }'Public marketing form (no auth)
A no-auth endpoint for landing-page contact forms. Throttled to 5 submissions per IP per 10 minutes; honeypot field hp_company_url silently drops bots.
/api/contact-form/submitPublic, no Authorization header required.
curl -X POST "https://flowgration.com/api/contact-form/submit" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane",
"last_name": "Doe",
"email": "jane@example.com",
"phone": "+34 600 123 456",
"subject": "Enterprise enquiry",
"body": "Tell me about pricing for 50 seats.",
"callback_requested": true,
"source_page": "/pricing",
"source_cta": "pricing_enterprise_cta"
}'Rate limits, pagination & errors
Rate limits
The default limit is 200 requests per minute. It is counted per user: a key counts against the user who created it, so several keys from the same person share one budget. Headers on every response tell you where you are:
X-RateLimit-Limit: 200 # max calls allowed per minute X-RateLimit-Remaining: 164 # calls left in the current window X-RateLimit-Reset: 1735000060 # unix-seconds when the window resets
Exceeding the limit returns 429 Too Many Requests with a Retry-After header (seconds). Specific public endpoints have additional throttles: /api/plugin/onboarding/initiate is capped at 30 calls per IP per hour; /api/contact-form/submit at 5 per IP per 10 minutes.
Pagination
List endpoints accept ?page=N&limit=M with defaults page=1, limit=50. The response envelope:
{
"items": [ … ],
"page": 1,
"limit": 50,
"total": 1247
}For very large pulls, narrow the result set server-side with ?search= (and the other list filters) instead of deep paging — high page numbers are allowed but slower.
Error model
All errors return JSON in the form:
{ "error": "code", "message": "Human-readable description" }| HTTP | When you'll see it |
|---|---|
400 | Bad request — body invalid, unknown event, unknown entity_type, or missing required field |
401 | Missing / invalid / revoked Bearer key, or stale webhook timestamp |
402 | Plan limit reached (e.g. max_contacts, max_api_keys) — upgrade required |
403 | Authenticated but the key/user lacks the module permission, the key lacks the required scope (insufficient_scope), the endpoint is not available to API keys, or the IP allowlist denied |
404 | Not found, or filtered out by record_visibility for member-role users |
409 | Integration paused (sync events refused until resumed) |
413 | Payload too large (256 KB cap on plugin schema) |
429 | Rate-limited — back off and honour Retry-After |
500 | Server error — contact support@flowgration.com if persistent |
SDKs & Plugins
First-party plugins live in their own repository — they're the easiest way to connect a store to Flowgration without writing API code:
- • WordPress / WooCommerce — auto-build CRM + runtime sync via WP hooks
- • Shopify — Embedded App with OAuth + native webhook bridge
- • Coming soon: PrestaShop, Wix, BigCommerce, Magento, Squarespace, Webflow, Ghost, Typeform
Need a platform that's not on the list? Roll your own using this REST API — every plugin in our monorepo is open source, follows the same shared spec (github.com/jaimearribas1/flowgration-plugins), and can be forked as a starting point.
Get an API key in 30 seconds
Generate a sk_live_ key from your workspace, set scopes, and start integrating.
Start free trial