# groups — NCM API

Groups let you manage devices of the same product type together, so configuration and firmware are applied once rather than per device. Full lifecycle: list, create, update, patch and delete groups. Group membership is what modem software upgrades and device app bindings target.

Base URL: https://www.cradlepointecm.com/api/v2

### GET /groups/

Get information about groups

Use the GET method on this endpoint to retrieve groups records. Use the available filtering fields to narrow or broaden your search.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| account | query | in: int<br />out: url | no | Account that contains the groups record |
| account__in | query | in: int<br />out: url | no | Filter for account contains - a comma-separated list of account IDs |
| id | query | integer | no | ID of a groups record |
| id__in | query | integer | no | Filter for ID contains - a comma-separated list of groups record IDs |
| name | query | string | no | Name of the group |
| name__in | query | string | no | Filter for names contains - a comma-separated list of group names |
| expand | query | string | no | Specifies that the returned value for the passed in attribute be expanded in the response body |
| id__gt | query | integer | no | Filter results to items with ID greater than specified value (cursor pagination) |
| id__gte | query | integer | no | Filter results to items with ID greater than or equal to specified value |
| id__lt | query | integer | no | Filter results to items with ID less than specified value |
| id__lte | query | integer | no | Filter results to items with ID less than or equal to specified value |
| limit | query | integer | no | Restricts the number of records returned in a recordset to this value. Max value is 500. |
| offset | query | integer | no | Specifies where (an index) in a recordset to begin returning records. |

**Example request**

```bash
curl "https://www.cradlepointecm.com/api/v2/groups/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>"
```

**Response 200** — Example response.

```json
{
  "data": [
    {
      "account": "https://www.cradlepointecm.com/api/v2/accounts/<account number>/",
      "configuration": [
        {},
        []
      ],
      "device_type": "access_point",
      "id": "85136",
      "name": "AP22 Group",
      "product": "https://www.cradlepointecm.com/api/v2/products/48/",
      "resource_url": "https://www.cradlepointecm.com/api/v2/groups/85136/",
      "target_firmware": "https://www.cradlepointecm.com/api/v2/firmwares/877/"
    }
  ],
  "meta": {
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null
  }
}
```

### POST /groups/

Create a groups record

Use the POST method on this endpoint to create a new groups record. Include the fields/values to add for the record in the 'Content' field as a JSON object.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |

**Request body**

**Example request**

```bash
curl -X POST "https://www.cradlepointecm.com/api/v2/groups/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Response 200** — Example response.

```json
{
  "account": "https://www.cradlepointecm.com/api/v2/accounts/35065/",
  "configuration": [
    {},
    []
  ],
  "device_type": "router",
  "id": "230007",
  "name": "IBR1100",
  "product": "https://www.cradlepointecm.com/api/v2/products/23/",
  "resource_url": "https://www.cradlepointecm.com/api/v2/groups/",
  "target_firmware": "https://www.cradlepointecm.com/api/v2/firmwares/29/"
}
```

### PUT /groups/{id}/

Update a groups record

Use the PUT method on this endpoint to update a groups record. Include the fields/values to update in the 'Content' field as a JSON object.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| id | path | integer | yes | The ID of the groups record to modify |

**Request body**

**Example request**

```bash
curl -X PUT "https://www.cradlepointecm.com/api/v2/groups/{id}/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Response 200** — Example response.

```json
{
  "account": "https://www.cradlepointecm.com/api/v2/accounts/<account number>/",
  "configuration": [
    {},
    []
  ],
  "device_type": "router",
  "id": "230007",
  "name": "IBR1100 Group",
  "product": "https://www.cradlepointecm.com/api/v2/products/23/",
  "resource_url": "https://www.cradlepointecm.com/api/v2/groups/230007/",
  "target_firmware": "https://www.cradlepointecm.com/api/v2/firmwares/29/"
}
```

### PATCH /groups/{id}/

Update a groups record

<p>This operation updates a group.</p>

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| id | path | integer | yes | Unique ID of a Group |

**Request body**

**Example request**

```bash
curl -X PATCH "https://www.cradlepointecm.com/api/v2/groups/{id}/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Response 200** — No response was specified

### DELETE /groups/{id}/

Delete a groups record

Use the DELETE method on this endpoint to delete a groups record. This method requires the ID of the groups record to delete. Performing a DELETE action removes the record from NetCloud and can't be reversed.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| id | path | integer | yes | ID of the groups record to delete |

**Example request**

```bash
curl -X DELETE "https://www.cradlepointecm.com/api/v2/groups/{id}/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>"
```

**Response 200** — No response was specified
