contacts-management
Manage multi-channel contacts with channel operations, merge suggestions, and phone introspection.
What this skill does
# Contacts Management ## When to Use Use this skill when building code to create, update, or manage contacts and their communication channels. Covers the multi-channel contact model, merge operations, and phone number introspection. ## Contact Model Contacts are multi-channel: one contact can have multiple channels (SMS, WhatsApp, Email, Telegram, Voice), each with its own identifier and delivery metrics. Top-level fields expose primary identifiers for quick access. ``` Contact (John Doe) ├── primaryPhone: +14155551234 (E.164) ├── primaryEmail: [email protected] ├── profileName: "John D." (WhatsApp profile name, if available) ├── verified: true ├── countryCode: "US" └── Channels: ├── SMS: +14155551234 (primary) ├── WhatsApp: +14155551234 (primary) ├── Email: [email protected] (primary) ├── Email: [email protected] (label: "work") ├── Telegram: @johndoe └── Voice: +14155551234 ``` > **Note:** The legacy `phoneNumber` field on Contact is deprecated — use `primaryPhone` instead. Valid contact channel types: `sms`, `whatsapp`, `email`, `telegram`, `voice` (note: `instagram`, `auto`, `sms_oneway` are message-send channels, not contact channel types). ## Auto-Creation Contacts are automatically created when you send a message to a new recipient. No explicit creation needed for basic messaging. ## Create Contact ```typescript const contact = await zavu.contacts.create({ displayName: "John Doe", channels: [ { channel: "sms", identifier: "+14155551234", isPrimary: true }, { channel: "whatsapp", identifier: "+14155551234", isPrimary: true }, { channel: "email", identifier: "[email protected]", isPrimary: true }, ], metadata: { source: "import", plan: "enterprise" }, }); console.log(contact.id); ``` **Python:** ```python contact = zavu.contacts.create( display_name="John Doe", channels=[ {"channel": "sms", "identifier": "+14155551234", "isPrimary": True}, {"channel": "email", "identifier": "[email protected]", "isPrimary": True}, ], ) ``` **Go:** ```go contact, err := client.Contacts.Create(context.TODO(), zavudev.ContactCreateParams{ DisplayName: zavudev.String("John Doe"), Channels: []zavudev.ContactChannelParam{ {Channel: "sms", Identifier: "+14155551234", IsPrimary: zavudev.Bool(true)}, {Channel: "email", Identifier: "[email protected]", IsPrimary: zavudev.Bool(true)}, }, }) ``` **Ruby:** ```ruby contact = client.contacts.create( display_name: "John Doe", channels: [ { channel: "sms", identifier: "+14155551234", is_primary: true }, { channel: "email", identifier: "[email protected]", is_primary: true }, ], ) ``` **PHP:** ```php $contact = $client->contacts->create([ 'displayName' => 'John Doe', 'channels' => [ ['channel' => 'sms', 'identifier' => '+14155551234', 'isPrimary' => true], ['channel' => 'email', 'identifier' => '[email protected]', 'isPrimary' => true], ], ]); ``` ## Get & List Contacts ```typescript // Get by ID const contact = await zavu.contacts.get({ contactId: "ct_abc123" }); // Get by phone number const contact = await zavu.contacts.getByPhone({ phoneNumber: "+14155551234", }); // List with filters let cursor: string | undefined; do { const result = await zavu.contacts.list({ phoneNumber: "+14155551234", limit: 50, cursor, }); for (const contact of result.items) { console.log(contact.id, contact.displayName, contact.availableChannels); } cursor = result.nextCursor ?? undefined; } while (cursor); ``` ## Channel Operations ```typescript // Add channel const channel = await zavu.contacts.channels.add({ contactId: "ct_abc123", channel: "email", identifier: "[email protected]", label: "work", // optional countryCode: "US", // optional, 2-letter ISO }); // Update channel await zavu.contacts.channels.update({ contactId: "ct_abc123", channelId: "ch_xyz789", label: "personal", verified: true, }); // Set as primary await zavu.contacts.channels.setPrimary({ contactId: "ct_abc123", channelId: "ch_xyz789", }); // Remove channel (cannot remove the last channel) await zavu.contacts.channels.remove({ contactId: "ct_abc123", channelId: "ch_xyz789", }); ``` ## Update Contact ```typescript await zavu.contacts.update({ contactId: "ct_abc123", defaultChannel: "whatsapp", metadata: { plan: "premium", region: "US" }, }); // Clear default channel await zavu.contacts.update({ contactId: "ct_abc123", defaultChannel: null, }); ``` ## Merge Contacts When duplicate contacts are detected, the API suggests merges: ```typescript // Check for merge suggestion const contact = await zavu.contacts.get({ contactId: "ct_abc123" }); if (contact.suggestedMergeWith) { // Merge source into target (all channels move to target) const merged = await zavu.contacts.merge({ contactId: "ct_abc123", sourceContactId: contact.suggestedMergeWith, }); console.log("Merged channels:", merged.channels.length); } // Dismiss suggestion await zavu.contacts.mergeSuggestion.dismiss({ contactId: "ct_abc123", }); ``` ## Phone Introspection Validate phone numbers and check carrier info: ```typescript const result = await zavu.introspect.phone({ phoneNumber: "+14155551234", }); console.log(result.validNumber); // true console.log(result.countryCode); // "US" console.log(result.nationalFormat); // "(415) 555-1234" console.log(result.lineType); // "mobile" | "landline" | "voip" | "toll_free" console.log(result.carrier?.name); // "Verizon Wireless" console.log(result.availableChannels); // ["sms", "whatsapp", "voice"] ``` **Python:** ```python result = zavu.introspect.phone(phone_number="+14155551234") print(result.valid_number) print(result.line_type) print(result.carrier.name if result.carrier else "Unknown") ``` **Go:** ```go result, err := client.Introspect.Phone(context.TODO(), zavudev.PhoneIntrospectionParams{ PhoneNumber: zavudev.String("+14155551234"), }) fmt.Println(result.ValidNumber, result.LineType, result.Carrier.Name) ``` **Ruby:** ```ruby result = client.introspect.phone(phone_number: "+14155551234") puts result.valid_number, result.line_type, result.carrier&.name ``` **PHP:** ```php $result = $client->introspect->phone(['phoneNumber' => '+14155551234']); echo $result->validNumber, $result->lineType, $result->carrier?->name; ``` ## Constraints - Max 20 channels per contact - Channel labels: max 50 characters - Display name: max 200 characters - Cannot remove the last channel from a contact - Cannot merge a contact with itself - Phone numbers must be E.164 format - Duplicate identifiers across contacts are rejected (use merge instead)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.