Skip to main content
Developer documentation

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.com

Format

application/json

Auth

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.

HTTP
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: read or write for 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

POST /api/api-keys
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: read lets the key read (GET) every resource below; write lets it write (POST, PUT, PATCH, DELETE) every resource below.
  • Per-resource scopes: <resource>:read / <resource>:write grant 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 resourceWhat it coversPaths
contacts:read
contacts:write
Contacts, imports and duplicates/api/v1/contacts, /api/entity/contact, /api/import, duplicates
companies:read
companies:write
Companies/api/companies
deals:read
deals:write
Opportunities and pipelines/api/pipelines, /api/entity/opportunity
activities:read
activities:write
Activities/api/activities, /api/entity/activity
tasks:read
tasks:write
Workspace tasks and projects/api/workspace
orders:read
orders:write
Orders, products and subscriptions/api/v1/orders, /api/orders, /api/products, /api/unified-products, /api/import/orders, /api/entity/orders, subscriptions
bookings:read
bookings:write
Bookings/api/bookings
invoices:read
invoices:write
Invoices and proformas/api/invoicing
sales:read
sales:write
Quotes, sales orders and delivery notes/api/sales
treasury:read
treasury:write
Treasury/api/treasury
schema:read
schema:write
Custom fields (schema)/api/v1/schema, /api/schema
campaigns:read
campaigns:write
Marketing campaign records/api/campaign
flow:read
flow:write
Journeys, segments and mass sends/api/flow
analytics:read
analytics:write
Analytics (read only)/api/analytics, /api/dashboard
export:read
export:write
Data export (read only)/api/export
media:read
media:write
Media library/api/media
plugin:read
plugin:write
Plugin / integration sync/api/plugin
crm:read
crm:write
Other CRM data (search, stats)/api/search, /api/entity (other)

List the scopes a key can be given

GET /api/api-keys/scopes
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.

403 insufficient_scope
# 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." }
GET/api/api-keys/scopes

List the resources a new key can be scoped to. Requires a signed-in session.

curl
curl -X GET "https://flowgration.com/api/api-keys/scopes" \
  -H "Authorization: Bearer sk_live_…"
POST/api/api-keys

Create 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
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

POST /mcp
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 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

GET /api/v1/me
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 } }
POST /api/v1/schema
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"}]
  }'
POST /api/v1/contacts/batch
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)" }
POST /api/v1/orders/batch
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:

Supported event names
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
POST/api/plugin/sync

Submit any event. Auth: Bearer sk_live_…

curl
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"
  }
}'
POST/api/plugin/sync

customer.created — creates / upserts a Contact (email is the dedupe key).

curl
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"
    }
  }
}'
POST/api/plugin/sync

product.created / product.updated — keeps the merchant's product catalogue mirrored.

curl
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"
    ]
  }
}'
POST/api/plugin/sync

cart.abandoned — opens an Opportunity in stage 'cart' and fires the cart_abandoned journey trigger.

curl
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
      }
    ]
  }
}'
POST/api/plugin/sync

form.submitted — lead capture from a marketing form. Honours your duplicate_handling policy.

curl
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"
  }
}'
POST/api/plugin/sync

order.refunded — flips payment_status and posts a refund activity.

curl
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.

POST/api/plugin/orders/{source}

source = shopify | woocommerce | prestashop | magento | bigcommerce | wix | api | manual | csv_import

curl
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

Contact fields
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
GET/api/entity/contact

List contacts (paginated). Supports ?page=N&page_size=M&search=jane.

curl
curl -X GET "https://flowgration.com/api/entity/contact" \
  -H "Authorization: Bearer sk_live_…"
GET/api/entity/contact/{id}

Get one contact, hydrated with custom fields, source campaigns and owner.

curl
curl -X GET "https://flowgration.com/api/entity/contact/1" \
  -H "Authorization: Bearer sk_live_…"
POST/api/entity/contact

Create a contact. Auto-creates the contact's first Opportunity and fires contact_created + opportunity_created journey triggers.

curl
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
  ]
}'
PATCH/api/entity/contact/{id}

Update fields. Send only what changes. Partial custom_fields merges with what's stored.

curl
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"
  }
}'
DELETE/api/entity/contact/{id}

Permanently delete the contact and everything attached to it (opportunities, activities, journey runs). This cannot be undone.

curl
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.

GET/api/entity/opportunity

List deals.

curl
curl -X GET "https://flowgration.com/api/entity/opportunity" \
  -H "Authorization: Bearer sk_live_…"
POST/api/entity/opportunity

Create a deal linked to a contact.

curl
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"
  }
}'
PATCH/api/entity/opportunity/{id}

Move stage, set value, change owner. Fires opportunity.stage_changed for outbound webhooks.

curl
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
}'
DELETE/api/entity/opportunity/{id}

Delete a deal. If it was the contact's only opportunity, a fresh empty one is created automatically.

curl
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.

GET/api/entity/activity

List activities. Filterable by ?contact_id, ?opportunity_id, ?type, ?channel.

curl
curl -X GET "https://flowgration.com/api/entity/activity" \
  -H "Authorization: Bearer sk_live_…"
POST/api/entity/activity

Log an activity attached to a contact or opportunity.

curl
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.

GET/api/orders

List orders from the first-class Order table.

curl
curl -X GET "https://flowgration.com/api/orders" \
  -H "Authorization: Bearer sk_live_…"
GET/api/orders/{order_id}

Hydrated order detail (line items, addresses, refunds).

curl
curl -X GET "https://flowgration.com/api/orders/1" \
  -H "Authorization: Bearer sk_live_…"
POST/api/entity/orders

Direct create on the Opportunity-backed surface (rarely used; prefer /api/plugin/sync).

curl
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
    }
  ]
}'
PATCH/api/entity/orders/{order_id}

Update payment / shipping status. Fires order_paid trigger on transition to 'paid'.

curl
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

GET/api/products

List products mirrored into Flowgration.

curl
curl -X GET "https://flowgration.com/api/products" \
  -H "Authorization: Bearer sk_live_…"
GET/api/products/{product_id}

Get one product.

curl
curl -X GET "https://flowgration.com/api/products/1" \
  -H "Authorization: Bearer sk_live_…"
GET/api/products/{product_id}/orders

Orders that contain this product.

curl
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):

Allowed entity_type values
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).

GET/api/schema/{entity_type}

List custom field definitions for the entity.

curl
curl -X GET "https://flowgration.com/api/schema/contact" \
  -H "Authorization: Bearer sk_live_…"
GET/api/schema/{entity_type}/system-fields

Read-only list of platform-mapped system fields (sku, total, currency…). Useful for showing 'already captured' chips in your UI.

curl
curl -X GET "https://flowgration.com/api/schema/contact/system-fields" \
  -H "Authorization: Bearer sk_live_…"
PUT/api/schema/{entity_type}

Replace the whole schema for the entity. Admin/edit access only.

curl
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:

  1. Send the canonical names directly. The POST /api/plugin/sync endpoint 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_fields on the matching entity — nothing is dropped.
  2. Persist a mapping_config server-side. Each integration row in/app/integrations carries amapping_config JSON 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:

Trigger → fired by
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:

Inspect a journey run
curl "https://flowgration.com/api/entity/contact/1/timeline" \
  -H "Authorization: Bearer sk_live_…"

Plugin onboarding (magic link)

POST/api/plugin/onboarding/initiate

Public. 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
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
    }
  }
}'
GET/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.

Headers received by your endpoint
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.

Python (Flask)
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 "", 200
Node (Express)
const 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.updated
  • opportunity.created · opportunity.stage_changed
  • order.created · order.paid · order.shipped
  • task.created · task.completed
  • journey.completed · journey.failed
  • web.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.

web.page_viewed
{
  "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" }
}
web.custom_event
{
  "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" }
}
web.identified
{
  "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.

GET/api/webhook-endpoints

List your registered endpoints.

curl
curl -X GET "https://flowgration.com/api/webhook-endpoints" \
  -H "Authorization: Bearer sk_live_…"
POST/api/webhook-endpoints

Register a new endpoint. Returns the signing secret ONCE.

curl
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
}'
PUT/api/webhook-endpoints/{id}

Update events, URL or active flag.

curl
curl -X PUT "https://flowgration.com/api/webhook-endpoints/1" \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "active": false
}'
DELETE/api/webhook-endpoints/{id}

Delete the endpoint and its delivery history.

curl
curl -X DELETE "https://flowgration.com/api/webhook-endpoints/1" \
  -H "Authorization: Bearer sk_live_…"
POST/api/webhook-endpoints/{id}/rotate-secret

Mint a new HMAC secret. The previous one is invalidated immediately.

curl
curl -X POST "https://flowgration.com/api/webhook-endpoints/1/rotate-secret" \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/api/webhook-endpoints/{id}/test

Fire a synthetic webhook.test event so you can verify signing end-to-end.

curl
curl -X POST "https://flowgration.com/api/webhook-endpoints/1/test" \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/api/webhook-endpoints/{id}/deliveries

Last delivery attempts (status, response excerpt, attempt number).

curl
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.

POST /api/webhook/form/{token} (no Authorization header)
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

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.

POST /api/v1/contacts/batch
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.

POST/api/contact-form/submit

Public, no Authorization header required.

curl
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:

Response headers
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:

Paged response shape
{
  "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:

Generic error
{ "error": "code", "message": "Human-readable description" }
HTTPWhen you'll see it
400Bad request — body invalid, unknown event, unknown entity_type, or missing required field
401Missing / invalid / revoked Bearer key, or stale webhook timestamp
402Plan limit reached (e.g. max_contacts, max_api_keys) — upgrade required
403Authenticated 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
404Not found, or filtered out by record_visibility for member-role users
409Integration paused (sync events refused until resumed)
413Payload too large (256 KB cap on plugin schema)
429Rate-limited — back off and honour Retry-After
500Server 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