# Update subaccount admin

> Rename, activate / deactivate, or change their workspaces, device limits and devices.

Source: https://docs.mycrmsim.com/docs/subaccount-admins/update-subaccount-admin

```http
PATCH https://backend.mysmsgateway.app/api/v1/ext/subaccount-admins/{id}
```

- Category: myCRMSIM Subaccount Admins / Subaccount Admins
- Auth: Bearer access token
- Scope: `subaccount_admins.write`

Send only what changes; everything else stays as it is.

For workspaces send either `workspace_ids` (the whole new set — `[]` removes all) or `add_workspace_ids` / `remove_workspace_ids`, not both.

Device limits come first. `android_quantity`, `imessage_quantity`, `whatsapp_quantity` and `rcs_quantity` set how many devices of each channel the admin may hold (the same limits as the dashboard form; they also cap how many devices the admin can connect themselves). The iMessage, WhatsApp and RCS limits cannot go above your own plan's quantity for that channel. Then assign devices by id, one array per channel: `android_device_ids`, `imessage_device_ids`, `whatsapp_device_ids`, `rcs_device_ids` — no more ids than the channel's limit. The limit and the ids can be sent in the same request.

Getting device ids: call List devices (Devices section, `GET /api/v1/ext/devices`, scope `devices.read`; add `?channel=android` to filter) and use each device's `id`, putting it in the array for its `channel`. Ids are unique only within a channel, so the same number can be an Android device and a WhatsApp number — always match the array to the device's `channel`. Only devices on the installer's own account can be assigned (404 otherwise).

On update a device array ADDS to the devices the admin already holds; to take devices away send `remove_android_device_ids`, `remove_imessage_device_ids`, `remove_whatsapp_device_ids` or `remove_rcs_device_ids`. Both can go in one request (remove one, add another). A device already held is never swapped out: if adding would take the admin past the channel's limit, the request is refused with 400 and nothing changes — raise the limit or remove a device first. A channel you do not send is left as it is, and so is a limit you do not send. A limit cannot go below the devices the admin holds.

`email`, `password`, `by_pass_2fa`, `wl_allowed` and `plan_id` cannot be changed through the API (400).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | number | yes | Subaccount admin id. Example: `41` |
| `name` | body | string | no | Full name, up to 255 characters. |
| `status` | body | enum | no | Inactive stops them signing in. One of: `active`, `inactive`. |
| `workspace_ids` | body | array<number> | no | The whole new set of workspaces. |
| `add_workspace_ids` | body | array<number> | no | Workspaces to give them. |
| `remove_workspace_ids` | body | array<number> | no | Workspaces to take away. |
| `android_quantity` | body | number | no | How many Android (SMS) devices they may hold. No plan cap. Example: `2` |
| `imessage_quantity` | body | number | no | How many iMessage devices they may hold. At most your plan's iMessage quantity. Example: `1` |
| `whatsapp_quantity` | body | number | no | How many WhatsApp numbers they may hold. At most your plan's WhatsApp quantity. Example: `1` |
| `rcs_quantity` | body | number | no | How many RCS senders they may hold. At most your plan's RCS quantity. Example: `0` |
| `android_device_ids` | body | array<number> | no | Android (SMS) devices to add — ids from List devices where channel is "android". No more than android_quantity. Added to what they already hold. |
| `imessage_device_ids` | body | array<number> | no | iMessage devices to add — ids where channel is "imessage". No more than imessage_quantity. Added to what they already hold. |
| `whatsapp_device_ids` | body | array<number> | no | WhatsApp numbers to add — ids where channel is "whatsapp". No more than whatsapp_quantity. Added to what they already hold. |
| `rcs_device_ids` | body | array<number> | no | RCS senders to add — ids where channel is "rcs". No more than rcs_quantity. Added to what they already hold. |
| `remove_android_device_ids` | body | array<number> | no | Android devices to take away. |
| `remove_imessage_device_ids` | body | array<number> | no | iMessage devices to take away. |
| `remove_whatsapp_device_ids` | body | array<number> | no | WhatsApp numbers to take away. |
| `remove_rcs_device_ids` | body | array<number> | no | RCS senders to take away. |

## Request body

```json
{
  "status": "active",
  "add_workspace_ids": [
    9
  ],
  "android_quantity": 3,
  "android_device_ids": [
    15
  ],
  "remove_android_device_ids": [
    11
  ],
  "whatsapp_quantity": 1,
  "whatsapp_device_ids": [
    4
  ]
}
```

## Response fields (subaccount_admin)

| Field | Type | Description |
| --- | --- | --- |
| `id` | number | User id — also the assignee_id for tasks, appointments and opportunities. |
| `name` | string | Full name. |
| `email` | string | The email they sign in with. |
| `status` | string | "active" or "inactive". An inactive admin cannot sign in. |
| `workspaces` | array<object> | The workspaces they can work in: id and name. |
| `devices` | object | Devices assigned to them, per channel (android, imessage, whatsapp, rcs): id and name. |
| `device_limits` | object | How many devices of each channel they may hold: android, imessage, whatsapp, rcs (numbers). |
| `created_at` | string (ISO 8601) | When they were added. |

## Response 200

OK

```json
{
  "success": true,
  "message": "Subaccount admin updated",
  "data": {
    "id": 41,
    "name": "Sam Doe",
    "email": "sam@example.com",
    "status": "active",
    "workspaces": [
      {
        "id": 7,
        "name": "Lee Studio"
      },
      {
        "id": 9,
        "name": "Harbour Dental"
      }
    ],
    "devices": {
      "android": [
        {
          "id": 12,
          "name": "Pixel 8"
        },
        {
          "id": 15,
          "name": "Galaxy S23"
        }
      ],
      "imessage": [],
      "whatsapp": [
        {
          "id": 4,
          "name": "+61 400 000 000"
        }
      ],
      "rcs": []
    },
    "device_limits": {
      "android": 3,
      "imessage": 0,
      "whatsapp": 1,
      "rcs": 0
    },
    "created_at": "2026-10-27T09:00:00.000Z"
  }
}
```

## Response 400

Nothing to update, or a field that cannot be changed

```json
{
  "success": false,
  "message": "email cannot be changed through the API"
}
```

## Response 400

Adding past the device limit (nothing is changed)

```json
{
  "success": false,
  "message": "Android device limit reached: android_quantity is 1, so no more than 1 Android device(s) can be assigned, but this would make 2 (1 already assigned). Raise android_quantity (it can be sent in the same request) or remove a device with remove_android_device_ids."
}
```

## Response 400

A limit below the devices held, or above your plan

```json
{
  "success": false,
  "message": "imessage_quantity cannot be above your plan's iMessage limit (2)."
}
```

## 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): subaccount_admins.write. This integration was granted: …"
}
```

## Response 403

The token was installed by a subaccount admin, not the account owner

```json
{
  "success": false,
  "message": "Only a token installed by the account owner can manage subaccount admins."
}
```

## Response 404

Not a subaccount admin of the installer

```json
{
  "success": false,
  "message": "Subaccount admin not found or not accessible to this token"
}
```

## Response 404

A workspace or device that is not on the installer's account

```json
{
  "success": false,
  "message": "One or more workspaces or devices not found or not accessible to this token"
}
```
