Sync new signups from your app to Meisa
Call /contacts/upsert/ from your signup code so every new user lands in Meisa, then let an automation start your onboarding sequence.
On this page
To get every new user into Meisa, call POST /contacts/upsert/ from your app’s signup code with the user’s email, your user ID and any fields you want to segment on. Then set up an automation on Contact is created to start your onboarding emails.
What you need
- An API key with the Add and update contacts permission. See Create and manage API keys.
- The key stored in your server’s environment, for example as
MEISA_API_KEY.
Step 1: Send each signup to Meisa
Add one call where your app creates a user. Node.js example:
async function syncToMeisa(user) {
const res = await fetch('<https://api.meisa.io/api/v1/contacts/upsert/'>, {
method: 'POST',
headers: {
'X-API-Key': process.env.MEISA_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: user.email,
external_id: String(user.id),
first_name: user.firstName,
source: 'signup',
custom_fields: { plan: user.plan, signup_date: user.createdAt },
}),
});
if (!res.ok) throw new Error(`Meisa sync failed: ${res.status}`);
}
Python example:
import os, requests
def sync_to_meisa(user):
r = requests.post(
"https://api.meisa.io/api/v1/contacts/upsert/",
headers={"X-API-Key": os.environ["MEISA_API_KEY"]},
json={
"email": user.email,
"external_id": str(user.id),
"first_name": user.first_name,
"source": "signup",
"custom_fields": {"plan": user.plan},
},
timeout=10,
)
r.raise_for_status()
Run the call in a background job so a slow network never holds up signup, and retry on 429 or 5xx errors.
Step 2: Keep the contact up to date
Call the same upsert when something changes, like an upgrade or a new email address. Meisa matches on external_id first, then email, so the person stays one contact. Only the fields you send change.
{ "email": "[email protected]", "external_id": "8412", "custom_fields": { "plan": "pro" } }
Step 3: Start onboarding automatically
- In Meisa, go to Automations and click New automation.
- Under When, pick Contact is created. Under Which contacts count, keep Your app and Signup forms ticked.
- Under Then, pick Start a sequence and choose your onboarding sequence.
- Click Turn on.
To react to upgrades, add a second automation on Field changes for plan. See Create an automation rule.
Bring in your existing users
For users who signed up before you connected Meisa, either import a CSV or run a one-off script that upserts each user with "source": "initial_sync". Contacts with that source are left out of Contact is created automations by default, so your existing users don’t get a welcome email.
Respect unsubscribes in your app
If your app also sends email, fetch the list of people who unsubscribed in Meisa with GET /contacts/api/unsubscribed-emails/ (needs Read contacts) and skip them on your side.
Troubleshooting
- 401 or 403: check the key and that it has Add and update contacts.
- Duplicates: always send the same
external_idfor the same user. - No welcome email: check the automation is on and the onboarding sequence is on.
Related articles
Did this answer your question?
Thanks for letting us know.Thanks, we will improve this article. Want a hand right now?
Still need help?
Chat with us and get an answer in a few minutes.