Contacts & Leads API
Overview
The Contacts & Leads API allows you to programmatically manage your contact database in AutomateNexus CRM. You can create, read, update, delete, search, and merge contacts, as well as access related resources like activities, deals, and timeline events.
List Contacts
GET /v1/contacts
Returns a paginated list of contacts. Supports filtering, sorting, and field selection.
Query Parameters
- status (string) — Filter by status:
active,inactive,lead,customer,churned. - source (string) — Filter by lead source:
website,referral,social,paid_ads,manual,api,import. - assigned_to (string) — Filter by assigned user ID.
- tags (string) — Comma-separated tag names to filter by.
- created_after (string) — ISO 8601 date. Only return contacts created after this date.
- created_before (string) — ISO 8601 date. Only return contacts created before this date.
- updated_after (string) — ISO 8601 date. Only return contacts updated after this date.
- company (string) — Filter by company name (partial match).
- sort (string) — Sort field. Options:
created_at,updated_at,first_name,last_name,company. Prefix with-for descending. - limit (integer) — Records per page. Default: 25, Max: 100.
- cursor (string) — Pagination cursor from previous response.
- fields (string) — Comma-separated list of fields to include in the response.
Example Request
curl -X GET "https://app.automatenexuscrm.com/functions/v1/api/contacts?status=active&source=website&sort=-created_at&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
"success": true,
"data": [
{
"id": "con_abc123",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"phone": "+1-555-0123",
"company": "Acme Corp",
"job_title": "VP of Marketing",
"status": "active",
"source": "website",
"tags": ["enterprise", "marketing"],
"assigned_to": "usr_xyz789",
"engagement_score": 85,
"custom_fields": {
"industry": "Technology",
"company_size": "50-200"
},
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-03-20T14:22:00Z"
}
],
"meta": {
"total": 1250,
"limit": 10,
"next_cursor": "eyJpZCI6ImNvbl9hYmMxMjMifQ==",
"has_more": true
}
}
Get a Contact
GET /v1/contacts/:id
Returns the full details of a single contact, including all custom fields and metadata.
curl -X GET "https://app.automatenexuscrm.com/functions/v1/api/contacts/con_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Create a Contact
POST /v1/contacts
Request Body
- first_name (string, required) — Contact's first name.
- email (string, required) — Contact's email address. Must be unique within your workspace.
- last_name (string) — Contact's last name.
- phone (string) — Phone number in E.164 format.
- company (string) — Company or organization name.
- job_title (string) — Contact's job title or role.
- source (string) — Lead source. Options:
website,referral,social,paid_ads,manual,api,import. - status (string) — Contact status. Default:
lead. - tags (array) — Array of tag strings.
- assigned_to (string) — User ID to assign this contact to.
- custom_fields (object) — Key-value pairs for custom fields defined in your workspace.
- address (object) — Address with
street,city,state,zip,countryfields.
Example
curl -X POST "https://app.automatenexuscrm.com/functions/v1/api/contacts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+15550199",
"company": "TechStart Inc",
"source": "api",
"tags": ["prospect", "saas"],
"custom_fields": {
"industry": "SaaS",
"company_size": "10-50"
}
}'
Update a Contact
PUT /v1/contacts/:id
Updates an existing contact. Only include the fields you want to change — omitted fields are not modified.
curl -X PUT "https://app.automatenexuscrm.com/functions/v1/api/contacts/con_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "customer",
"tags": ["enterprise", "paid"],
"custom_fields": { "plan": "enterprise" }
}'
Delete a Contact
DELETE /v1/contacts/:id
Permanently deletes a contact and all associated data. This action cannot be undone.
curl -X DELETE "https://app.automatenexuscrm.com/functions/v1/api/contacts/con_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
Bulk Create Contacts
POST /v1/contacts/bulk
Create up to 100 contacts in a single request. Returns a summary of successful and failed operations.
curl -X POST "https://app.automatenexuscrm.com/functions/v1/api/contacts/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
{"first_name": "Alice", "email": "alice@example.com"},
{"first_name": "Bob", "email": "bob@example.com"}
]
}'
Response
{
"success": true,
"data": {
"created": 2,
"failed": 0,
"errors": []
}
}
Merge Contacts
POST /v1/contacts/merge
Merge two duplicate contacts into one. The primary contact retains its data, and the secondary contact's unique data is added. The secondary contact is then deleted.
curl -X POST "https://app.automatenexuscrm.com/functions/v1/api/contacts/merge" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"primary_id": "con_abc123",
"secondary_id": "con_def456",
"merge_strategy": "prefer_primary"
}'
Search Contacts
GET /v1/contacts/search
Full-text search across contact names, emails, companies, and custom fields.
curl -X GET "https://app.automatenexuscrm.com/functions/v1/api/contacts/search?q=acme+corp&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
Contact Activities
GET /v1/contacts/:id/activities
Returns all activities (calls, emails, meetings, notes) associated with a contact.
Contact Timeline
GET /v1/contacts/:id/timeline
Returns a chronological timeline of all events related to a contact, including status changes, deal associations, email opens, page visits, and more.
Contact Deals
GET /v1/contacts/:id/deals
Returns all deals associated with a contact.
Contact Notes
GET /v1/contacts/:id/notes
POST /v1/contacts/:id/notes
List or create notes on a contact. Notes support markdown formatting.
Troubleshooting
- 409 Conflict on create: A contact with this email already exists. Use the search endpoint to find the existing contact, then update it instead.
- Custom fields not saving: Ensure the custom field keys match exactly what is defined in Settings → Custom Fields. Field keys are case-sensitive.
- Merge failing: Both contacts must belong to the same workspace. Contacts from different organizations cannot be merged.