# Logins

## List bridge logins

`bridges.logins.list(strbridge_id)  -> LoginListResponse`

**get** `/v1/bridges/{bridgeID}/logins`

List bridge logins. A bridge login is a signed-in identity for a bridge and can contain one or more chat accounts.

### Parameters

- `bridge_id: str`

  Bridge ID.

### Returns

- `class LoginListResponse: …`

  - `items: List[BridgeLogin]`

    - `bridge_id: str`

      Bridge ID.

    - `login_id: str`

      Bridge login ID.

    - `remove_scopes: List[Literal["current-device", "all-devices"]]`

      - `"current-device"`

      - `"all-devices"`

    - `status: Literal["connected", "connecting", "needs_login", 2 more]`

      - `"connected"`

      - `"connecting"`

      - `"needs_login"`

      - `"logged_out"`

      - `"unknown"`

    - `account_ids: Optional[List[str]]`

      Chat accounts that belong to this bridge login, when known.

    - `status_text: Optional[str]`

      Human-friendly bridge login status text.

    - `user: Optional[User]`

      User the account belongs to.

      - `id: str`

        Stable Beeper user ID. Use as the primary key when referencing a person.

      - `cannot_message: Optional[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: Optional[str]`

        Email address if known. Not guaranteed verified.

      - `full_name: Optional[str]`

        Display name as shown in clients (e.g., 'Alice Example'). May include emojis.

      - `img_url: Optional[str]`

        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.

      - `is_self: Optional[bool]`

        True if this user represents the authenticated account's own identity.

      - `phone_number: Optional[str]`

        User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown.

      - `username: Optional[str]`

        Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique.

### Example

```python
import os
from beeper_desktop_api import BeeperDesktop

client = BeeperDesktop(
    access_token=os.environ.get("BEEPER_ACCESS_TOKEN"),  # This is the default and can be omitted
)
logins = client.bridges.logins.list(
    "local-whatsapp",
)
print(logins.items)
```

#### Response

```json
{
  "items": [
    {
      "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"
      }
    }
  ]
}
```

## Get bridge login

`bridges.logins.retrieve(strlogin_id, LoginRetrieveParams**kwargs)  -> BridgeLogin`

**get** `/v1/bridges/{bridgeID}/logins/{loginID}`

Get one bridge login.

### Parameters

- `bridge_id: str`

  Bridge ID.

- `login_id: str`

  Bridge login ID.

### Returns

- `class BridgeLogin: …`

  Signed-in identity for a bridge. One bridge login can contain multiple chat accounts.

  - `bridge_id: str`

    Bridge ID.

  - `login_id: str`

    Bridge login ID.

  - `remove_scopes: List[Literal["current-device", "all-devices"]]`

    - `"current-device"`

    - `"all-devices"`

  - `status: Literal["connected", "connecting", "needs_login", 2 more]`

    - `"connected"`

    - `"connecting"`

    - `"needs_login"`

    - `"logged_out"`

    - `"unknown"`

  - `account_ids: Optional[List[str]]`

    Chat accounts that belong to this bridge login, when known.

  - `status_text: Optional[str]`

    Human-friendly bridge login status text.

  - `user: Optional[User]`

    User the account belongs to.

    - `id: str`

      Stable Beeper user ID. Use as the primary key when referencing a person.

    - `cannot_message: Optional[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: Optional[str]`

      Email address if known. Not guaranteed verified.

    - `full_name: Optional[str]`

      Display name as shown in clients (e.g., 'Alice Example'). May include emojis.

    - `img_url: Optional[str]`

      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.

    - `is_self: Optional[bool]`

      True if this user represents the authenticated account's own identity.

    - `phone_number: Optional[str]`

      User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown.

    - `username: Optional[str]`

      Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique.

### Example

```python
import os
from beeper_desktop_api import BeeperDesktop

client = BeeperDesktop(
    access_token=os.environ.get("BEEPER_ACCESS_TOKEN"),  # This is the default and can be omitted
)
bridge_login = client.bridges.logins.retrieve(
    login_id="ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
    bridge_id="local-whatsapp",
)
print(bridge_login.bridge_id)
```

#### Response

```json
{
  "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"
  }
}
```

## Remove bridge login

`bridges.logins.remove(strlogin_id, LoginRemoveParams**kwargs)  -> LoginRemoveResponse`

**post** `/v1/bridges/{bridgeID}/logins/{loginID}/remove`

Remove a bridge login from this device or, when supported by the bridge, from all devices.

### Parameters

- `bridge_id: str`

  Bridge ID.

- `login_id: str`

  Bridge login ID.

- `scope: Literal["current-device", "all-devices"]`

  Where this bridge login should be removed.

  - `"current-device"`

  - `"all-devices"`

### Returns

- `class LoginRemoveResponse: …`

  - `bridge_id: str`

  - `login_id: str`

  - `scope: Literal["current-device", "all-devices"]`

    Where this bridge login should be removed.

    - `"current-device"`

    - `"all-devices"`

  - `status: Literal["removed"]`

    - `"removed"`

  - `affected_account_ids: Optional[List[str]]`

### Example

```python
import os
from beeper_desktop_api import BeeperDesktop

client = BeeperDesktop(
    access_token=os.environ.get("BEEPER_ACCESS_TOKEN"),  # This is the default and can be omitted
)
login = client.bridges.logins.remove(
    login_id="ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
    bridge_id="local-whatsapp",
    scope="current-device",
)
print(login.bridge_id)
```

#### Response

```json
{
  "bridgeID": "bridgeID",
  "loginID": "loginID",
  "scope": "current-device",
  "status": "removed",
  "affectedAccountIDs": [
    "string"
  ]
}
```

## Domain Types

### Login List Response

- `class LoginListResponse: …`

  - `items: List[BridgeLogin]`

    - `bridge_id: str`

      Bridge ID.

    - `login_id: str`

      Bridge login ID.

    - `remove_scopes: List[Literal["current-device", "all-devices"]]`

      - `"current-device"`

      - `"all-devices"`

    - `status: Literal["connected", "connecting", "needs_login", 2 more]`

      - `"connected"`

      - `"connecting"`

      - `"needs_login"`

      - `"logged_out"`

      - `"unknown"`

    - `account_ids: Optional[List[str]]`

      Chat accounts that belong to this bridge login, when known.

    - `status_text: Optional[str]`

      Human-friendly bridge login status text.

    - `user: Optional[User]`

      User the account belongs to.

      - `id: str`

        Stable Beeper user ID. Use as the primary key when referencing a person.

      - `cannot_message: Optional[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: Optional[str]`

        Email address if known. Not guaranteed verified.

      - `full_name: Optional[str]`

        Display name as shown in clients (e.g., 'Alice Example'). May include emojis.

      - `img_url: Optional[str]`

        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.

      - `is_self: Optional[bool]`

        True if this user represents the authenticated account's own identity.

      - `phone_number: Optional[str]`

        User's phone number in E.164 format (e.g., '+14155552671'). Omit if unknown.

      - `username: Optional[str]`

        Human-readable handle if available (e.g., '@alice'). May be network-specific and not globally unique.

### Login Remove Response

- `class LoginRemoveResponse: …`

  - `bridge_id: str`

  - `login_id: str`

  - `scope: Literal["current-device", "all-devices"]`

    Where this bridge login should be removed.

    - `"current-device"`

    - `"all-devices"`

  - `status: Literal["removed"]`

    - `"removed"`

  - `affected_account_ids: Optional[List[str]]`
