# List workspaces

> List workspaces (sub-accounts / locations) owned by the installer.

Source: https://docs.mycrmsim.com/docs/workspaces/list-workspaces

```http
GET https://backend.mysmsgateway.app/api/v1/ext/workspaces
```

- Category: myCRMSIM Workspaces / Workspaces
- Auth: Bearer access token
- Scope: `workspaces.read`

Returns the sub-account workspaces owned by the authenticated installer. The top-level "Company" account is excluded — only actual workspaces (Location / Custom Location, etc.) are returned. Each carries its `user_type`; server-side filtering by `user_type` is not supported, so clients filter client-side when needed.

**Pagination:** `limit` is clamped to [1, 200] (default 50) and `page` to >= 1 (default 1). To read past the first `limit` rows, request `page=2`, `page=3`, … until `page` reaches `total_pages`. Invalid bounds are normalised rather than rejected, and the response `pagination` object reports the applied `page` and `limit`, `total_pages`, the `max_limit` (200), the raw `requested_page` / `requested_limit`, and a `normalized` flag that is true when clamping changed a requested value.

**Ids:** `id` is the numeric workspace id used by every `/workspaces/{id}` path and `workspace_id` field. `remote_id` is the external platform location id (the `location_id` in the support articles) for Location workspaces, or a server-generated hex string for Custom Location workspaces.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `limit` | query | number | no | Page size — integer clamped to [1, 200]; default 50. Out-of-range or non-numeric values (0, negative, > 200, non-numeric) are normalised, NOT rejected; the applied bounds are echoed in the response `pagination` object (`limit`, `max_limit`, `requested_limit`, `normalized`). |
| `page` | query | number | no | 1-based page number; default 1. Clamped to >= 1 (page=0 becomes 1 and sets `normalized`). Rows are ordered by id descending, so with `limit` 200 and `total` 450 pages 1–3 return the full set. The applied page is echoed in `pagination.page`, with `total_pages` and the raw `requested_page`. Example: `1` |

## Response fields (workspaces)

| Field | Type | Description |
| --- | --- | --- |
| `id` | number | Unique workspace id. |
| `remote_id` | string | Server-generated unique identifier (20-character hex string). Not accepted in the request body — always assigned when the workspace is created. |
| `source` | string | Where the workspace came from. Workspaces created via this API have source "myCRMSIM". |
| `user_id` | number | The installer this workspace belongs to. |
| `user_type` | enum | The workspace type. Workspaces created via this API are always "Custom Location" — "Location" appears for workspaces that originated from a connected platform. |
| `name` | string, nullable | Display name. Stored inside `meta` and surfaced here for convenience. |
| `address` | string, nullable | Street address. From meta. |
| `phone_number` | string, nullable | Primary phone number. From meta. |
| `email` | string, nullable | Primary email. Lowercased. From meta. |
| `url` | string, nullable | Public website. From meta. |
| `meta` | object | Raw meta JSON. The fields above are mirrored here. |
| `allow_contact` | string | "0" or "1" — whether inbound contacts can auto-create here. Defaults to "0". |
| `company_id` | number, nullable | External platform company ID (for Location workspaces). |
| `whitelabel_setting_id` | number, nullable | Identifier of the white-label brand this workspace belongs to. |
| `custom_menu_link_id` | string, nullable | Embedded app menu link ID. |
| `subaccount_action` | number | Bitfield describing the sub-account action state. 0 = default. |
| `whatsapp_connection_id` | number, nullable | Identifier of the WhatsApp connection assigned to this workspace. |
| `whatsapp_delay` | number, nullable | Per-message send delay in seconds for the WhatsApp channel. |
| `is_token_expired` | number, nullable | 1 if the upstream OAuth token for this workspace has expired and needs re-authorization. |
| `created_at` | string (ISO 8601) | When the workspace was created. |
| `updated_at` | string (ISO 8601) | When the workspace was last modified. |
| `deleted_at` | string (ISO 8601), nullable | Set when the workspace has been soft-deleted. null for active records. |

## Response 200

OK

```json
{
  "success": true,
  "data": [
    {
      "id": 7,
      "remote_id": "4f8a7e1d2c9b3a5f6e0d1",
      "source": "myCRMSIM",
      "user_id": 42,
      "user_type": "Custom Location",
      "name": "Acme HQ",
      "address": "12 Mayfair St, London",
      "phone_number": "+442071234567",
      "email": "hq@acme.example.com",
      "url": "https://acme.example.com",
      "meta": {
        "name": "Acme HQ",
        "address": "12 Mayfair St, London",
        "phone_number": "+442071234567",
        "email": "hq@acme.example.com",
        "url": "https://acme.example.com"
      },
      "allow_contact": "0",
      "company_id": null,
      "whitelabel_setting_id": 1,
      "custom_menu_link_id": null,
      "subaccount_action": 0,
      "whatsapp_connection_id": null,
      "whatsapp_delay": null,
      "is_token_expired": 0,
      "created_at": "2026-05-21T09:14:22.000Z",
      "updated_at": "2026-05-21T09:14:22.000Z",
      "deleted_at": null
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 50,
    "max_limit": 200,
    "total_pages": 1,
    "requested_page": null,
    "requested_limit": null,
    "normalized": false
  }
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): workspaces.read."
}
```
