import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; /** * A Chat is a conversation thread with one or more participants. * * To begin a chat, you must create a Chat with at least one recipient handle. * Including multiple handles creates a group chat. * * When creating a chat, the `from` field specifies which of your * authorized phone numbers the message originates from. Your authentication token grants * access to one or more phone numbers, but the `from` field determines the actual sender. * * **Handle Format:** * - Handles can be phone numbers or email addresses * - Phone numbers MUST be in E.164 format (starting with +) * - Phone format: `+[country code][subscriber number]` * - Example phone: `+12223334444` (US), `+442071234567` (UK), `+81312345678` (Japan) * - Example email: `user@example.com` * - No spaces, dashes, or parentheses in phone numbers */ export declare class Participants extends APIResource { /** * Add a new participant to an existing group chat. * * **Requirements:** * * - Group chats only (3+ existing participants) * - New participant must support the same messaging service as the group * - Cross-service additions not allowed (e.g., can't add RCS-only user to iMessage * group) * - For cross-service scenarios, create a new chat instead * * @example * ```ts * const response = await client.chats.participants.add( * '550e8400-e29b-41d4-a716-446655440000', * { handle: '+12052499136' }, * ); * ``` */ add(chatID: string, body: ParticipantAddParams, options?: RequestOptions): APIPromise; /** * Remove a participant from an existing group chat. * * **Requirements:** * * - Group chats only * - Must have 3+ participants after removal * * @example * ```ts * const participant = await client.chats.participants.remove( * '550e8400-e29b-41d4-a716-446655440000', * { handle: '+12052499136' }, * ); * ``` */ remove(chatID: string, body: ParticipantRemoveParams, options?: RequestOptions): APIPromise; } export interface ParticipantAddResponse { message?: string; status?: string; trace_id?: string; } export interface ParticipantRemoveResponse { message?: string; status?: string; trace_id?: string; } export interface ParticipantAddParams { /** * Phone number (E.164 format) or email address of the participant to add */ handle: string; } export interface ParticipantRemoveParams { /** * Phone number (E.164 format) or email address of the participant to remove */ handle: string; } export declare namespace Participants { export { type ParticipantAddResponse as ParticipantAddResponse, type ParticipantRemoveResponse as ParticipantRemoveResponse, type ParticipantAddParams as ParticipantAddParams, type ParticipantRemoveParams as ParticipantRemoveParams, }; } //# sourceMappingURL=participants.d.ts.map