> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Status

> Reference of Status methods for the Customer Chat RTM API v3.5.

## Login

Returns the initial state of the current customer.

**Specifics**

| | |
| - | - |
| **Action** | `login` |
| **Web API equivalent** | — |
| **Push message** | — |

**Request**

| Parameter | Required | Type | Notes |
| - | - | - | - |
| `token` | Yes | `string` | The OAuth token from the customer's account. |
| `customer` | No | `object` | |
| `customer.avatar` | No | `string` | The URL of the customer's avatar. |
| `customer.email` | No | `string` | |
| `customer.name` | No | `string` | |
| `customer.session_fields` | No | `[]object` | An array of custom object-enclosed key-value pairs. Respects the order of items. |
| `customer_page.title` | No | `string` | |
| `customer_page.url` | No | `string` | |
| `customer_side_storage`\* | No | `object` | A map in the `"key": "value"` format. |
| `is_mobile` | No | `bool` | If set to `true`: indicates that logging in is performed from a mobile device. |
| `group_id` | No | `number` | |
| `referrer` | No | `string` | |
| `application` | No | `object` | |
| `application.name` | No | `string` | The application name. |
| `application.version` | No | `string` | The application version. |
| `application.channel_type` | No | `string` | The application channel type. |
| `pushes` | No | `object` | Use case: when you want to receive only specific pushes. Default: `all` for the version of your currently established RTM connection. |
| `pushes.<version>` | Yes | `[]string` | A list of push subscriptions for a specific version. `<version>` is a version number without the `v` prefix. Possible values: push names. Required when `pushes` is provided. |

\* Use `customer_side_storage` to keep data on the client side. Pass the map from the `customer_side_storage_updated` push payload to this field.

```json title="Request" theme={null}
{
  "action": "login",
  "payload": {
    "token": "Bearer us-south1:test_1fgTbfXmgthj4cZSA",
    "pushes": {
      "3.5": ["incoming_chat", "incoming_multicast"],
      "3.6": ["all"]
    }
  }
}
```

```json title="Response" theme={null}
{
  "request_id": "<request_id>",
  "action": "login",
  "type": "response",
  "success": true,
  "payload": {
    "customer": {
      "id": "a0c22fdd-fb71-40b5-bfc6-a8a0bc3117f5",
      "name": "Thomas Anderson",
      "email": "t.anderson@example.com",
      "avatar": "https://example.com/avatar.png",
      "session_fields": [
        { "custom_key": "custom_value" },
        { "another_custom_key": "another_custom_value" }
      ],
      "statistics": {
        "chats_count": 2,
        "threads_count": 9,
        "visits_count": 15,
        "page_views_count": 40,
        "greetings_shown_count": 20,
        "greetings_accepted_count": 1
      }
    },
    "has_active_thread": true,
    "chats": [
      {
        "chat_id": "PJ0MRSHTDG",
        "has_unread_events": true
      }
    ],
    "greeting": {
      "accepted": true,
      "id": 342543723,
      "unique_id": "e35a4fb4106d87e550fe1af480639058",
      "addon": "email",
      "subtype": "announcement",
      "is_exit_intent": false,
      "event": {},
      "agent": {
        "id": "b5657aff34dd32e198160d54666df9d8",
        "name": "Agent Smith",
        "type": "agent",
        "avatar": "https://example.com/avatar.png",
        "job_title": "Support Agent",
        "is_bot": false
      },
      "displayed_first_time": true
    },
    "__priv_dynamic_config": {
      "online_groups_ids": [1, 3],
      "customer_groups": {
        "monitoring": {
          "id": 1,
          "static_config_url": "/licence/1520/get_static_config.121.1808829.94.95.39446.4011.2385.398.160.552.58.337.44320.js",
          "language_config_url": "/licence/1520/v2/localization.en.121.004b8e014f50ea0c6ad6227162f7d18f_40d391a9adcdbf190e62fcd21c865bf2.js"
        }
      }
    }
  }
}
```

***

## List group statuses

**Specifics**

| | |
| - | - |
| **Action** | `list_group_statuses` |
| **Web API equivalent** | [`list_group_statuses`](https://www.text.com/docs/api/customer-chat/v3.5/status/list-group-statuses) |
| **Push message** | — |

**Request**

One of the optional parameters must be included in the request payload.

| Parameter | Required | Type | Notes |
| - | - | - | - |
| `all` | No | `bool` | If set to `true`: returns statuses of all groups. |
| `group_ids` | No | `array` | An array of group IDs. |

**Response**

| Field | Type | Notes |
| - | - | - |
| `groups_status` | `object` | A map of group IDs to statuses. If a group ID doesn't exist, it won't be included in the response. |

```json title="Request" theme={null}
{
  "action": "list_group_statuses",
  "payload": {
    "all": true
  }
}
```

```json title="Response" theme={null}
{
  "request_id": "<request_id>",
  "action": "list_group_statuses",
  "type": "response",
  "success": true,
  "payload": {
    "groups_status": {
      "1": "online",
      "2": "offline",
      "3": "online_for_queue"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.