# Accounts ## List `client.Accounts.List(ctx) (*[]Account, error)` **get** `/v1/accounts` Lists chat accounts across networks (WhatsApp, Telegram, Twitter/X, etc.) actively connected to this Beeper Desktop instance ### Returns - `type AccountListResponse []Account` Connected accounts the user can act through. Includes accountID and user identity. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. - `User User` User the account belongs to. - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" ) func main() { client := beeperdesktopapi.NewClient( ) accounts, err := client.Accounts.List(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accounts) } ``` ## Domain Types ### Account - `type Account struct{…}` A chat account added to Beeper - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. - `User User` User the account belongs to. - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. # Contacts ## Search `client.Accounts.Contacts.Search(ctx, accountID, query) (*AccountContactSearchResponse, error)` **get** `/v1/accounts/{accountID}/contacts` Search contacts on a specific account using merged account contacts, network search, and exact identifier lookup. ### Parameters - `accountID string` Account ID this resource belongs to. - `query AccountContactSearchParams` - `Query param.Field[string]` Text to search users by. Network-specific behavior. ### Returns - `type AccountContactSearchResponse struct{…}` - `Items []User` - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" ) func main() { client := beeperdesktopapi.NewClient( ) response, err := client.Accounts.Contacts.Search( context.TODO(), "accountID", beeperdesktopapi.AccountContactSearchParams{ Query: "x", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Items) } ``` ## List `client.Accounts.Contacts.List(ctx, accountID, query) (*CursorSearch[User], error)` **get** `/v1/accounts/{accountID}/contacts/list` List merged contacts for a specific account with cursor-based pagination. ### Parameters - `accountID string` Account ID this resource belongs to. - `query AccountContactListParams` - `Cursor param.Field[string]` Opaque pagination cursor; do not inspect. Use together with 'direction'. - `Direction param.Field[AccountContactListParamsDirection]` Pagination direction used with 'cursor': 'before' fetches older results, 'after' fetches newer results. Defaults to 'before' when only 'cursor' is provided. - `const AccountContactListParamsDirectionAfter AccountContactListParamsDirection = "after"` - `const AccountContactListParamsDirectionBefore AccountContactListParamsDirection = "before"` - `Limit param.Field[int64]` Maximum contacts to return per page. - `Query param.Field[string]` Optional search query for blended contact lookup. ### Returns - `type User struct{…}` User the account belongs to. - `ID string` Stable Beeper user ID. Use as the primary key when referencing a person. - `CannotMessage bool` True if Beeper cannot initiate messages to this user (e.g., blocked, network restriction, or no DM path). The user may still message you. - `Email string` Email address if known. Not guaranteed verified. - `FullName string` Display name as shown in clients (e.g., 'Alice Example'). May include emojis. - `ImgURL string` Avatar image URL if available. May be temporary or local-only to this device; download promptly if durable access is needed. - `IsSelf bool` True if this user represents the authenticated account's own identity. - `PhoneNumber string` User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown. - `Username string` Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" ) func main() { client := beeperdesktopapi.NewClient( ) page, err := client.Accounts.Contacts.List( context.TODO(), "accountID", beeperdesktopapi.AccountContactListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ```