# exchange sites — NCM API

Beta. A NetCloud Exchange site: the network location that holds DNS settings, a local domain, and the endpoints attached to it. Full lifecycle: list, create, update and delete sites. Each site belongs to an exchange network and groups the exchange resources reachable from it.

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

### GET /api/v3/beta/exchange_sites

List Exchange Sites

Retrieve a list of NetCloud Exchange sites with cursor pagination.

> **Beta:** This endpoint is served on a `/beta/` path. Beta endpoints are still evolving and may change without the stability guarantees of GA endpoints.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| filter[name] | query | string | no | The name of the site. |
| filter[exchange_network] | query | ULIDPattern | no | The identifier of the exchange_network to filter sites by. |
| filter[exchange_site_group] | query | ULIDPattern | no | The identifier of the exchange_site_group to filter sites by. |
| filter[exchange_site_group][is_null] | query | boolean | no | Specifies that the site is not part of an exchange_site_group. |
| page[size] | query | integer | no | Set number of entries returned in every page. |
| page[before] | query | string | no | Retrieve the previous page based on the `before` field of a paginated response. |
| page[after] | query | string | no | Retrieve the next page based on the `after` field of a paginated response. |

**Example request**

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

**Response 200** — Exchange sites retrieved successfully.

```json
{
  "data": {
    "type": "exchange_user_managed_sites",
    "id": "3R3Q5JBBBWFKCBKER9CC8BCAR3",
    "attributes": {
      "name": "Site-E300-st1",
      "created_at": "2023-08-02T16:55:12.109698Z",
      "updated_at": "2023-08-02T16:55:12.109698Z",
      "editable": true,
      "primary_dns": "8.8.8.8",
      "secondary_dns": "8.8.8.8",
      "lan_as_dns": true,
      "local_domain": "my-site.ncx"
    },
    "relationships": {
      "exchange_network": {
        "data": {
          "id": "<id>",
          "type": "exchange_networks"
        }
      },
      "exchange_site_group": {
        "data": {
          "id": "<id>",
          "type": "exchange_site_group"
        }
      },
      "tenant": {
        "data": {
          "id": "<id>",
          "type": "tenants"
        }
      },
      "endpoints": {
        "data": [
          {
            "id": "<id>",
            "type": "endpoints"
          }
        ]
      }
    }
  }
}
```

**Response 400** — Bad Request

**Response 403** — Forbidden

### POST /api/v3/beta/exchange_sites

Create Exchange Site

Create a new exchange site.

> **Beta:** This endpoint is served on a `/beta/` path. Beta endpoints are still evolving and may change without the stability guarantees of GA endpoints.

**Request body**

**Example request**

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

**Response 201** — Exchange site created successfully

```json
{
  "data": {
    "type": "exchange_user_managed_sites",
    "id": "<id>",
    "attributes": {
      "name": "Site-E300-st1",
      "created_at": "2023-08-02T16:55:12.109698Z",
      "updated_at": "2023-08-02T16:55:12.109698Z",
      "editable": true,
      "primary_dns": "8.8.8.8",
      "secondary_dns": "8.8.8.8",
      "lan_as_dns": true,
      "local_domain": "my-site.ncx"
    },
    "relationships": {
      "exchange_network": {
        "data": {
          "id": "<id>",
          "type": "exchange_networks"
        }
      },
      "exchange_site_group": {
        "data": {
          "id": "<id>",
          "type": "exchange_site_group"
        }
      },
      "tenant": {
        "data": {
          "id": "<id>",
          "type": "tenants"
        }
      },
      "endpoints": {
        "data": [
          {
            "id": "<id>",
            "type": "endpoints"
          }
        ]
      }
    }
  }
}
```

**Response 400** — Bad Request

**Response 403** — Forbidden

### GET /api/v3/beta/exchange_sites/{exchangeSiteId}

Get Exchange Site by ID

Retrieve a single exchange site by its ULID identifier.

> **Beta:** This endpoint is served on a `/beta/` path. Beta endpoints are still evolving and may change without the stability guarantees of GA endpoints.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| exchangeSiteId | path | string | yes | The ULID identifier of the exchange site. |

**Example request**

```bash
curl "https://api.cradlepointecm.com/api/v3/beta/exchange_sites/{exchangeSiteId}" \
  -H "Authorization: Bearer <token>"
```

**Response 200** — OK

**Response 400** — Bad Request

**Response 403** — Forbidden

### PUT /api/v3/beta/exchange_sites/{exchangeSiteId}

Update Exchange Site

Update an existing exchange site by its ULID identifier.

> **Beta:** This endpoint is served on a `/beta/` path. Beta endpoints are still evolving and may change without the stability guarantees of GA endpoints.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| exchangeSiteId | path | string | yes | The ULID identifier of the exchange site. |

**Request body**

**Example request**

```bash
curl -X PUT "https://api.cradlepointecm.com/api/v3/beta/exchange_sites/{exchangeSiteId}" \
  -H "Authorization: Bearer <token>"
```

**Response 200** — OK

```json
{
  "data": {
    "type": "exchange_user_managed_sites",
    "id": "3R3Q5JBBBWFKCBKER9CC8BCAR3string",
    "attributes": {
      "name": "Site-E300-st1",
      "created_at": "2023-08-02T16:55:12.109698Z",
      "updated_at": "2023-08-02T16:55:12.109698Z",
      "editable": true,
      "primary_dns": "8.8.8.8",
      "secondary_dns": "8.8.8.8",
      "lan_as_dns": true,
      "local_domain": "my-site.ncx"
    },
    "relationships": {
      "exchange_network": {
        "data": {
          "id": "<id>",
          "type": "exchange_networks"
        }
      },
      "exchange_site_group": {
        "data": {
          "id": "<id>",
          "type": "exchange_site_group"
        }
      },
      "tenant": {
        "data": {
          "id": "<id>",
          "type": "tenants"
        }
      },
      "endpoints": {
        "data": [
          {
            "id": "<id>",
            "type": "endpoints"
          }
        ]
      }
    }
  }
}
```

**Response 400** — Bad Request

**Response 403** — Forbidden

**Response 404** — Not Found

### DELETE /api/v3/beta/exchange_sites/{exchangeSiteId}

Delete Exchange Site

Delete an existing exchange site by its ULID identifier.

> **Beta:** This endpoint is served on a `/beta/` path. Beta endpoints are still evolving and may change without the stability guarantees of GA endpoints.

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| exchangeSiteId | path | string | yes | The ULID identifier of the exchange site. |

**Example request**

```bash
curl -X DELETE "https://api.cradlepointecm.com/api/v3/beta/exchange_sites/{exchangeSiteId}" \
  -H "Authorization: Bearer <token>"
```

**Response 204** — Exchange site deleted successfully.

**Response 403** — Forbidden

**Response 404** — Not Found
