# regrades — NCM API

Bulk licensing operations: upgrade, downgrade, license or unlicense many devices in a single call by listing their MAC addresses. Read and create, so submit a regrade then poll it by ID for status. Each record carries the action, subscription type and outcome, which makes this the audit trail for licensing changes.

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

### GET /api/v3/asset_endpoints/regrades

Get a collection of regrades using query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| filter[action] | query | RegradeAction | yes |  |
| filter[action_id] | query | string | no |  |
| filter[created_at] | query | string | no |  |
| filter[error_code] | query | string | no |  |
| filter[id] | query | string | no |  |
| filter[mac_address] | query | string | no |  |
| filter[status] | query | RegradeStatus | yes |  |
| filter[subscription_type] | query | string | no |  |

**Example request**

```bash
curl "https://api.cradlepointecm.com/api/v3/asset_endpoints/regrades" \
  -H "Authorization: Bearer <token>"
```

**Response 200** — Success

```json
{
  "data": [
    {
      "id": "y2wV9WVQtRbMCs5",
      "type": "regrades",
      "attributes": {
        "action_id": "j2Cf2lca666xHjc",
        "mac_address": "36a6f4913505",
        "created_at": "2023-10-05T16:39:32.173613Z",
        "action": "UPGRADE",
        "subscription_type": "NC-ZSCALER",
        "status": "COMPLETED"
      },
      "relationships": {
        "tenant": {
          "data": {
            "id": "0016u00000gzfJH",
            "type": "tenants"
          }
        }
      }
    },
    {
      "id": "IhuwrO3BBOQvyjJ",
      "type": "regrades",
      "attributes": {
        "action_id": "j2Cf2lca666xHjc",
        "mac_address": "220e01f50455",
        "created_at": "2023-10-05T16:39:32.174061Z",
        "action": "UPGRADE",
        "subscription_type": "NC-ZSCALER",
        "status": "COMPLETED"
      },
      "relationships": {
        "tenant": {
          "data": {
            "id": "0016u00000gzfJH",
            "type": "tenants"
          }
        }
      }
    },
    {
      "type": "regrades",
      "id": "SxiA5c4MVWyDBr4",
      "attributes": {
        "action_id": "j2Cf2lca666xHjc",
        "mac_address": "762e5D162898",
        "created_at": "2023-10-05T16:39:32.174061Z",
        "action": "UPGRADE",
        "subscription_type": "NC-ZSCALER",
        "status": "FAILED",
        "error_code": "NO_LICENSES_AVAILABLE"
      },
      "relationships": {
        "tenant": {
          "data": {
            "id": "0016u00000gzfJH",
            "type": "tenants"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "0016u00000gzyxy",
      "type": "tenants"
    }
  ]
}
```

**Response 400** — Bad Request

**Response 402** — Payment Required

**Response 403** — Forbidden

**Response 404** — Not Found

**Response 405** — Method Not Allowed

**Response 406** — Not Acceptable

**Response 409** — Conflict

**Response 412** — Precondition Failed

**Response 415** — Unsupported Media Type

**Response 423** — Locked

**Response 426** — Upgrade Required

**Response 500** — Internal Server Error

### POST /api/v3/asset_endpoints/regrades

Creates a list of regrades

**Request body**

**Example request**

```bash
curl -X POST "https://api.cradlepointecm.com/api/v3/asset_endpoints/regrades" \
  -H "Authorization: Bearer <token>"
```

**Response 200** — OK

```json
{
  "atomic:results": [
    {
      "data": {
        "id": "y2wV9WVQtRbMCs5",
        "type": "regrades",
        "attributes": {
          "action_id": "j2Cf2lca666xHjc",
          "mac_address": "36a6f4913505",
          "created_at": "2023-10-05T16:39:32.173613Z",
          "action": "UPGRADE",
          "subscription_type": "NC-ZSCALER",
          "status": "RUNNING"
        },
        "relationships": {
          "tenant": {
            "data": {
              "id": "0016u00000gzfJH",
              "type": "tenants"
            }
          }
        },
        "links": {
          "self": "https://api.cradlepointecm.com/api/v3/asset_endpoints/regrades/y2wV9WVQtRbMCs5"
        }
      }
    },
    {
      "data": {
        "id": "IhuwrO3BBOQvyjJ",
        "type": "regrades",
        "attributes": {
          "action_id": "j2Cf2lca666xHjc",
          "mac_address": "220e01f50455",
          "created_at": "2023-10-05T16:39:32.174061Z",
          "action": "UPGRADE",
          "subscription_type": "NC-ZSCALER",
          "status": "RUNNING"
        },
        "relationships": {
          "tenant": {
            "data": {
              "id": "0016u00000gzfJH",
              "type": "tenants"
            }
          }
        },
        "links": {
          "self": "https://api.cradlepointecm.com/api/v3/asset_endpoints/regrades/IhuwrO3BBOQvyjJ"
        }
      }
    },
    {
      "data": {
        "type": "regrades",
        "id": "SxiA5c4MVWyDBr4",
        "attributes": {
          "action_id": "j2Cf2lca666xHjc",
          "mac_address": "762e5D162898",
          "created_at": "2023-10-05T16:39:32.174061Z",
          "action": "UPGRADE",
          "subscription_type": "NC-ZSCALER",
          "status": "RUNNING"
        },
        "relationships": {
          "tenant": {
            "data": {
              "id": "0016u00000gzfJH",
              "type": "tenants"
            }
          }
        },
        "links": {
          "self": "https://api.cradlepointecm.com/api/v3/asset_endpoints/regrades/SxiA5c4MVWyDBr4"
        }
      }
    }
  ]
}
```

**Response 400** — Bad Request

**Response 402** — Payment Required

**Response 403** — Forbidden

**Response 404** — Not Found

**Response 405** — Method Not Allowed

**Response 406** — Not Acceptable

**Response 409** — Conflict

**Response 412** — Precondition Failed

**Response 415** — Unsupported Media Type

**Response 423** — Locked

**Response 426** — Upgrade Required

**Response 500** — Internal Server Error

### GET /api/v3/asset_endpoints/regrades/{id}

Get one regrade by ID

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| id | path | string | yes |  |

**Example request**

```bash
curl "https://api.cradlepointecm.com/api/v3/asset_endpoints/regrades/{id}" \
  -H "Authorization: Bearer <token>"
```

**Response 200** — OK

**Response 400** — Bad Request

**Response 402** — Payment Required

**Response 403** — Forbidden

**Response 404** — Not Found

**Response 405** — Method Not Allowed

**Response 406** — Not Acceptable

**Response 409** — Conflict

**Response 412** — Precondition Failed

**Response 415** — Unsupported Media Type

**Response 423** — Locked

**Response 426** — Upgrade Required

**Response 500** — Internal Server Error
