Managing Contact Methods
Contact methods are created and managed through the beeps web UI at Settings > Profile. Your signup email is automatically added as a verified contact method.
The SDK and API provide read and delete access for programmatic management.
Listing Contact Methods
Section titled “Listing Contact Methods”const methods = await client.contactMethod.list({ userId: "usr_alice",});
console.log(`Found ${methods.length} contact methods`);
methods.forEach((method) => { console.log(`- ${method.transport}: ${method.value}`); console.log(` Verified: ${method.verified}`);});Filter by Transport Type
Section titled “Filter by Transport Type”const methods = await client.contactMethod.list({ userId: "usr_alice",});
const emailMethods = methods.filter((m) => m.transport === "email");const smsMethods = methods.filter((m) => m.transport === "sms");
console.log(`Emails: ${emailMethods.length}`);console.log(`SMS: ${smsMethods.length}`);curl -X GET "https://api.beeps.dev/v0/contact-methods?userId=usr_alice" \ -H "Authorization: Bearer YOUR_API_KEY"Response:
{ "contactMethods": [ { "id": "cm_abc123", "userId": "usr_alice", "transport": "email", "value": "alice@example.com", "verified": true, "createdAt": "2025-01-15T10:30:00Z", "updatedAt": "2025-01-15T10:30:00Z", "deletedAt": null }, { "id": "cm_def456", "userId": "usr_alice", "transport": "sms", "value": "+14155551234", "verified": false, "createdAt": "2025-01-15T11:00:00Z", "updatedAt": "2025-01-15T11:00:00Z", "deletedAt": null } ]}Deleting a Contact Method
Section titled “Deleting a Contact Method”const result = await client.contactMethod.delete("cm_abc123", { userId: "usr_alice",});
console.log("Deleted successfully:", result.success);Safe Method
Section titled “Safe Method”const result = await client.contactMethod.deleteSafe("cm_abc123", { userId: "usr_alice",});
if (result.error) { console.error("Failed to delete:", result.error.message);} else { console.log("Deleted:", result.data.success);}curl -X DELETE "https://api.beeps.dev/v0/contact-methods/cm_abc123?userId=usr_alice" \ -H "Authorization: Bearer YOUR_API_KEY"Response:
{ "success": true}Type Definitions
Section titled “Type Definitions”ContactMethod
Section titled “ContactMethod”type ContactMethod = { id: string; userId: string; transport: string; value: string; verified: boolean; createdAt: string; updatedAt: string; deletedAt: string | null;};ListContactMethodsParams
Section titled “ListContactMethodsParams”type ListContactMethodsParams = { userId: string;};DeleteContactMethodParams
Section titled “DeleteContactMethodParams”type DeleteContactMethodParams = { userId: string;};Troubleshooting
Section titled “Troubleshooting”No one receiving notifications? See Troubleshooting - No One Is Notified.