# Update Shared Capacity Groups

Updates a Shared Capacity Group.

## Request

HTTP Method: `PATCH`

URI Path: `/v3/shared_capacity_groups/`

### URI Query Parameters

| Name | Type | Is Required? | Description |
| --- | --- | --- | --- |
| include | `string` | No | [Inclusion](../../../specification/includes.html#api-includes) |

### Request Body Object Attributes

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| name | `string` | False | Yes | Unique name of Shared Capacity Group. |
| external\_reference\_id | `string` | True | No | Optional identifier for the shared capacity group in the customer's external system. Maximum length is 100 characters. |
| shared\_channels\_count | `integer` | False | No | Unassigned channels quantity to assign to the Shared Capacity Group from the Capacity Pool. |
| metered\_channels\_count | `integer` | False | No | Metered channels quantity to assign to the Shared Capacity Group. |

### Request Body Object Relationships

| Title | Type | Description |
| --- | --- | --- |
| dids | [To Many](../../../specification/relationships.html#api-relationships) | Linkage for included dids. |
| capacity\_pool | [To one](../../../specification/relationships.html#api-relationships) | Linkage for included capacity\_pool. |

## Examples

Simple UpdateUpdate and Assign DIDsUpdate and Remove DIDs

[[DIDWW-API-EXAMPLE-START]]

http

```
PATCH /v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e",
    "type": "shared_capacity_groups",
    "attributes": {
      "name": "Renamed group"
    }
  }
}
```

curl

```
curl -i -X PATCH https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"name": "Renamed group"}, "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e", "type": "shared_capacity_groups"}}'
```

response

```
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e",
    "type": "shared_capacity_groups",
    "attributes": {
      "name": "Renamed group",
      "shared_channels_count": 3,
      "created_at": "2018-07-06T16:11:32.981Z",
      "external_reference_id": null,
      "metered_channels_count": 5
    },
    "relationships": {
      "capacity_pool": {
        "links": {
          "self": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/relationships/capacity_pool",
          "related": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/capacity_pool"
        }
      },
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/relationships/dids",
          "related": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/dids"
        }
      }
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
PATCH /v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e",
    "type": "shared_capacity_groups",
    "relationships": {
      "dids": {
        "data": [
          {
            "type": "dids",
            "id": "a2dcccdb-4c81-4d93-a174-26001ccfc13a"
          },
          {
            "type": "dids",
            "id": "fd345680-4a4e-40db-b2f2-f81651e3e2df"
          }
        ]
      }
    }
  }
}
```

curl

```
curl -i -X PATCH https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e", "relationships": {"dids": {"data": [{"type": "dids", "id": "a2dcccdb-4c81-4d93-a174-26001ccfc13a"}, {"type": "dids", "id": "fd345680-4a4e-40db-b2f2-f81651e3e2df"}]}}, "type": "shared_capacity_groups"}}'
```

response

```
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e",
    "type": "shared_capacity_groups",
    "attributes": {
      "name": "Renamed group",
      "shared_channels_count": 3,
      "created_at": "2023-03-28T18:25:38.415Z",
      "external_reference_id": null,
      "metered_channels_count": 5
    },
    "relationships": {
      "capacity_pool": {
        "links": {
          "self": "https://api.didww.com/v3/shared_capacity_groups/62fa8ad9-21cc-48e1-933e-f2fe33740891/relationships/capacity_pool",
          "related": "https://api.didww.com/v3/shared_capacity_groups/62fa8ad9-21cc-48e1-933e-f2fe33740891/capacity_pool"
        }
      },
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/shared_capacity_groups/62fa8ad9-21cc-48e1-933e-f2fe33740891/relationships/dids",
          "related": "https://api.didww.com/v3/shared_capacity_groups/62fa8ad9-21cc-48e1-933e-f2fe33740891/dids"
        }
      }
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
PATCH /v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e",
    "type": "shared_capacity_groups",
    "relationships": {
      "dids": {
        "data": [

        ]
      }
    }
  }
}
```

curl

```
curl -i -X PATCH https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e", "relationships": {"dids": {"data": []}}, "type": "shared_capacity_groups"}}'
```

response

```
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "71afa2e2-8d46-4ea3-988d-aa112ed98b5e",
    "type": "shared_capacity_groups",
    "attributes": {
      "name": "Renamed group",
      "shared_channels_count": 3,
      "created_at": "2018-07-06T16:11:32.981Z",
      "external_reference_id": null,
      "metered_channels_count": 5
    },
    "relationships": {
      "capacity_pool": {
        "links": {
          "self": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/relationships/capacity_pool",
          "related": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/capacity_pool"
        }
      },
      "dids": {
        "links": {
          "self": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/relationships/dids",
          "related": "https://api.didww.com/v3/shared_capacity_groups/71afa2e2-8d46-4ea3-988d-aa112ed98b5e/dids"
        }
      }
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

## Other Responses

| Code | Success | Description |
| --- | --- | --- |
| 422 | No | [Unprocessable Entity](../../../specification/errors/index.html#api-validation-error-object) |
| 401 | No | [Unauthorized](../../../configuration.html#api-key) |

On this page
