How to migrate from Green API to Lime API, step by step · Lime API
Change the host, swap two credentials, relink the number. A practical Green API to Lime API migration guide with code, webhooks and no-code flows.
Lime API was built to be compatible with Green API. The URL structure, method names, request bodies and webhook payloads are the same, so a migration is mostly configuration, not a rewrite. This guide walks through the whole move: credentials, code in four languages, webhooks, Make, n8n and Zapier, and a final checklist.
If you are still deciding whether to switch, start with the Lime API vs Green API comparison.
What actually changes
Only three things:
- The host. Replace your Green API host with
https://api.lime-api.com. - idInstance. Use the instance ID of your new Lime instance.
- apiTokenInstance. Use the API token of your new Lime instance.
Everything after the host stays as it is:
https://api.lime-api.com/waInstance{idInstance}/{method}/{apiTokenInstance}
Method names such as sendMessage, sendFileByUrl, sendFileByUpload, getChatHistory, receiveNotification, deleteNotification, setSettings and getStateInstance are identical, and chat IDs keep the same format (15551234567@c.us for people, ...@g.us for groups).
Step 1: Create a Lime instance and link the number
- Create a free account. The Developer plan is enough to test, with up to 3 destination numbers.
- Create an instance in the panel.
- On your phone, open WhatsApp, go to Linked devices and scan the QR code. You can also enter a pairing code instead of scanning.
- Copy the idInstance and apiTokenInstance from the instance page.
The whole step takes about two minutes. If the number belongs to a client, send them the connect link from the instance page so they can link it themselves.
Before you link a production number, log it out of Green API (or remove the old linked device in WhatsApp). One number should be sent from by one service at a time, otherwise you get duplicate webhooks and confusing message states.
A good order is to test with a spare number first, then move production numbers one by one.
Step 2: Update your code
Keep the host and credentials in environment variables. Then the code change is often zero lines: you only update the config.
JavaScript (Node.js)
Before:
const HOST = 'https://api.green-api.com'
const ID = process.env.GREEN_ID_INSTANCE
const TOKEN = process.env.GREEN_API_TOKEN
After:
const HOST = 'https://api.lime-api.com'
const ID = process.env.LIME_ID_INSTANCE
const TOKEN = process.env.LIME_API_TOKEN
const res = await fetch(HOST + '/waInstance' + ID + '/sendMessage/' + TOKEN, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ chatId: '15551234567@c.us', message: 'Hello from Lime API' })
})
console.log(await res.json()) // { idMessage: '...' }
Python
Before:
HOST = "https://api.green-api.com"
ID = os.environ["GREEN_ID_INSTANCE"]
TOKEN = os.environ["GREEN_API_TOKEN"]
After:
import os, requests
HOST = "https://api.lime-api.com"
ID = os.environ["LIME_ID_INSTANCE"]
TOKEN = os.environ["LIME_API_TOKEN"]
r = requests.post(
f"{HOST}/waInstance{ID}/sendFileByUrl/{TOKEN}",
json={
"chatId": "15551234567@c.us",
"urlFile": "https://example.com/invoice.pdf",
"fileName": "invoice.pdf",
"caption": "Your invoice",
},
)
print(r.json())
PHP
Before:
$host = 'https://api.green-api.com';
$id = getenv('GREEN_ID_INSTANCE');
$token = getenv('GREEN_API_TOKEN');
After:
$host = 'https://api.lime-api.com';
$id = getenv('LIME_ID_INSTANCE');
$token = getenv('LIME_API_TOKEN');
$ch = curl_init("$host/waInstance{$id}/sendMessage/{$token}");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '15551234567@c.us',
'message' => 'Hello from Lime API',
]),
]);
echo curl_exec($ch);
cURL
Before:
curl -X POST "https://api.green-api.com/waInstance1101000000/sendMessage/OLD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"chatId":"15551234567@c.us","message":"Hello"}'
After:
curl -X POST "https://api.lime-api.com/waInstance1101234567/sendMessage/LIME_TOKEN" \
-H "Content-Type: application/json" \
-d '{"chatId":"15551234567@c.us","message":"Hello"}'
If your Green API console showed a different host for your instance (an apiUrl with a number in it), replace that host in the same way. Only the part before /waInstance changes.
Check the connection with getStateInstance. It should return authorized once the number is linked. See sendMessage and the rest of the docs for every method and field.
Step 3: Move webhooks
Webhook payloads use the same types and fields as Green API: incomingMessageReceived, outgoingMessageStatus, stateInstanceChanged and the rest. Your existing handler does not need changes.
Set the webhook URL on the new instance, either in the panel or with setSettings:
curl -X POST "https://api.lime-api.com/waInstance1101234567/setSettings/LIME_TOKEN" \
-H "Content-Type: application/json" \
-d '{"webhookUrl":"https://your-app.com/whatsapp/webhook","webhookUrlToken":"YOUR_SECRET","incomingWebhook":"yes","outgoingWebhook":"yes","stateWebhook":"yes"}'
The webhookUrlToken is sent as an Authorization: Bearer header, so your endpoint can check that the call came from your instance.
A few things work better than before. Lime delivers webhooks through a queue with retries and keeps a log of every delivery. If your server is down during a deploy, you can replay the missed events from the log. If you poll instead of using webhooks, receiveNotification and deleteNotification work the same way.
If your handler checks instanceData.idInstance, remember that the ID is now your Lime instance ID.
Step 4: Move Make, n8n and Zapier flows
Make
Lime's Make app has the same modules and fields as the Green API app, with 45+ modules. Install it from the integrations page, add a connection with your Lime idInstance and apiTokenInstance, and swap the Green API modules in your scenario for the matching Lime modules. The mapped fields keep their names, so the mapping usually carries over.
If your scenario uses the generic HTTP module, just change the host in the URL.
n8n
Install the Lime API community node from the integrations page, create credentials with ID Instance and API Token Instance, and replace the old nodes. For HTTP Request nodes, change the host only. For incoming messages, use the Lime webhook trigger or point the instance webhook at your existing n8n webhook URL.
Zapier
Install the Lime API app, connect your instance and rebuild the trigger and action steps. Zapier does not let you swap the app inside an existing step, so this takes a few minutes per Zap.
For flows you want to rebuild anyway, consider Lime's built-in cloud automations, which handle keyword replies, first-message greetings and out-of-hours replies without an external tool. See WhatsApp automation without code.
Once the basic flow works, take ten minutes to configure the parts that come with every Lime plan:
- Sending protection: random delays, typing simulation, rate limits and a sending window. Read how to avoid a WhatsApp ban before you send bulk messages.
- Shared inbox and team roles, so support staff can answer without API access.
- AI connector (MCP) with 23 tools for Claude, ChatGPT, Gemini, Cursor and others. See WhatsApp MCP for Claude and ChatGPT.
Migration checklist
- Lime account created, instance created
- Number unlinked from Green API, then linked to Lime by QR or pairing code
getStateInstance returns authorized- Host changed to
https://api.lime-api.com in every service and environment - New idInstance and apiTokenInstance stored in your secrets
- Webhook URL and token set with
setSettings or in the panel - Test message sent and
outgoingMessageStatus received - Incoming test message received by your handler
- Make, n8n and Zapier flows switched and run once
- Sending protection configured
- Old Green API instance cancelled after a few days of stable traffic
Ready to move?
Start with a free Developer instance, run your existing code against it, and move production when you are happy. Create a free account or see plans on the pricing page. Lime is an independent service and is not affiliated with WhatsApp, Meta or Green API.