Developers
Getting started · 1 min read

Quickstart

Make your first API call in about five minutes.

You need: a ZigCRM admin login, and a terminal or any tool that can send web requests. All requests go to https://api.zigcrm.com.

Other environments
Environment Base URL
Production https://api.zigcrm.com
Staging https://zigcrm-apis.staff-b0c.workers.dev

1. Create an API key

  1. In ZigCRM, go to Settings → API Keys and click Create API key.
  2. Name it (e.g. Website form) and tick Read contacts and Create & update contacts.
  3. Copy the key. It starts with zig_live_ and is shown only once.
Warning

Treat the key like a password. Keep it on your server — never in a web page, mobile app or public code.

2. Test the key

curl https://api.zigcrm.com/api/v1/me \
  -H "Authorization: Bearer $ZIGCRM_API_KEY"
const res = await fetch('https://api.zigcrm.com/api/v1/me', {
  headers: { Authorization: `Bearer ${process.env.ZIGCRM_API_KEY}` },
});
console.log(await res.json());
import os, requests

res = requests.get( "https://api.zigcrm.com/api/v1/me", headers={"Authorization": f"Bearer {os.environ['ZIGCRM_API_KEY']}"}, ) print(res.json())

If it works, you'll see your account and what the key can do:

{
  "tenant": { "id": "5eb926c1-ffa8-4179-b262-e6bed554326d", "name": "Acme Traders" },
  "api_key": { "name": "Website form", "prefix": "zig_live_3fa", "scopes": ["contacts:read", "contacts:write"], "expires_at": null }
}

Got 401? The key is wrong, expired or revoked.

3. Add a contact

curl -X POST https://api.zigcrm.com/api/v1/contacts \
  -H "Authorization: Bearer $ZIGCRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"first_name": "Asha", "last_name": "Nair", "email": "asha@example.com", "phone": "+919876543210"}'
const res = await fetch('https://api.zigcrm.com/api/v1/contacts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ZIGCRM_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ first_name: 'Asha', last_name: 'Nair', email: 'asha@example.com', phone: '+919876543210' }),
});
const { data: contact } = await res.json();
res = requests.post(
    "https://api.zigcrm.com/api/v1/contacts",
    headers={"Authorization": f"Bearer {os.environ['ZIGCRM_API_KEY']}"},
    json={"first_name": "Asha", "last_name": "Nair", "email": "asha@example.com", "phone": "+919876543210"},
)
contact = res.json()["data"]

You get 201 Created with the new contact. A contact needs a first_name plus an email or phone. Already exists? You get 409 duplicate — find it and update it instead.

4. Find a contact

q searches names, email, phone and company:

curl "https://api.zigcrm.com/api/v1/contacts?q=asha" \
  -H "Authorization: Bearer $ZIGCRM_API_KEY"
{
  "data": [ { "id": "3f6b2a4e-…", "first_name": "Asha", "last_name": "Nair", "email": "asha@example.com", "…": "…" } ],
  "pagination": { "page": 1, "per_page": 25, "total": 1, "total_pages": 1 }
}

That's it — what next?