SDK
Contacts
Create and manage your contact list through the SDK.
Create a contact
A contact needs at least an email or a phone number:
const contact = await connect.contact.create({
email: "alice@example.com",
name: "Alice",
tags: ["beta-tester"],
metadata: { plan: "pro" },
});List contacts
const { items } = await connect.contact.list({
limit: 20,
offset: 0,
});Filter by email, phone, tags, or a search query:
const results = await connect.contact.list({
query: "alice",
tags: ["beta-tester"],
hasEmail: true,
limit: 50,
offset: 0,
});Get a contact
const contact = await connect.contact.get({ id: "ct_..." });Update a contact
await connect.contact.update({
id: "ct_...",
name: "Alice Smith",
tags: ["beta-tester", "vip"],
});Delete a contact
await connect.contact.delete({ id: "ct_..." });Bulk import
Import up to 1,000 contacts at once. Use onDuplicate to control what happens when a contact with the same email or phone already exists:
await connect.contact.bulkCreate({
contacts: [
{ email: "alice@example.com", name: "Alice" },
{ email: "bob@example.com", name: "Bob", tags: ["new"] },
{ phone: "+15551234567", name: "Charlie" },
],
onDuplicate: "update", // or "skip"
});skip— ignore duplicates, only insert new contactsupdate— overwrite existing contacts with the new data