Skip to main content
RapidDev - Software Development Agency
flutterflow-integrationsFlutterFlow API Call

Kartra

To connect FlutterFlow to Kartra, create an API Group that sends application/x-www-form-urlencoded POST requests to Kartra's single API endpoint with bracketed actions[] fields. Because three credentials (app_id, api_key, api_password) must stay secret, route the request through a Firebase Cloud Function proxy. FlutterFlow then submits signup form data to the proxy, which pushes leads and tags into your Kartra funnel.

What you'll learn

  • How to locate your Kartra app_id, api_key, and api_password in My Integrations
  • How to configure a form-urlencoded API Call with bracketed actions[] fields in FlutterFlow
  • How to deploy a Firebase Cloud Function that injects Kartra credentials and forwards the request
  • How to wire a FlutterFlow signup form to push leads and tags into a Kartra funnel
  • How to parse Kartra's response and show a success confirmation in your app
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate16 min read60 minutesMarketingLast updated July 2026RapidDev Engineering Team
TL;DR

To connect FlutterFlow to Kartra, create an API Group that sends application/x-www-form-urlencoded POST requests to Kartra's single API endpoint with bracketed actions[] fields. Because three credentials (app_id, api_key, api_password) must stay secret, route the request through a Firebase Cloud Function proxy. FlutterFlow then submits signup form data to the proxy, which pushes leads and tags into your Kartra funnel.

Quick facts about this guide
FactValue
ToolKartra
CategoryMarketing
MethodFlutterFlow API Call
DifficultyIntermediate
Time required60 minutes
Last updatedJuly 2026

Pushing Mobile Leads into a Kartra Funnel from FlutterFlow

Kartra is not a typical REST API. Where most modern APIs accept JSON bodies and return clean JSON, Kartra's API works through a single endpoint that you POST to with application/x-www-form-urlencoded data — the same encoding a traditional HTML form would use. Authentication is not a header; it is three fields inside the body itself: app_id, api_key, and api_password. The action you want to perform — create a lead, assign a tag, grant course access — is described by additional bracketed fields like `actions[0][cmd]=create_lead` and `actions[0][email]=user@example.com`. Combine the auth fields and the action fields in one POST and Kartra executes the operation.

The FlutterFlow angle is mobile lead capture: a user fills in their name and email in your Flutter app, hits a signup button, and the app writes that lead directly into your Kartra funnel with the appropriate tags applied. This is genuinely useful for course creators, coaches, and membership site owners who drive mobile traffic but manage their contacts and automations in Kartra. Instead of routing the lead through a third-party Zap, the app talks to Kartra directly.

Because all three auth fields are secrets, they cannot live in your FlutterFlow API Call — they would ship inside the compiled Dart binary. A Firebase Cloud Function proxy solves this: FlutterFlow posts the user's data to the Function, the Function appends the stored credentials, and then forwards the complete form-encoded request to Kartra. The Function returns Kartra's response as JSON, and FlutterFlow shows a success message. Kartra API details — including the exact endpoint URL — are published inside your Kartra account under My Integrations rather than on a public documentation site, so the steps below note where to find each value in your account.

Integration method

FlutterFlow API Call

Kartra's API is a single POST endpoint that accepts application/x-www-form-urlencoded data — not JSON. The request body includes three authentication fields (app_id, api_key, api_password) and a set of bracketed actions[] fields that describe what to do, such as creating a lead or assigning a tag. FlutterFlow supports form-encoded request bodies and can model each bracketed field as a variable, but because all three credentials are secrets, a Firebase Cloud Function must receive the request from FlutterFlow, inject the credentials, and forward it to Kartra — keeping the secrets off the compiled Dart app. FlutterFlow shows a success or error snackbar based on the JSON-ish response.

Prerequisites

  • A Kartra account on a paid plan (Starter or above) with API access enabled
  • Your Kartra app_id, api_key, and api_password from Kartra → My Integrations → API (inside your account)
  • The exact Kartra API endpoint URL from your My Integrations page (the path is published inside your account, not publicly documented)
  • A Firebase project with Cloud Functions enabled (Blaze pay-as-you-go plan required for outbound network requests from functions)
  • A FlutterFlow project on a plan that supports API Calls

Step-by-step guide

1

Find your Kartra API credentials and endpoint in My Integrations

Log in to your Kartra account and click your account name in the top-right corner to reveal the account menu. Select My Integrations. On the integrations page, look for the API section — Kartra publishes the exact API endpoint URL, your app_id, your api_key, and your api_password here. Copy all four values: the endpoint URL (it will look like `https://app.kartra.com/api`), the app_id (a short alphanumeric string), the api_key, and the api_password. These are the three secret credentials that authenticate every API request. Store them temporarily in a password manager or secure note — you will paste them into your Firebase Cloud Function's environment configuration in the next step, not directly into FlutterFlow. Also note the names and IDs of any Kartra tags you want to assign to new leads — you can find tag IDs in Kartra → Leads → Tags. You will need the exact tag name (case-sensitive) or tag ID when constructing the actions[] fields. If you plan to grant product access (for example, a free mini-course), also copy the product ID from Kartra → Products → your product → API integration details.

Pro tip: Kartra's API details are only visible inside your account — there is no public API documentation URL to bookmark. If you cannot find the API section under My Integrations, confirm that your Kartra plan includes API access; some entry-level tiers may not expose it.

Expected result: You have the Kartra API endpoint URL, app_id, api_key, and api_password copied and stored securely, and you know the tag names you will apply to new leads.

2

Deploy a Firebase Cloud Function that proxies the Kartra form-encoded POST

Open your Firebase project in the Firebase console and navigate to Cloud Functions. You will create a Node.js function that receives a simple JSON payload from FlutterFlow (lead email, name, and any tags), builds the correct application/x-www-form-urlencoded body with Kartra's bracketed fields, and POSTs it to the Kartra API. Using the `axios` or built-in `https` module works well for this. Store your three Kartra credentials as Firebase environment variables — either using `firebase functions:config:set kartra.app_id="..."` and similar commands, or using Secret Manager for better security. The function must accept a JSON body from FlutterFlow (`email`, `name`, `tags` as a comma-separated string), construct the form-encoded string manually because `axios` needs the `qs` or `URLSearchParams` helper for nested array fields, POST to the Kartra endpoint, and return the Kartra response as JSON. Enable CORS in the function so FlutterFlow's web preview can reach it. Deploy with the Firebase CLI or from the Firebase console's inline editor. Once deployed, copy the HTTPS trigger URL — that is the URL you will set as the base URL in your FlutterFlow API Group.

index.js
1// Firebase Cloud Function — index.js
2const functions = require('firebase-functions');
3const admin = require('firebase-admin');
4const axios = require('axios');
5const cors = require('cors')({ origin: true });
6const qs = require('qs');
7
8admin.initializeApp();
9
10exports.kartraProxy = functions.https.onRequest((req, res) => {
11 cors(req, res, async () => {
12 if (req.method !== 'POST') {
13 return res.status(405).json({ error: 'Method not allowed' });
14 }
15
16 const { email, firstName, lastName, tags } = req.body;
17
18 const kartraEndpoint = process.env.KARTRA_ENDPOINT ||
19 functions.config().kartra.endpoint;
20
21 // Build form-encoded body with bracketed actions[]
22 const body = qs.stringify({
23 'app_id': process.env.KARTRA_APP_ID || functions.config().kartra.app_id,
24 'api_key': process.env.KARTRA_API_KEY || functions.config().kartra.api_key,
25 'api_password': process.env.KARTRA_API_PASSWORD || functions.config().kartra.api_password,
26 'actions[0][cmd]': 'create_lead',
27 'actions[0][first_name]': firstName || '',
28 'actions[0][last_name]': lastName || '',
29 'actions[0][email]': email,
30 // Assign a tag as a second action if provided
31 ...(tags ? {
32 'actions[1][cmd]': 'assign_tag',
33 'actions[1][email]': email,
34 'actions[1][tag_name]': tags
35 } : {})
36 });
37
38 try {
39 const response = await axios.post(kartraEndpoint, body, {
40 headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
41 });
42 res.status(200).json(response.data);
43 } catch (err) {
44 const status = err.response ? err.response.status : 500;
45 res.status(status).json({ error: err.message });
46 }
47 });
48});
49

Pro tip: The `qs` npm package handles nested bracket notation (`actions[0][cmd]`) correctly in Node.js. Add it to your functions/package.json: `"dependencies": { "qs": "^6.11.0", "axios": "^1.6.0", "cors": "^2.8.5" }` and run `npm install` in the functions directory.

Expected result: The Cloud Function deploys successfully. Testing it with a tool like Postman or the Firebase console with a `{ "email": "test@example.com", "firstName": "Test", "tags": "mobile-optin" }` JSON body returns a Kartra success response.

3

Create the KartraProxy API Group and LeadCapture API Call in FlutterFlow

In your FlutterFlow project, click API Calls in the left navigation panel. Click + Add and choose Create API Group. Name it KartraProxy. In the Base URL field, paste your Firebase Cloud Function's HTTPS trigger URL. Leave the Headers section empty — your Cloud Function already sets the correct Content-Type header when calling Kartra. Click Save. Now click + Add API Call inside the KartraProxy group. Name it CreateLead. Set the Method to POST. Click the Body tab and set the body type to JSON (the Cloud Function accepts JSON from FlutterFlow and converts it internally to form-encoded before forwarding to Kartra — this is simpler than trying to build form-encoded syntax in FlutterFlow). Add Variables in the Variables tab: `email` (String, required), `firstName` (String), `lastName` (String), and `tags` (String, for a tag name like 'mobile-optin'). In the Body section, set the JSON body to `{ "email": "{{email}}", "firstName": "{{firstName}}", "lastName": "{{lastName}}", "tags": "{{tags}}" }`. Click Save, then open the Response & Test tab. Fill in the test variable values with a real email address and click Test. If everything is wired correctly, you should see a Kartra success response in the response panel. Check your Kartra account under Leads to confirm the test lead was created.

typescript
1// API Call config reference (visual setup in FlutterFlow)
2{
3 "group_name": "KartraProxy",
4 "base_url": "https://us-central1-YOUR_PROJECT.cloudfunctions.net/kartraProxy",
5 "calls": [
6 {
7 "name": "CreateLead",
8 "method": "POST",
9 "body_type": "JSON",
10 "body": {
11 "email": "{{email}}",
12 "firstName": "{{firstName}}",
13 "lastName": "{{lastName}}",
14 "tags": "{{tags}}"
15 },
16 "variables": [
17 { "name": "email", "type": "String", "required": true },
18 { "name": "firstName", "type": "String" },
19 { "name": "lastName", "type": "String" },
20 { "name": "tags", "type": "String" }
21 ]
22 }
23 ]
24}

Pro tip: If you want to support multiple tags, make `tags` a comma-separated string like 'mobile-optin,webinar-july'. In your Cloud Function, split the string with `tags.split(',')` and create one `assign_tag` action per tag in the actions[] array.

Expected result: The KartraProxy API Group and CreateLead call appear in your FlutterFlow API Calls list. A test run returns a success response and a new lead appears in your Kartra account under Leads.

4

Build the signup form and wire the action flow

Create the lead capture screen in FlutterFlow. Add a Column widget containing: a TextField for first name (set the controller variable to `firstNameController`), a TextField for last name (`lastNameController`), a TextField for email (`emailController`), and an ElevatedButton labeled 'Sign Up' or 'Get Access'. Open the Button's Actions panel and add a Validate Form action first (to check that the email field is not empty and follows email format). Then add a Backend/API Call action: select KartraProxy → CreateLead, and map the variables: email = `emailController.text`, firstName = `firstNameController.text`, lastName = `lastNameController.text`, tags = a hard-coded string like 'mobile-optin'. After the API Call action, add a Conditional action that checks the response status: if the call succeeded (HTTP 200), show a success Snackbar ('You're in! Check your email.') and optionally navigate to a confirmation screen. If the call failed, show an error Snackbar ('Something went wrong — please try again.'). To avoid double submissions, add a Boolean App State variable `isSubmitting` and toggle it true before the API Call and false after, binding it to the button's disabled state and showing a loading spinner while true.

Pro tip: Add a simple email format check in the Validate Form action before triggering the API Call — Kartra will reject malformed emails at the API level, but showing the user an inline error before the request is a better experience.

Expected result: The signup form submits lead data to Kartra via the Cloud Function proxy. On success, the user sees a confirmation snackbar and the lead appears in Kartra's Leads section with the correct tag applied.

5

Parse the Kartra response and confirm success in the UI

Kartra's API response is JSON-ish — it returns a status field and sometimes a message. In FlutterFlow's Response & Test tab for the CreateLead call, paste a sample Kartra response and click Generate JSON Paths. Common paths to extract are `$.status` (typically 'Success' or 'Error') and `$.message` for any error description. Map these with JSON Path in your API Call response configuration. In your Action Flow, after the API Call step, add a Conditional action that evaluates the JSON Path result for `status`: if it equals 'Success', proceed to show the confirmation snackbar; if it equals 'Error', show the message value in an error snackbar so the user knows what went wrong (for example, if the email is already in Kartra and the action conflicts with existing data). You can also use the `status` path to log analytics events — track 'lead_captured' in Firebase Analytics or Mixpanel whenever Kartra returns success. This gives you a reliable mobile funnel conversion event independent of Kartra's own reporting.

typescript
1// JSON Path examples for Kartra API response
2$.status // 'Success' or 'Error'
3$.message // error description if status is Error
4$.lead_id // may appear in success responses (verify in your account)

Pro tip: If you'd rather skip the Cloud Function setup and managed infrastructure, RapidDev's team builds FlutterFlow integrations like this every week — they can configure the proxy, test the full lead flow, and hand you a ready-to-use integration. Book a free scoping call at rapidevelopers.com/contact.

Expected result: Successful submissions show a branded confirmation message. Error responses from Kartra (duplicate email, invalid credentials, etc.) show a human-readable error message in the app instead of a blank failure.

Common use cases

Mobile lead capture form for a course creator

An online course creator builds a FlutterFlow app that serves as a companion to their Kartra-hosted membership site. The app includes a free-guide opt-in form: the user enters their name and email, and the app pushes the lead into Kartra with a 'mobile-optin' tag, triggering an email automation sequence in Kartra.

FlutterFlow Prompt

Build a simple two-field form (name, email) with a 'Get Free Guide' submit button. On submission, push the lead to Kartra with the tag 'free-guide-optin' and show a 'Check your email!' confirmation message.

Copy this prompt to try it in FlutterFlow

Event registration app feeding a Kartra funnel

A speaker and coach promotes free webinars through a Flutter app. Attendees register by entering their email in the app. The app calls the Cloud Function proxy, which creates the lead in Kartra and grants access to the webinar product, automatically sending the Kartra confirmation email.

FlutterFlow Prompt

Create a webinar registration screen where users enter their email. On submit, create the lead in Kartra and grant access to the product ID for the upcoming webinar, then show a registration confirmation.

Copy this prompt to try it in FlutterFlow

Referral program app that tags and segments leads

A fitness coach runs a referral program through a Flutter app. When a new user signs up via a referral link, the app captures their email and the referrer's code, pushes them to Kartra as a lead, and applies two tags: 'referral' and the specific referrer's name — all in one API call so Kartra's automations can send a personalized welcome sequence.

FlutterFlow Prompt

On the sign-up screen, capture email and a referral code field. Push the lead to Kartra with tags for 'referral' and the referrer code value, then redirect to the home screen.

Copy this prompt to try it in FlutterFlow

Troubleshooting

Cloud Function returns an error and Kartra doesn't create the lead

Cause: The most common causes are: wrong app_id, api_key, or api_password (typo or extra whitespace when pasting), or the bracketed field syntax in the form-encoded body is malformed.

Solution: Test the Cloud Function directly using the Firebase console or Postman with a raw POST body. Log the full form-encoded string the function is building before sending it (use `console.log(body)` in the function and check Firebase logs). Compare the field names against your Kartra My Integrations API documentation. Also confirm the api_password is the API password, not your Kartra account login password — these are different credentials.

FlutterFlow API Call test returns 'XMLHttpRequest error' or fails to reach the Cloud Function

Cause: CORS is blocking the request from FlutterFlow's browser-based preview, or the Cloud Function URL is incorrect.

Solution: Verify the Cloud Function includes `const cors = require('cors')({ origin: true })` and wraps the handler with `cors(req, res, async () => { ... })`. Confirm the Firebase function was deployed successfully (check the Firebase console → Functions → Dashboard for the function's status). Copy the HTTPS trigger URL from the Firebase console and verify it matches what you pasted in FlutterFlow's Base URL field exactly.

typescript
1const cors = require('cors')({ origin: true });
2exports.kartraProxy = functions.https.onRequest((req, res) => {
3 cors(req, res, async () => { /* your logic */ });
4});

Kartra returns a success status but the lead or tag doesn't appear in Kartra

Cause: The actions[] fields are correct but the tag name does not exactly match an existing tag in your Kartra account, so the tag assignment action silently does nothing.

Solution: In Kartra → Leads → Tags, check the exact name (including case) of the tag you want to assign. Kartra tag names are case-sensitive. Alternatively, switch to using the tag ID instead of the tag name in `actions[1][tag_id]` — IDs are more stable than names if someone renames the tag in Kartra later.

The body fields arrive at Kartra as JSON instead of form-encoded, causing a rejection

Cause: The Cloud Function is forwarding the request body directly without converting to `application/x-www-form-urlencoded` format, or the `Content-Type` header is set to `application/json` when calling Kartra.

Solution: Confirm the axios POST in your Cloud Function sends `headers: { 'Content-Type': 'application/x-www-form-urlencoded' }` and that the body is built using `qs.stringify()` (not `JSON.stringify()`). Kartra's API will not process JSON bodies — the form encoding with bracketed field names is mandatory.

typescript
1const qs = require('qs');
2const body = qs.stringify({ 'actions[0][cmd]': 'create_lead', ... });
3await axios.post(url, body, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });

Best practices

  • Store all three Kartra credentials (app_id, api_key, api_password) exclusively in Firebase environment variables or Secret Manager — never in FlutterFlow API Call headers, App Values, or anywhere client-side.
  • Validate email format and required fields in FlutterFlow before triggering the API Call — Kartra will reject malformed emails, and catching them client-side saves a round-trip to the Cloud Function.
  • Use Kartra's own duplicate lead settings to decide what happens when the same email is submitted twice — the default behavior (update rather than error) is usually what you want for a capture form.
  • Assign specific tags on lead creation rather than relying on Kartra's default list — tags give you segmentation for follow-up automations immediately, without a separate tag-assignment step.
  • Log a Firebase Analytics event on every successful lead creation — this gives you a mobile funnel conversion metric independent of Kartra's reporting and lets you A/B test form copy in your app.
  • Disable the submit button after a tap and show a loading spinner until the Cloud Function responds — Kartra's API response can take 1-3 seconds, and double-taps can create duplicate lead records if the button stays active.
  • Verify the exact Kartra API endpoint URL inside your account's My Integrations page before each major update — Kartra occasionally updates the path structure between platform versions.
  • Test the full lead-to-automation path in Kartra after setup: create a lead through the app and verify that the expected Kartra email automation triggers within a few minutes.

Alternatives

Frequently asked questions

Can I use this integration to grant access to a Kartra membership or course from the app?

Yes. Kartra's API supports granting product access as an action. In your Cloud Function, add a third action to the actions[] array: `actions[2][cmd]=grant_product_access` and `actions[2][product_id]=YOUR_PRODUCT_ID`. You can find the product ID in Kartra → Products → select your product → API Integration. Run the create_lead, assign_tag, and grant_product_access actions in a single request.

Does Kartra's API support reading data, or is it write-only from FlutterFlow?

Kartra's API also supports read operations — you can retrieve lead details, check subscription statuses, and more using the appropriate cmd values in the actions[] array. However, the most common FlutterFlow use case is write-only lead capture because Kartra's primary value is as a marketing automation backend, not a data source you'd display in an app. If you need to read Kartra data in your app, confirm the specific cmd values for read operations in your Kartra My Integrations API documentation.

Why does Kartra use form-encoded POST instead of JSON like most modern APIs?

Kartra's API was designed years before JSON became the universal standard for web APIs. Form encoding was the conventional choice at the time, and Kartra has maintained backward compatibility rather than migrating to JSON. This is unusual today but fully functional — the Cloud Function approach handles the conversion transparently so your FlutterFlow app sends normal JSON while Kartra receives the form-encoded format it expects.

How do I find out what action commands Kartra supports?

Kartra's API command list is documented inside your account under My Integrations → API. Unlike many SaaS APIs, Kartra does not publish its full API reference publicly — you access it only when logged into your account. The available commands include create_lead, assign_tag, remove_tag, subscribe_to_sequence, unsubscribe_from_sequence, grant_product_access, and more. The exact list and parameters depend on your Kartra plan.

Can I test the Kartra integration without affecting real leads in my account?

Kartra does not have a sandbox or test mode — every successful API call creates or modifies real data in your account. For testing, create a dedicated 'test' tag in Kartra and a test segment so you can identify and delete test leads easily after verifying the integration. Always remove or clean up test leads before going live to avoid polluting your automations and list statistics.

What Kartra plan is required to use the API?

Kartra's API access is available on paid plans. The exact tier threshold varies — some reports indicate it is available from the Starter plan upward, but verify this in your account's My Integrations section. If the API option is missing from your My Integrations page, your current plan may not include API access and an upgrade would be required.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire FlutterFlow integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.