Skip to content

Contact Methods API Reference

Complete API reference for the Contact Method resource in the beeps SDK.

List all contact methods for a user.

Parameters:

  • params: ListContactMethodsParams

Returns: Promise<ContactMethod[]>

Example:

const methods = await client.contactMethod.list({
userId: "usr_alice",
});

Delete a contact method.

Parameters:

  • id: string - Contact method ID
  • params: DeleteContactMethodParams

Returns: Promise<{ success: boolean }>

Example:

await client.contactMethod.delete("cm_abc123", {
userId: "usr_alice",
});

All methods have corresponding *Safe variants that return Result<T> instead of throwing:

Returns: Promise<Result<ContactMethod[]>>

client.contactMethod.deleteSafe(id, params)

Section titled “client.contactMethod.deleteSafe(id, params)”

Returns: Promise<Result<{ success: boolean }>>

type ContactMethodTransport = "email" | "sms";
type ContactMethod = {
id: string;
userId: string;
transport: string;
value: string;
verified: boolean;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
};
type ListContactMethodsParams = {
userId: string;
};
type DeleteContactMethodParams = {
userId: string;
};
GET /v0/contact-methods?userId=usr_alice

Query Parameters:

  • userId (required): User ID to list contact methods for
DELETE /v0/contact-methods/:id?userId=usr_alice

Query Parameters:

  • userId (required): User ID (for authorization)

All API requests require authentication using your API key:

Terminal window
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.beeps.dev/v0/contact-methods?userId=usr_alice