Skip to content
Download Beeper

Create bridge login session

$client->bridges->loginSessions->create(string bridgeID, ?string accountID, ?string flowID, ?string loginID): LoginSession
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.

ParametersExpand Collapse
bridgeID: string

Bridge ID.

accountID?:optional string

Existing chat account ID to reconnect. Omit to connect a new account.

flowID?:optional string

Optional flow ID returned by the list login flows endpoint. If omitted, Beeper chooses the default flow.

loginID?:optional string

Existing bridge login ID to reconnect. Omit to connect a new account.

ReturnsExpand Collapse
string bridgeID

Bridge ID.

string loginSessionID

Temporary bridge login session ID.

Status status
?Account account

A chat account added to Beeper.

?string accountID

Chat account ID for reconnect flows, when known.

?CurrentStep currentStep

Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed.

?APIError error
?Login login

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

?string loginID

Bridge login ID for reconnect flows, when known.

Create bridge login session

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(accessToken: 'My Access Token');

$loginSession = $client->bridges->loginSessions->create(
  'local-whatsapp', accountID: 'x', flowID: 'x', loginID: 'x'
);

var_dump($loginSession);
{
  "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"
}
Returns Examples
{
  "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"
}