Contacts API
Manage contacts in your EmacronAI CRM workspace. Create contacts from signups, imports, or lead forms. Update them when data changes. Use tags and custom fields for segmentation.
Workspace records and shopper accounts
A Contact is a staff-managed person record. Linked CRM records, Inbox conversations and verified Store shopper accounts keep their own access rules. Matching an email address does not authorize a shopper account.
The client API uses https://api.crm.emacronai.com/api/v1 with a scoped API key. Administrator import and privacy-review endpoints use a signed-in workspace session, with current role and record permissions.
Endpoints
| Method | Path | Scope | Description |
|---|---|---|---|
| GET | /api/v1/contacts | contacts:read | List contacts (paginated) |
| GET | /api/v1/contacts/:id | contacts:read | Get a single contact |
| POST | /api/v1/contacts | contacts:write | Create a new contact |
| PATCH | /api/v1/contacts/:id | contacts:write | Update contact fields |
GET /api/v1/contacts
Returns a paginated list of contacts. Filters are exact-match; there is no free-text search parameter.
Query parameters
| Param | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number (1-indexed) |
| limit | integer | 25 | Results per page (max 100) |
| string | — | Exact-match email filter | |
| phone | string | — | Exact-match phone filter |
| stage | string | — | Exact-match status/stage filter |
const res = await oa.contacts.list({
page: 1,
limit: 25,
email: 'rajesh@example.com', // exact match
});
// res.data — contacts on this page
// res.pagination — { page, limit, total, total_pages }POST /api/v1/contacts
Create a new contact. At least one of name, email or phone is required. The API accepts exactly these fields: name email phone company_name designation city source — other keys (tags, custom fields) are not part of this API and are not stored.
const contact = await oa.contacts.create({
name: 'Rajesh Kumar',
phone: '+919876543210',
email: 'rajesh@example.com',
company_name: 'Acme Corp',
designation: 'CTO',
city: 'Pune',
source: 'api',
});
// returns the created Contact object with id, created_at, etc.
// 409 if a contact with the same identity already existsPATCH /api/v1/contacts/:id
Partially update a contact. Only send the fields you want to change. Updatable fields: name email phone company_name designation city status.
const updated = await oa.contacts.update('contact_id_here', {
status: 'qualified',
city: 'Mumbai',
});Contact object schema
| Field | Type | Description |
|---|---|---|
| id | string | Unique contact ID (UUID) |
| name | string | Full name (at least one of name / email / phone is required on create) |
| phone | string | E.164 phone number e.g. +919876543210 |
| string | Email address | |
| company_name | string | Company or organisation name |
| designation | string | Job title or role |
| city | string | City of residence or work |
| source | string | Lead source tag e.g. "WhatsApp", "Website", "api" |
| status | string | Contact status e.g. "active", "unsubscribed" |
| created_at | string | ISO 8601 creation timestamp |
| updated_at | string | ISO 8601 last-updated timestamp |