Getting started
In ten minutes you'll have a key, a working request and a webhook received.
1. Create an API key
- Sign in to micuenta with an administrator user.
- Go to Integrations → Webhooks & API and click New key. The dashboard asks you to confirm it is you (password or code) before continuing.
- Give it a name that says what it's for ("HubSpot CRM", "Shopify website"), choose the scopes it needs and, optionally, an expiry date.
- Copy the key. It starts with
wm_live_and is shown only once: we store only its hash.
If you lose the key, revoke it and create another. Revoking cuts access instantly and is recorded in the activity log.
2. Your first request
The API lives at https://micuenta.whatsmarketing.es/api/v1 and the key goes in the Authorization header:
curl https://micuenta.whatsmarketing.es/api/v1/contacts?pageSize=5 \
-H "Authorization: Bearer wm_live_YOUR_KEY"const res = await fetch('https://micuenta.whatsmarketing.es/api/v1/contacts?pageSize=5', {
headers: { Authorization: `Bearer ${process.env.WM_API_KEY}` },
});
const { data, meta } = await res.json();
console.log(meta.total, 'contacts');import os, requests
r = requests.get(
"https://micuenta.whatsmarketing.es/api/v1/contacts",
params={"pageSize": 5},
headers={"Authorization": f"Bearer {os.environ['WM_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
print(r.json()["meta"]["total"], "contacts")<?php
$ch = curl_init('https://micuenta.whatsmarketing.es/api/v1/contacts?pageSize=5');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('WM_API_KEY')],
]);
$res = json_decode(curl_exec($ch), true);
echo $res['meta']['total'], " contacts\n";The response includes data (the contacts), meta (page, page size, total), tabs and summary. If you get 401 API_KEY_INVALID, check the key; if you get 403 API_KEY_SCOPE_MISSING, the key doesn't have the contacts:read scope.
3. Create a contact from your website
curl -X POST https://micuenta.whatsmarketing.es/api/v1/contacts \
-H "Authorization: Bearer wm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"fullName": "Laura Pérez",
"primaryPhone": "+34612345678",
"primaryEmail": "laura@ejemplo.com",
"source": "WEBSITE_FORM",
"tags": ["web"],
"consent": { "given": true, "how": "WEBSITE_FORM" }
}'The phone number always includes the international prefix. If a contact with that phone already existed, you get 409 CONTACT_PHONE_EXISTS with its contactId: use PATCH /contacts/{id} to complete it.
4. Receive your first webhook
- In Integrations → Webhooks & API → New webhook, enter your server's
httpsURL and tickcontact.created. - Save the
whsec_…secret (it is also shown only once). - Create a contact as in step 3: within seconds a
POSTwith the event arrives at your URL. - Verify the signature before doing anything with the body: it's explained in Webhooks.
To test locally without opening ports, use a tunnel (ngrok, Cloudflare Tunnel) and put that URL in the webhook.
5. Next steps
- Authentication and scopes: what each scope unlocks and what happens when one is missing.
- Limits and best practices: how many requests per minute and how to retry.
- Reference: every route with examples.
- Recipes: CRM, forms, n8n, Make and Zapier.