Skip to content
WhatsMarketingDeveloper Hub

Getting started

In ten minutes you'll have a key, a working request and a webhook received.

1. Create an API key

  1. Sign in to micuenta with an administrator user.
  2. Go to Integrations → Webhooks & API and click New key. The dashboard asks you to confirm it is you (password or code) before continuing.
  3. Give it a name that says what it's for ("HubSpot CRM", "Shopify website"), choose the scopes it needs and, optionally, an expiry date.
  4. 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
curl https://micuenta.whatsmarketing.es/api/v1/contacts?pageSize=5 \
  -H "Authorization: Bearer wm_live_YOUR_KEY"
Node.js
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');
Python
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
<?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
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

  1. In Integrations → Webhooks & API → New webhook, enter your server's https URL and tick contact.created.
  2. Save the whsec_… secret (it is also shown only once).
  3. Create a contact as in step 3: within seconds a POST with the event arrives at your URL.
  4. 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