Contacts API
List, create, update, search, and manage contacts with filters and tags.
Methods
list(options)List contacts with optional filters: limit, industry, country, seniority, cursor.
get(id)Get a single contact by ID.
create(data)Create a new contact with email, firstName, lastName, company, tags.
update(id, data)Update an existing contact.
delete(id)Delete a contact.
search(query)Search contacts by email or name.
listAll(options)Async generator for automatic pagination over all contacts.
Example
// List with filters
const { data, meta } = await lystica.contacts.list({
limit: 100,
industry: "Finance",
country: "United States",
seniority: "Director",
});
// Get by ID
const contact = await lystica.contacts.get("cnt_abc123");
// Create
const newContact = await lystica.contacts.create({
email: "jane@example.com",
firstName: "Jane",
lastName: "Doe",
company: "Acme Inc",
tags: ["lead", "enterprise"],
});
// Update
const updated = await lystica.contacts.update("cnt_abc123", {
jobTitle: "VP of Engineering",
});
// Delete
await lystica.contacts.delete("cnt_abc123");
// Search
const { data: results } = await lystica.contacts.search("jane@example.com");
// Tag management
await lystica.contacts.addTags("cnt_abc123", ["vip"]);
await lystica.contacts.removeTags("cnt_abc123", ["old-tag"]);
// Iterate all (auto-pagination)
for await (const contact of lystica.contacts.listAll({ industry: "SaaS" })) {
console.log(contact.fullName);
}