# Bridges ## List available bridges `client.Bridges.List(ctx) (*BridgeListResponse, error)` **get** `/v1/bridges` List available bridges. A bridge is a chat-network connector that can connect or reconnect chat accounts. Connected accounts use the same Account schema as GET /v1/accounts. ### Returns - `type BridgeListResponse struct{…}` Available bridges and their connected accounts. - `Items []Bridge` - `ID string` Bridge ID. Use with bridge endpoints. - `Accounts []Account` Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `ActiveAccountCount int64` Number of active accounts for this network on this device. - `DisplayName string` Human-friendly bridge name shown in Beeper. - `Provider BridgeProvider` Where accounts for this bridge run: on this device or in Beeper Cloud. - `const BridgeProviderCloud BridgeProvider = "cloud"` - `const BridgeProviderSelfHosted BridgeProvider = "self-hosted"` - `const BridgeProviderLocal BridgeProvider = "local"` - `const BridgeProviderPlatformSDK BridgeProvider = "platform-sdk"` - `Status BridgeStatus` Whether this bridge can currently be used to connect new accounts. - `const BridgeStatusAvailable BridgeStatus = "available"` - `const BridgeStatusConnected BridgeStatus = "connected"` - `const BridgeStatusLimitReached BridgeStatus = "limit_reached"` - `const BridgeStatusTemporarilyUnavailable BridgeStatus = "temporarily_unavailable"` - `const BridgeStatusDisabled BridgeStatus = "disabled"` - `SupportsMultipleAccounts bool` Whether this bridge can have multiple active accounts for the same network. - `Type string` Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. - `Network string` Network grouping used for account counts and limits. - `StatusText string` Human-friendly status text matching Beeper account management language. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) bridges, err := client.Bridges.List(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", bridges.Items) } ``` #### Response ```json { "items": [ { "id": "id", "accounts": [ { "accountID": "accountID", "bridge": { "id": "id", "provider": "cloud", "type": "type" }, "status": "connected", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" }, "capabilities": { "foo": "bar" }, "loginID": "loginID", "network": "network", "statusText": "statusText" } ], "activeAccountCount": 0, "displayName": "displayName", "provider": "cloud", "status": "available", "supportsMultipleAccounts": true, "type": "type", "network": "network", "statusText": "statusText" } ] } ``` ## Get bridge `client.Bridges.Get(ctx, bridgeID) (*BridgeGetResponse, error)` **get** `/v1/bridges/{bridgeID}` Get one bridge, including the chat accounts connected through it. ### Parameters - `bridgeID string` Bridge ID. ### Returns - `type BridgeGetResponse struct{…}` Available bridge that can connect or reconnect chat accounts. - `ID string` Bridge ID. Use with bridge endpoints. - `Accounts []Account` Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `ActiveAccountCount int64` Number of active accounts for this network on this device. - `DisplayName string` Human-friendly bridge name shown in Beeper. - `Provider BridgeGetResponseProvider` Where accounts for this bridge run: on this device or in Beeper Cloud. - `const BridgeGetResponseProviderCloud BridgeGetResponseProvider = "cloud"` - `const BridgeGetResponseProviderSelfHosted BridgeGetResponseProvider = "self-hosted"` - `const BridgeGetResponseProviderLocal BridgeGetResponseProvider = "local"` - `const BridgeGetResponseProviderPlatformSDK BridgeGetResponseProvider = "platform-sdk"` - `Status BridgeGetResponseStatus` Whether this bridge can currently be used to connect new accounts. - `const BridgeGetResponseStatusAvailable BridgeGetResponseStatus = "available"` - `const BridgeGetResponseStatusConnected BridgeGetResponseStatus = "connected"` - `const BridgeGetResponseStatusLimitReached BridgeGetResponseStatus = "limit_reached"` - `const BridgeGetResponseStatusTemporarilyUnavailable BridgeGetResponseStatus = "temporarily_unavailable"` - `const BridgeGetResponseStatusDisabled BridgeGetResponseStatus = "disabled"` - `SupportsMultipleAccounts bool` Whether this bridge can have multiple active accounts for the same network. - `Type string` Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. - `Network string` Network grouping used for account counts and limits. - `StatusText string` Human-friendly status text matching Beeper account management language. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) bridge, err := client.Bridges.Get(context.TODO(), "local-whatsapp") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", bridge.ID) } ``` #### Response ```json { "id": "id", "accounts": [ { "accountID": "accountID", "bridge": { "id": "id", "provider": "cloud", "type": "type" }, "status": "connected", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" }, "capabilities": { "foo": "bar" }, "loginID": "loginID", "network": "network", "statusText": "statusText" } ], "activeAccountCount": 0, "displayName": "displayName", "provider": "cloud", "status": "available", "supportsMultipleAccounts": true, "type": "type", "network": "network", "statusText": "statusText" } ``` ## Get bridge capabilities `client.Bridges.GetCapabilities(ctx, bridgeID) (*ProvisioningCapabilities, error)` **get** `/v1/bridges/{bridgeID}/capabilities` Get advanced network capabilities for a bridge. This endpoint is intended for clients that build custom connect or chat-creation flows. ### Parameters - `bridgeID string` Bridge ID. ### Returns - `type ProvisioningCapabilities struct{…}` Advanced network capabilities for account lookup and group creation. - `GroupCreation map[string, GroupTypeCapabilities]` - `TypeDescription string` - `Avatar GroupFieldCapability` Group creation field capability. - `Allowed bool` - `MaxLength int64` - `MinLength int64` - `Required bool` - `Settings DisappearingTimerCapability` Disappearing-message timer capability. - `Types []string` - `const DisappearingTimerCapabilityTypeEmpty DisappearingTimerCapabilityType = ""` - `const DisappearingTimerCapabilityTypeAfterRead DisappearingTimerCapabilityType = "after_read"` - `const DisappearingTimerCapabilityTypeAfterSend DisappearingTimerCapabilityType = "after_send"` - `OmitEmptyTimer bool` - `const DisappearingTimerCapabilityOmitEmptyTimerTrue DisappearingTimerCapabilityOmitEmptyTimer = true` - `Timers []int64` - `Disappear GroupFieldCapability` Group creation field capability. - `Name GroupFieldCapability` Group creation field capability. - `Parent GroupFieldCapability` Group creation field capability. - `Participants GroupFieldCapability` Group creation field capability. - `Topic GroupFieldCapability` Group creation field capability. - `Username GroupFieldCapability` Group creation field capability. - `ResolveIdentifier ResolveIdentifierCapabilities` Identifier lookup capabilities for this bridge. - `AnyPhone bool` - `ContactList bool` - `CreateDM bool` - `LookupEmail bool` - `LookupPhone bool` - `LookupUsername bool` - `Search bool` - `ImagePackImport bool` ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) provisioningCapabilities, err := client.Bridges.GetCapabilities(context.TODO(), "local-whatsapp") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", provisioningCapabilities.ResolveIdentifier) } ``` #### Response ```json { "group_creation": { "foo": { "type_description": "type_description", "avatar": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } }, "disappear": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } }, "name": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } }, "parent": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } }, "participants": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } }, "topic": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } }, "username": { "allowed": true, "max_length": 0, "min_length": 0, "required": true, "settings": { "types": [ "" ], "omit_empty_timer": true, "timers": [ 0 ] } } } }, "resolve_identifier": { "any_phone": true, "contact_list": true, "create_dm": true, "lookup_email": true, "lookup_phone": true, "lookup_username": true, "search": true }, "image_pack_import": true } ``` ## Domain Types ### Bridge - `type Bridge struct{…}` Available bridge that can connect or reconnect chat accounts. - `ID string` Bridge ID. Use with bridge endpoints. - `Accounts []Account` Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `ActiveAccountCount int64` Number of active accounts for this network on this device. - `DisplayName string` Human-friendly bridge name shown in Beeper. - `Provider BridgeProvider` Where accounts for this bridge run: on this device or in Beeper Cloud. - `const BridgeProviderCloud BridgeProvider = "cloud"` - `const BridgeProviderSelfHosted BridgeProvider = "self-hosted"` - `const BridgeProviderLocal BridgeProvider = "local"` - `const BridgeProviderPlatformSDK BridgeProvider = "platform-sdk"` - `Status BridgeStatus` Whether this bridge can currently be used to connect new accounts. - `const BridgeStatusAvailable BridgeStatus = "available"` - `const BridgeStatusConnected BridgeStatus = "connected"` - `const BridgeStatusLimitReached BridgeStatus = "limit_reached"` - `const BridgeStatusTemporarilyUnavailable BridgeStatus = "temporarily_unavailable"` - `const BridgeStatusDisabled BridgeStatus = "disabled"` - `SupportsMultipleAccounts bool` Whether this bridge can have multiple active accounts for the same network. - `Type string` Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. - `Network string` Network grouping used for account counts and limits. - `StatusText string` Human-friendly status text matching Beeper account management language. ### Cookie Field - `type CookieField struct{…}` - `ID string` Field ID to send back in the fields object. - `Name string` Cookie, header, or local storage key to collect. - `Type CookieFieldType` Browser storage source for this value. - `const CookieFieldTypeCookie CookieFieldType = "cookie"` - `const CookieFieldTypeHeader CookieFieldType = "header"` - `const CookieFieldTypeLocalStorage CookieFieldType = "local_storage"` ### Disappearing Timer Capability - `type DisappearingTimerCapability struct{…}` Disappearing-message timer capability. - `Types []string` - `const DisappearingTimerCapabilityTypeEmpty DisappearingTimerCapabilityType = ""` - `const DisappearingTimerCapabilityTypeAfterRead DisappearingTimerCapabilityType = "after_read"` - `const DisappearingTimerCapabilityTypeAfterSend DisappearingTimerCapabilityType = "after_send"` - `OmitEmptyTimer bool` - `const DisappearingTimerCapabilityOmitEmptyTimerTrue DisappearingTimerCapabilityOmitEmptyTimer = true` - `Timers []int64` ### Group Field Capability - `type GroupFieldCapability struct{…}` Group creation field capability. - `Allowed bool` - `MaxLength int64` - `MinLength int64` - `Required bool` - `Settings DisappearingTimerCapability` Disappearing-message timer capability. - `Types []string` - `const DisappearingTimerCapabilityTypeEmpty DisappearingTimerCapabilityType = ""` - `const DisappearingTimerCapabilityTypeAfterRead DisappearingTimerCapabilityType = "after_read"` - `const DisappearingTimerCapabilityTypeAfterSend DisappearingTimerCapabilityType = "after_send"` - `OmitEmptyTimer bool` - `const DisappearingTimerCapabilityOmitEmptyTimerTrue DisappearingTimerCapabilityOmitEmptyTimer = true` - `Timers []int64` ### Group Type Capabilities - `type GroupTypeCapabilities struct{…}` Group creation capabilities for one group type. - `TypeDescription string` - `Avatar GroupFieldCapability` Group creation field capability. - `Allowed bool` - `MaxLength int64` - `MinLength int64` - `Required bool` - `Settings DisappearingTimerCapability` Disappearing-message timer capability. - `Types []string` - `const DisappearingTimerCapabilityTypeEmpty DisappearingTimerCapabilityType = ""` - `const DisappearingTimerCapabilityTypeAfterRead DisappearingTimerCapabilityType = "after_read"` - `const DisappearingTimerCapabilityTypeAfterSend DisappearingTimerCapabilityType = "after_send"` - `OmitEmptyTimer bool` - `const DisappearingTimerCapabilityOmitEmptyTimerTrue DisappearingTimerCapabilityOmitEmptyTimer = true` - `Timers []int64` - `Disappear GroupFieldCapability` Group creation field capability. - `Name GroupFieldCapability` Group creation field capability. - `Parent GroupFieldCapability` Group creation field capability. - `Participants GroupFieldCapability` Group creation field capability. - `Topic GroupFieldCapability` Group creation field capability. - `Username GroupFieldCapability` Group creation field capability. ### Login Flow - `type LoginFlow struct{…}` Connect or reconnect flow option for a bridge. - `ID string` Flow ID to pass when creating a bridge login session. - `Description string` Short explanation for when to use this flow, when provided. - `Name string` Display name for the flow, when provided. ### Login Input Field - `type LoginInputField struct{…}` - `ID string` Field ID to send back in the fields object. - `InitialValue string` Initial field value, when provided by the network. - `Label string` Field label to show to the user. - `Optional bool` True if the user can leave this field empty. - `Placeholder string` Placeholder text to show when the field is empty. - `Type string` Suggested input type, such as text, password, or email. ### Login Session - `type LoginSession struct{…}` - `BridgeID string` Bridge ID. - `LoginSessionID string` Temporary bridge login session ID. - `Status LoginSessionStatus` - `const LoginSessionStatusWaitingForInput LoginSessionStatus = "waiting_for_input"` - `const LoginSessionStatusWaitingForCookies LoginSessionStatus = "waiting_for_cookies"` - `const LoginSessionStatusWaitingForDisplay LoginSessionStatus = "waiting_for_display"` - `const LoginSessionStatusComplete LoginSessionStatus = "complete"` - `const LoginSessionStatusCancelled LoginSessionStatus = "cancelled"` - `const LoginSessionStatusFailed LoginSessionStatus = "failed"` - `Account Account` A chat account added to Beeper. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `AccountID string` Chat account ID for reconnect flows, when known. - `CurrentStep LoginSessionCurrentStepUnion` Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed. - `type LoginSessionCurrentStepUserInput struct{…}` - `Fields []LoginInputField` - `ID string` Field ID to send back in the fields object. - `InitialValue string` Initial field value, when provided by the network. - `Label string` Field label to show to the user. - `Optional bool` True if the user can leave this field empty. - `Placeholder string` Placeholder text to show when the field is empty. - `Type string` Suggested input type, such as text, password, or email. - `StepID string` - `Type UserInput` - `const UserInputUserInput UserInput = "user_input"` - `Attachments []any` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepCookies struct{…}` - `Fields []CookieField` - `ID string` Field ID to send back in the fields object. - `Name string` Cookie, header, or local storage key to collect. - `Type CookieFieldType` Browser storage source for this value. - `const CookieFieldTypeCookie CookieFieldType = "cookie"` - `const CookieFieldTypeHeader CookieFieldType = "header"` - `const CookieFieldTypeLocalStorage CookieFieldType = "local_storage"` - `StepID string` - `Type Cookies` - `const CookiesCookies Cookies = "cookies"` - `URL string` URL to open for the user. - `ExpectedFinalURLRegex string` Regular expression that identifies the final URL after sign-in. - `ExtractJs string` Optional extraction script for browser-based sign-in helpers. Treat as an opaque helper value. - `Instructions string` User-facing instructions for this browser step. - `UserAgent string` Suggested user agent for the browser session. - `type LoginSessionCurrentStepDisplayAndWait struct{…}` - `Display LoginSessionCurrentStepDisplayAndWaitDisplayUnion` - `type LoginSessionCurrentStepDisplayAndWaitDisplayQrCode struct{…}` - `Data string` - `Type Qr` - `const QrQr Qr = "qr"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmoji struct{…}` - `ImageURL string` - `Type Emoji` - `const EmojiEmoji Emoji = "emoji"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmpty struct{…}` - `Type Nothing` - `const NothingNothing Nothing = "nothing"` - `StepID string` - `Type DisplayAndWait` - `const DisplayAndWaitDisplayAndWait DisplayAndWait = "display_and_wait"` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepComplete struct{…}` - `Type Complete` - `const CompleteComplete Complete = "complete"` - `Account Account` A chat account added to Beeper. - `Instructions string` Completion instructions, when provided. - `Login LoginSessionCurrentStepCompleteLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeCurrentDevice LoginSessionCurrentStepCompleteLoginRemoveScope = "current-device"` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeAllDevices LoginSessionCurrentStepCompleteLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionCurrentStepCompleteLoginStatusConnected LoginSessionCurrentStepCompleteLoginStatus = "connected"` - `const LoginSessionCurrentStepCompleteLoginStatusConnecting LoginSessionCurrentStepCompleteLoginStatus = "connecting"` - `const LoginSessionCurrentStepCompleteLoginStatusNeedsLogin LoginSessionCurrentStepCompleteLoginStatus = "needs_login"` - `const LoginSessionCurrentStepCompleteLoginStatusLoggedOut LoginSessionCurrentStepCompleteLoginStatus = "logged_out"` - `const LoginSessionCurrentStepCompleteLoginStatusUnknown LoginSessionCurrentStepCompleteLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `StepID string` - `Error APIError` - `Code string` - `Message string` - `Details map[string, any]` - `Login LoginSessionLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionLoginRemoveScopeCurrentDevice LoginSessionLoginRemoveScope = "current-device"` - `const LoginSessionLoginRemoveScopeAllDevices LoginSessionLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionLoginStatusConnected LoginSessionLoginStatus = "connected"` - `const LoginSessionLoginStatusConnecting LoginSessionLoginStatus = "connecting"` - `const LoginSessionLoginStatusNeedsLogin LoginSessionLoginStatus = "needs_login"` - `const LoginSessionLoginStatusLoggedOut LoginSessionLoginStatus = "logged_out"` - `const LoginSessionLoginStatusUnknown LoginSessionLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `LoginID string` Bridge login ID for reconnect flows, when known. ### Provisioning Capabilities - `type ProvisioningCapabilities struct{…}` Advanced network capabilities for account lookup and group creation. - `GroupCreation map[string, GroupTypeCapabilities]` - `TypeDescription string` - `Avatar GroupFieldCapability` Group creation field capability. - `Allowed bool` - `MaxLength int64` - `MinLength int64` - `Required bool` - `Settings DisappearingTimerCapability` Disappearing-message timer capability. - `Types []string` - `const DisappearingTimerCapabilityTypeEmpty DisappearingTimerCapabilityType = ""` - `const DisappearingTimerCapabilityTypeAfterRead DisappearingTimerCapabilityType = "after_read"` - `const DisappearingTimerCapabilityTypeAfterSend DisappearingTimerCapabilityType = "after_send"` - `OmitEmptyTimer bool` - `const DisappearingTimerCapabilityOmitEmptyTimerTrue DisappearingTimerCapabilityOmitEmptyTimer = true` - `Timers []int64` - `Disappear GroupFieldCapability` Group creation field capability. - `Name GroupFieldCapability` Group creation field capability. - `Parent GroupFieldCapability` Group creation field capability. - `Participants GroupFieldCapability` Group creation field capability. - `Topic GroupFieldCapability` Group creation field capability. - `Username GroupFieldCapability` Group creation field capability. - `ResolveIdentifier ResolveIdentifierCapabilities` Identifier lookup capabilities for this bridge. - `AnyPhone bool` - `ContactList bool` - `CreateDM bool` - `LookupEmail bool` - `LookupPhone bool` - `LookupUsername bool` - `Search bool` - `ImagePackImport bool` ### Resolve Identifier Capabilities - `type ResolveIdentifierCapabilities struct{…}` Identifier lookup capabilities for this bridge. - `AnyPhone bool` - `ContactList bool` - `CreateDM bool` - `LookupEmail bool` - `LookupPhone bool` - `LookupUsername bool` - `Search bool` # Login Flows ## List login flows `client.Bridges.LoginFlows.List(ctx, bridgeID) (*BridgeLoginFlowListResponse, error)` **get** `/v1/bridges/{bridgeID}/login-flows` List connect and reconnect flow options for a bridge. Use a flowID when creating a bridge login session. ### Parameters - `bridgeID string` Bridge ID. ### Returns - `type BridgeLoginFlowListResponse struct{…}` - `Items []LoginFlow` - `ID string` Flow ID to pass when creating a bridge login session. - `Description string` Short explanation for when to use this flow, when provided. - `Name string` Display name for the flow, when provided. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) loginFlows, err := client.Bridges.LoginFlows.List(context.TODO(), "local-whatsapp") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", loginFlows.Items) } ``` #### Response ```json { "items": [ { "id": "id", "description": "description", "name": "name" } ] } ``` # Connections # Login Sessions ## Create bridge login session `client.Bridges.LoginSessions.New(ctx, bridgeID, body) (*LoginSession, error)` **post** `/v1/bridges/{bridgeID}/login-sessions` Start a temporary bridge login session to connect a new chat account or reconnect an existing bridge login. Omit loginID and accountID to connect a new account. ### Parameters - `bridgeID string` Bridge ID. - `body BridgeLoginSessionNewParams` - `AccountID param.Field[string]` Existing chat account ID to reconnect. Omit to connect a new account. - `FlowID param.Field[string]` Optional flow ID returned by the list login flows endpoint. If omitted, Beeper chooses the default flow. - `LoginID param.Field[string]` Existing bridge login ID to reconnect. Omit to connect a new account. ### Returns - `type LoginSession struct{…}` - `BridgeID string` Bridge ID. - `LoginSessionID string` Temporary bridge login session ID. - `Status LoginSessionStatus` - `const LoginSessionStatusWaitingForInput LoginSessionStatus = "waiting_for_input"` - `const LoginSessionStatusWaitingForCookies LoginSessionStatus = "waiting_for_cookies"` - `const LoginSessionStatusWaitingForDisplay LoginSessionStatus = "waiting_for_display"` - `const LoginSessionStatusComplete LoginSessionStatus = "complete"` - `const LoginSessionStatusCancelled LoginSessionStatus = "cancelled"` - `const LoginSessionStatusFailed LoginSessionStatus = "failed"` - `Account Account` A chat account added to Beeper. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `AccountID string` Chat account ID for reconnect flows, when known. - `CurrentStep LoginSessionCurrentStepUnion` Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed. - `type LoginSessionCurrentStepUserInput struct{…}` - `Fields []LoginInputField` - `ID string` Field ID to send back in the fields object. - `InitialValue string` Initial field value, when provided by the network. - `Label string` Field label to show to the user. - `Optional bool` True if the user can leave this field empty. - `Placeholder string` Placeholder text to show when the field is empty. - `Type string` Suggested input type, such as text, password, or email. - `StepID string` - `Type UserInput` - `const UserInputUserInput UserInput = "user_input"` - `Attachments []any` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepCookies struct{…}` - `Fields []CookieField` - `ID string` Field ID to send back in the fields object. - `Name string` Cookie, header, or local storage key to collect. - `Type CookieFieldType` Browser storage source for this value. - `const CookieFieldTypeCookie CookieFieldType = "cookie"` - `const CookieFieldTypeHeader CookieFieldType = "header"` - `const CookieFieldTypeLocalStorage CookieFieldType = "local_storage"` - `StepID string` - `Type Cookies` - `const CookiesCookies Cookies = "cookies"` - `URL string` URL to open for the user. - `ExpectedFinalURLRegex string` Regular expression that identifies the final URL after sign-in. - `ExtractJs string` Optional extraction script for browser-based sign-in helpers. Treat as an opaque helper value. - `Instructions string` User-facing instructions for this browser step. - `UserAgent string` Suggested user agent for the browser session. - `type LoginSessionCurrentStepDisplayAndWait struct{…}` - `Display LoginSessionCurrentStepDisplayAndWaitDisplayUnion` - `type LoginSessionCurrentStepDisplayAndWaitDisplayQrCode struct{…}` - `Data string` - `Type Qr` - `const QrQr Qr = "qr"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmoji struct{…}` - `ImageURL string` - `Type Emoji` - `const EmojiEmoji Emoji = "emoji"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmpty struct{…}` - `Type Nothing` - `const NothingNothing Nothing = "nothing"` - `StepID string` - `Type DisplayAndWait` - `const DisplayAndWaitDisplayAndWait DisplayAndWait = "display_and_wait"` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepComplete struct{…}` - `Type Complete` - `const CompleteComplete Complete = "complete"` - `Account Account` A chat account added to Beeper. - `Instructions string` Completion instructions, when provided. - `Login LoginSessionCurrentStepCompleteLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeCurrentDevice LoginSessionCurrentStepCompleteLoginRemoveScope = "current-device"` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeAllDevices LoginSessionCurrentStepCompleteLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionCurrentStepCompleteLoginStatusConnected LoginSessionCurrentStepCompleteLoginStatus = "connected"` - `const LoginSessionCurrentStepCompleteLoginStatusConnecting LoginSessionCurrentStepCompleteLoginStatus = "connecting"` - `const LoginSessionCurrentStepCompleteLoginStatusNeedsLogin LoginSessionCurrentStepCompleteLoginStatus = "needs_login"` - `const LoginSessionCurrentStepCompleteLoginStatusLoggedOut LoginSessionCurrentStepCompleteLoginStatus = "logged_out"` - `const LoginSessionCurrentStepCompleteLoginStatusUnknown LoginSessionCurrentStepCompleteLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `StepID string` - `Error APIError` - `Code string` - `Message string` - `Details map[string, any]` - `Login LoginSessionLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionLoginRemoveScopeCurrentDevice LoginSessionLoginRemoveScope = "current-device"` - `const LoginSessionLoginRemoveScopeAllDevices LoginSessionLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionLoginStatusConnected LoginSessionLoginStatus = "connected"` - `const LoginSessionLoginStatusConnecting LoginSessionLoginStatus = "connecting"` - `const LoginSessionLoginStatusNeedsLogin LoginSessionLoginStatus = "needs_login"` - `const LoginSessionLoginStatusLoggedOut LoginSessionLoginStatus = "logged_out"` - `const LoginSessionLoginStatusUnknown LoginSessionLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `LoginID string` Bridge login ID for reconnect flows, when known. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) loginSession, err := client.Bridges.LoginSessions.New( context.TODO(), "local-whatsapp", beeperdesktopapi.BridgeLoginSessionNewParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", loginSession.BridgeID) } ``` #### Response ```json { "bridgeID": "bridgeID", "loginSessionID": "loginSessionID", "status": "waiting_for_input", "account": { "accountID": "accountID", "bridge": { "id": "id", "provider": "cloud", "type": "type" }, "status": "connected", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" }, "capabilities": { "foo": "bar" }, "loginID": "loginID", "network": "network", "statusText": "statusText" }, "accountID": "accountID", "currentStep": { "fields": [ { "id": "id", "initialValue": "initialValue", "label": "label", "optional": true, "placeholder": "placeholder", "type": "type" } ], "stepID": "stepID", "type": "user_input", "attachments": [ {} ], "instructions": "instructions" }, "error": { "code": "code", "message": "message", "details": { "foo": "bar" } }, "login": { "bridgeID": "bridgeID", "loginID": "loginID", "removeScopes": [ "current-device" ], "status": "connected", "accountIDs": [ "string" ], "statusText": "statusText", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" } }, "loginID": "loginID" } ``` ## Get bridge login session `client.Bridges.LoginSessions.Get(ctx, loginSessionID, query) (*LoginSession, error)` **get** `/v1/bridges/{bridgeID}/login-sessions/{loginSessionID}` Get the current state of a temporary bridge login session. ### Parameters - `loginSessionID string` Temporary bridge login session ID. - `query BridgeLoginSessionGetParams` - `BridgeID param.Field[string]` Bridge ID. ### Returns - `type LoginSession struct{…}` - `BridgeID string` Bridge ID. - `LoginSessionID string` Temporary bridge login session ID. - `Status LoginSessionStatus` - `const LoginSessionStatusWaitingForInput LoginSessionStatus = "waiting_for_input"` - `const LoginSessionStatusWaitingForCookies LoginSessionStatus = "waiting_for_cookies"` - `const LoginSessionStatusWaitingForDisplay LoginSessionStatus = "waiting_for_display"` - `const LoginSessionStatusComplete LoginSessionStatus = "complete"` - `const LoginSessionStatusCancelled LoginSessionStatus = "cancelled"` - `const LoginSessionStatusFailed LoginSessionStatus = "failed"` - `Account Account` A chat account added to Beeper. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `AccountID string` Chat account ID for reconnect flows, when known. - `CurrentStep LoginSessionCurrentStepUnion` Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed. - `type LoginSessionCurrentStepUserInput struct{…}` - `Fields []LoginInputField` - `ID string` Field ID to send back in the fields object. - `InitialValue string` Initial field value, when provided by the network. - `Label string` Field label to show to the user. - `Optional bool` True if the user can leave this field empty. - `Placeholder string` Placeholder text to show when the field is empty. - `Type string` Suggested input type, such as text, password, or email. - `StepID string` - `Type UserInput` - `const UserInputUserInput UserInput = "user_input"` - `Attachments []any` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepCookies struct{…}` - `Fields []CookieField` - `ID string` Field ID to send back in the fields object. - `Name string` Cookie, header, or local storage key to collect. - `Type CookieFieldType` Browser storage source for this value. - `const CookieFieldTypeCookie CookieFieldType = "cookie"` - `const CookieFieldTypeHeader CookieFieldType = "header"` - `const CookieFieldTypeLocalStorage CookieFieldType = "local_storage"` - `StepID string` - `Type Cookies` - `const CookiesCookies Cookies = "cookies"` - `URL string` URL to open for the user. - `ExpectedFinalURLRegex string` Regular expression that identifies the final URL after sign-in. - `ExtractJs string` Optional extraction script for browser-based sign-in helpers. Treat as an opaque helper value. - `Instructions string` User-facing instructions for this browser step. - `UserAgent string` Suggested user agent for the browser session. - `type LoginSessionCurrentStepDisplayAndWait struct{…}` - `Display LoginSessionCurrentStepDisplayAndWaitDisplayUnion` - `type LoginSessionCurrentStepDisplayAndWaitDisplayQrCode struct{…}` - `Data string` - `Type Qr` - `const QrQr Qr = "qr"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmoji struct{…}` - `ImageURL string` - `Type Emoji` - `const EmojiEmoji Emoji = "emoji"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmpty struct{…}` - `Type Nothing` - `const NothingNothing Nothing = "nothing"` - `StepID string` - `Type DisplayAndWait` - `const DisplayAndWaitDisplayAndWait DisplayAndWait = "display_and_wait"` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepComplete struct{…}` - `Type Complete` - `const CompleteComplete Complete = "complete"` - `Account Account` A chat account added to Beeper. - `Instructions string` Completion instructions, when provided. - `Login LoginSessionCurrentStepCompleteLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeCurrentDevice LoginSessionCurrentStepCompleteLoginRemoveScope = "current-device"` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeAllDevices LoginSessionCurrentStepCompleteLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionCurrentStepCompleteLoginStatusConnected LoginSessionCurrentStepCompleteLoginStatus = "connected"` - `const LoginSessionCurrentStepCompleteLoginStatusConnecting LoginSessionCurrentStepCompleteLoginStatus = "connecting"` - `const LoginSessionCurrentStepCompleteLoginStatusNeedsLogin LoginSessionCurrentStepCompleteLoginStatus = "needs_login"` - `const LoginSessionCurrentStepCompleteLoginStatusLoggedOut LoginSessionCurrentStepCompleteLoginStatus = "logged_out"` - `const LoginSessionCurrentStepCompleteLoginStatusUnknown LoginSessionCurrentStepCompleteLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `StepID string` - `Error APIError` - `Code string` - `Message string` - `Details map[string, any]` - `Login LoginSessionLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionLoginRemoveScopeCurrentDevice LoginSessionLoginRemoveScope = "current-device"` - `const LoginSessionLoginRemoveScopeAllDevices LoginSessionLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionLoginStatusConnected LoginSessionLoginStatus = "connected"` - `const LoginSessionLoginStatusConnecting LoginSessionLoginStatus = "connecting"` - `const LoginSessionLoginStatusNeedsLogin LoginSessionLoginStatus = "needs_login"` - `const LoginSessionLoginStatusLoggedOut LoginSessionLoginStatus = "logged_out"` - `const LoginSessionLoginStatusUnknown LoginSessionLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `LoginID string` Bridge login ID for reconnect flows, when known. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) loginSession, err := client.Bridges.LoginSessions.Get( context.TODO(), "123", beeperdesktopapi.BridgeLoginSessionGetParams{ BridgeID: "local-whatsapp", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", loginSession.BridgeID) } ``` #### Response ```json { "bridgeID": "bridgeID", "loginSessionID": "loginSessionID", "status": "waiting_for_input", "account": { "accountID": "accountID", "bridge": { "id": "id", "provider": "cloud", "type": "type" }, "status": "connected", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" }, "capabilities": { "foo": "bar" }, "loginID": "loginID", "network": "network", "statusText": "statusText" }, "accountID": "accountID", "currentStep": { "fields": [ { "id": "id", "initialValue": "initialValue", "label": "label", "optional": true, "placeholder": "placeholder", "type": "type" } ], "stepID": "stepID", "type": "user_input", "attachments": [ {} ], "instructions": "instructions" }, "error": { "code": "code", "message": "message", "details": { "foo": "bar" } }, "login": { "bridgeID": "bridgeID", "loginID": "loginID", "removeScopes": [ "current-device" ], "status": "connected", "accountIDs": [ "string" ], "statusText": "statusText", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" } }, "loginID": "loginID" } ``` ## Cancel bridge login session `client.Bridges.LoginSessions.Cancel(ctx, loginSessionID, body) (*BridgeLoginSessionCancelResponse, error)` **delete** `/v1/bridges/{bridgeID}/login-sessions/{loginSessionID}` Cancel a temporary bridge login session. ### Parameters - `loginSessionID string` Temporary bridge login session ID. - `body BridgeLoginSessionCancelParams` - `BridgeID param.Field[string]` Bridge ID. ### Returns - `type BridgeLoginSessionCancelResponse struct{…}` - `BridgeID string` - `LoginSessionID string` - `Status Cancelled` - `const CancelledCancelled Cancelled = "cancelled"` ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) response, err := client.Bridges.LoginSessions.Cancel( context.TODO(), "123", beeperdesktopapi.BridgeLoginSessionCancelParams{ BridgeID: "local-whatsapp", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.BridgeID) } ``` #### Response ```json { "bridgeID": "bridgeID", "loginSessionID": "loginSessionID", "status": "cancelled" } ``` # Steps ## Submit login step `client.Bridges.LoginSessions.Steps.Submit(ctx, stepID, params) (*LoginSession, error)` **post** `/v1/bridges/{bridgeID}/login-sessions/{loginSessionID}/steps/{stepID}` Submit input for the current step of a bridge login session. ### Parameters - `stepID string` Current bridge login session step ID. - `params BridgeLoginSessionStepSubmitParams` - `BridgeID param.Field[string]` Path param: Bridge ID. - `LoginSessionID param.Field[string]` Path param: Temporary bridge login session ID. - `Type param.Field[BridgeLoginSessionStepSubmitParamsType]` Body param - `const BridgeLoginSessionStepSubmitParamsTypeUserInput BridgeLoginSessionStepSubmitParamsType = "user_input"` - `const BridgeLoginSessionStepSubmitParamsTypeCookies BridgeLoginSessionStepSubmitParamsType = "cookies"` - `const BridgeLoginSessionStepSubmitParamsTypeDisplayAndWait BridgeLoginSessionStepSubmitParamsType = "display_and_wait"` - `Fields param.Field[map[string, string]]` Body param: Field values keyed by the field IDs from the current step. - `LastURL param.Field[string]` Body param: Last browser URL reached during a cookies step, if available. - `Source param.Field[BridgeLoginSessionStepSubmitParamsSource]` Body param: How the step was completed. Omit unless the client needs to distinguish an embedded webview or browser extension. - `const BridgeLoginSessionStepSubmitParamsSourceAPI BridgeLoginSessionStepSubmitParamsSource = "api"` - `const BridgeLoginSessionStepSubmitParamsSourceWebview BridgeLoginSessionStepSubmitParamsSource = "webview"` - `const BridgeLoginSessionStepSubmitParamsSourceBrowserExtension BridgeLoginSessionStepSubmitParamsSource = "browser_extension"` ### Returns - `type LoginSession struct{…}` - `BridgeID string` Bridge ID. - `LoginSessionID string` Temporary bridge login session ID. - `Status LoginSessionStatus` - `const LoginSessionStatusWaitingForInput LoginSessionStatus = "waiting_for_input"` - `const LoginSessionStatusWaitingForCookies LoginSessionStatus = "waiting_for_cookies"` - `const LoginSessionStatusWaitingForDisplay LoginSessionStatus = "waiting_for_display"` - `const LoginSessionStatusComplete LoginSessionStatus = "complete"` - `const LoginSessionStatusCancelled LoginSessionStatus = "cancelled"` - `const LoginSessionStatusFailed LoginSessionStatus = "failed"` - `Account Account` A chat account added to Beeper. - `AccountID string` Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. - `Bridge AccountBridge` Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. - `ID string` Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. - `Provider AccountBridgeProvider` Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. - `const AccountBridgeProviderCloud AccountBridgeProvider = "cloud"` - `const AccountBridgeProviderSelfHosted AccountBridgeProvider = "self-hosted"` - `const AccountBridgeProviderLocal AccountBridgeProvider = "local"` - `const AccountBridgeProviderPlatformSDK AccountBridgeProvider = "platform-sdk"` - `Type string` Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. - `Status AccountStatus` Current connection status for this account. - `const AccountStatusConnected AccountStatus = "connected"` - `const AccountStatusConnecting AccountStatus = "connecting"` - `const AccountStatusBackfilling AccountStatus = "backfilling"` - `const AccountStatusConnectionRequired AccountStatus = "connection_required"` - `const AccountStatusReconnectRequired AccountStatus = "reconnect_required"` - `const AccountStatusAttentionRequired AccountStatus = "attention_required"` - `const AccountStatusDisconnected AccountStatus = "disconnected"` - `const AccountStatusDisabled AccountStatus = "disabled"` - `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. This may be a remote URL, media URL, data URL, or local file URL depending on the source. May be temporary or available only on 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. - `Capabilities map[string, any]` Runtime chat/message capabilities for this connected account, when available. - `LoginID string` Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. - `Network string` Human-friendly network name for the account. Omitted when the network is unknown. - `StatusText string` Human-friendly account status text. - `AccountID string` Chat account ID for reconnect flows, when known. - `CurrentStep LoginSessionCurrentStepUnion` Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed. - `type LoginSessionCurrentStepUserInput struct{…}` - `Fields []LoginInputField` - `ID string` Field ID to send back in the fields object. - `InitialValue string` Initial field value, when provided by the network. - `Label string` Field label to show to the user. - `Optional bool` True if the user can leave this field empty. - `Placeholder string` Placeholder text to show when the field is empty. - `Type string` Suggested input type, such as text, password, or email. - `StepID string` - `Type UserInput` - `const UserInputUserInput UserInput = "user_input"` - `Attachments []any` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepCookies struct{…}` - `Fields []CookieField` - `ID string` Field ID to send back in the fields object. - `Name string` Cookie, header, or local storage key to collect. - `Type CookieFieldType` Browser storage source for this value. - `const CookieFieldTypeCookie CookieFieldType = "cookie"` - `const CookieFieldTypeHeader CookieFieldType = "header"` - `const CookieFieldTypeLocalStorage CookieFieldType = "local_storage"` - `StepID string` - `Type Cookies` - `const CookiesCookies Cookies = "cookies"` - `URL string` URL to open for the user. - `ExpectedFinalURLRegex string` Regular expression that identifies the final URL after sign-in. - `ExtractJs string` Optional extraction script for browser-based sign-in helpers. Treat as an opaque helper value. - `Instructions string` User-facing instructions for this browser step. - `UserAgent string` Suggested user agent for the browser session. - `type LoginSessionCurrentStepDisplayAndWait struct{…}` - `Display LoginSessionCurrentStepDisplayAndWaitDisplayUnion` - `type LoginSessionCurrentStepDisplayAndWaitDisplayQrCode struct{…}` - `Data string` - `Type Qr` - `const QrQr Qr = "qr"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmoji struct{…}` - `ImageURL string` - `Type Emoji` - `const EmojiEmoji Emoji = "emoji"` - `type LoginSessionCurrentStepDisplayAndWaitDisplayEmpty struct{…}` - `Type Nothing` - `const NothingNothing Nothing = "nothing"` - `StepID string` - `Type DisplayAndWait` - `const DisplayAndWaitDisplayAndWait DisplayAndWait = "display_and_wait"` - `Instructions string` User-facing instructions for this step. - `type LoginSessionCurrentStepComplete struct{…}` - `Type Complete` - `const CompleteComplete Complete = "complete"` - `Account Account` A chat account added to Beeper. - `Instructions string` Completion instructions, when provided. - `Login LoginSessionCurrentStepCompleteLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeCurrentDevice LoginSessionCurrentStepCompleteLoginRemoveScope = "current-device"` - `const LoginSessionCurrentStepCompleteLoginRemoveScopeAllDevices LoginSessionCurrentStepCompleteLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionCurrentStepCompleteLoginStatusConnected LoginSessionCurrentStepCompleteLoginStatus = "connected"` - `const LoginSessionCurrentStepCompleteLoginStatusConnecting LoginSessionCurrentStepCompleteLoginStatus = "connecting"` - `const LoginSessionCurrentStepCompleteLoginStatusNeedsLogin LoginSessionCurrentStepCompleteLoginStatus = "needs_login"` - `const LoginSessionCurrentStepCompleteLoginStatusLoggedOut LoginSessionCurrentStepCompleteLoginStatus = "logged_out"` - `const LoginSessionCurrentStepCompleteLoginStatusUnknown LoginSessionCurrentStepCompleteLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `StepID string` - `Error APIError` - `Code string` - `Message string` - `Details map[string, any]` - `Login LoginSessionLogin` Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. - `BridgeID string` Bridge ID. - `LoginID string` Bridge login ID. - `RemoveScopes []string` - `const LoginSessionLoginRemoveScopeCurrentDevice LoginSessionLoginRemoveScope = "current-device"` - `const LoginSessionLoginRemoveScopeAllDevices LoginSessionLoginRemoveScope = "all-devices"` - `Status string` - `const LoginSessionLoginStatusConnected LoginSessionLoginStatus = "connected"` - `const LoginSessionLoginStatusConnecting LoginSessionLoginStatus = "connecting"` - `const LoginSessionLoginStatusNeedsLogin LoginSessionLoginStatus = "needs_login"` - `const LoginSessionLoginStatusLoggedOut LoginSessionLoginStatus = "logged_out"` - `const LoginSessionLoginStatusUnknown LoginSessionLoginStatus = "unknown"` - `AccountIDs []string` Chat accounts that belong to this bridge login, when known. - `StatusText string` Human-friendly bridge login status text. - `User User` User the account belongs to. - `LoginID string` Bridge login ID for reconnect flows, when known. ### Example ```go package main import ( "context" "fmt" "github.com/beeper/desktop-api-go" "github.com/beeper/desktop-api-go/option" ) func main() { client := beeperdesktopapi.NewClient( option.WithAccessToken("My Access Token"), ) loginSession, err := client.Bridges.LoginSessions.Steps.Submit( context.TODO(), "x", beeperdesktopapi.BridgeLoginSessionStepSubmitParams{ BridgeID: "local-whatsapp", LoginSessionID: "123", Type: beeperdesktopapi.BridgeLoginSessionStepSubmitParamsTypeUserInput, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", loginSession.BridgeID) } ``` #### Response ```json { "bridgeID": "bridgeID", "loginSessionID": "loginSessionID", "status": "waiting_for_input", "account": { "accountID": "accountID", "bridge": { "id": "id", "provider": "cloud", "type": "type" }, "status": "connected", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" }, "capabilities": { "foo": "bar" }, "loginID": "loginID", "network": "network", "statusText": "statusText" }, "accountID": "accountID", "currentStep": { "fields": [ { "id": "id", "initialValue": "initialValue", "label": "label", "optional": true, "placeholder": "placeholder", "type": "type" } ], "stepID": "stepID", "type": "user_input", "attachments": [ {} ], "instructions": "instructions" }, "error": { "code": "code", "message": "message", "details": { "foo": "bar" } }, "login": { "bridgeID": "bridgeID", "loginID": "loginID", "removeScopes": [ "current-device" ], "status": "connected", "accountIDs": [ "string" ], "statusText": "statusText", "user": { "id": "id", "cannotMessage": true, "email": "email", "fullName": "fullName", "imgURL": "imgURL", "isSelf": true, "phoneNumber": "phoneNumber", "username": "username" } }, "loginID": "loginID" } ```