Contact Methods API Reference
Complete API reference for the Contact Method resource in the beeps SDK.
Contact Method Methods
Section titled “Contact Method Methods”client.contactMethod.list(params)
Section titled “client.contactMethod.list(params)”List all contact methods for a user.
Parameters:
params: ListContactMethodsParams
Returns: Promise<ContactMethod[]>
Example:
const methods = await client.contactMethod.list({ userId: "usr_alice",});client.contactMethod.delete(id, params)
Section titled “client.contactMethod.delete(id, params)”Delete a contact method.
Parameters:
id: string- Contact method IDparams: DeleteContactMethodParams
Returns: Promise<{ success: boolean }>
Example:
await client.contactMethod.delete("cm_abc123", { userId: "usr_alice",});Safe Methods
Section titled “Safe Methods”All methods have corresponding *Safe variants that return Result<T> instead of throwing:
client.contactMethod.listSafe(params)
Section titled “client.contactMethod.listSafe(params)”Returns: Promise<Result<ContactMethod[]>>
client.contactMethod.deleteSafe(id, params)
Section titled “client.contactMethod.deleteSafe(id, params)”Returns: Promise<Result<{ success: boolean }>>
ContactMethodTransport
Section titled “ContactMethodTransport”type ContactMethodTransport = "email" | "sms";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;};HTTP Endpoints
Section titled “HTTP Endpoints”List Contact Methods
Section titled “List Contact Methods”GET /v0/contact-methods?userId=usr_aliceQuery Parameters:
userId(required): User ID to list contact methods for
Delete Contact Method
Section titled “Delete Contact Method”DELETE /v0/contact-methods/:id?userId=usr_aliceQuery Parameters:
userId(required): User ID (for authorization)
Authentication
Section titled “Authentication”All API requests require authentication using your API key:
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.beeps.dev/v0/contact-methods?userId=usr_alice