# Create Inbound Trunk Group

Creates a Trunk Group.

## Request

HTTP Method: `POST`

URI Path: `/v3/voice_in_trunk_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` | No | Yes | Unique name of the Trunk Group. |
| external\_reference\_id | `string` | Yes | No | Optional identifier for the trunk group in the customer's external system. Maximum length is 100 characters. |
| capacity\_limit | `integer` | No | No | Maximum number of simultaneous calls for the Trunk Group. |

### Request Body Object Relationships

| Name | Type | Description |
| --- | --- | --- |
| voice\_in\_trunks | [To many](../../../specification/relationships.html#api-relationships) | Linkage for included trunks. |

## Examples

Simple CreateCreate and Assign TrunksCreate and Assign Trunk + Include Trunks in Response

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_in_trunk_groups HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunk_groups",
    "attributes": {
      "name": "Main group",
      "capacity_limit": 100
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_in_trunk_groups -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 100, "name": "Main group"}, "type": "voice_in_trunk_groups"}}'
```

response

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "a6370df6-86db-4a1a-9a54-3742f1d8615c",
    "type": "voice_in_trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/voice_in_trunk_groups/a6370df6-86db-4a1a-9a54-3742f1d8615c"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "external_reference_id": null,
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "voice_in_trunks": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunk_groups/a6370df6-86db-4a1a-9a54-3742f1d8615c/relationships/voice_in_trunks",
          "related": "https://api.didww.com/v3/voice_in_trunk_groups/a6370df6-86db-4a1a-9a54-3742f1d8615c/voice_in_trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 0
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_in_trunk_groups HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunk_groups",
    "attributes": {
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "voice_in_trunks": {
        "data": [
          {
            "type": "voice_in_trunks",
            "id": "b7a9d1ce-6a89-4071-bc0d-486ee223787d"
          },
          {
            "type": "voice_in_trunks",
            "id": "7ca415f8-8342-427a-bbfc-171b995f75d6"
          },
          {
            "type": "voice_in_trunks",
            "id": "46aa9cac-a8dd-4a06-82db-cb0731e53ba0"
          }
        ]
      }
    }
  }
}
```

curl

```
curl -i -X POST https://api.didww.com/v3/voice_in_trunk_groups -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 100, "name": "Main group"}, "relationships": {"voice_in_trunks": {"data": [{"type": "voice_in_trunks", "id": "b7a9d1ce-6a89-4071-bc0d-486ee223787d"}, {"type": "voice_in_trunks", "id": "7ca415f8-8342-427a-bbfc-171b995f75d6"}, {"type": "voice_in_trunks", "id": "46aa9cac-a8dd-4a06-82db-cb0731e53ba0"}]}}, "type": "voice_in_trunk_groups"}}'
```

response

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "faea735d-ba77-40ef-bf13-f4dfc0f43a68",
    "type": "voice_in_trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/voice_in_trunk_groups/faea735d-ba77-40ef-bf13-f4dfc0f43a68"
    },
    "attributes": {
      "created_at": "2017-06-25T14:56:31.513Z",
      "external_reference_id": null,
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "voice_in_trunks": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunk_groups/faea735d-ba77-40ef-bf13-f4dfc0f43a68/relationships/voice_in_trunks",
          "related": "https://api.didww.com/v3/voice_in_trunk_groups/faea735d-ba77-40ef-bf13-f4dfc0f43a68/voice_in_trunks"
        }
      }
    },
    "meta": {
      "trunks_count": 3
    }
  }
}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
POST /v3/voice_in_trunk_groups?include=voice_in_trunks HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]

{
  "data": {
    "type": "voice_in_trunk_groups",
    "attributes": {
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "voice_in_trunks": {
        "data": [
          {
            "type": "voice_in_trunks",
            "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7"
          },
          {
            "type": "voice_in_trunks",
            "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d"
          }
        ]
      }
    }
  }
}
```

curl

```
curl -i -X POST 'https://api.didww.com/v3/voice_in_trunk_groups?include=voice_in_trunks' -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 100, "name": "Main group"}, "relationships": {"voice_in_trunks": {"data": [{"type": "voice_in_trunks", "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7"}, {"type": "voice_in_trunks", "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d"}]}}, "type": "voice_in_trunk_groups"}}'
```

response

```
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "3b49216d-ccb0-4376-b9fa-a43ffcb48c35",
    "type": "voice_in_trunk_groups",
    "links": {
      "self": "https://api.didww.com/v3/voice_in_trunk_groups/3b49216d-ccb0-4376-b9fa-a43ffcb48c35"
    },
    "attributes": {
      "created_at": "2017-08-16T14:04:36.013Z",
      "external_reference_id": null,
      "name": "Main group",
      "capacity_limit": 100
    },
    "relationships": {
      "voice_in_trunks": {
        "links": {
          "self": "https://api.didww.com/v3/voice_in_trunk_groups/3b49216d-ccb0-4376-b9fa-a43ffcb48c35/relationships/voice_in_trunks",
          "related": "https://api.didww.com/v3/voice_in_trunk_groups/3b49216d-ccb0-4376-b9fa-a43ffcb48c35/voice_in_trunks"
        },
        "data": [
          {
            "type": "voice_in_trunks",
            "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7"
          },
          {
            "type": "voice_in_trunks",
            "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d"
          }
        ]
      }
    },
    "meta": {
      "trunks_count": 2
    }
  },
  "included": [
    {
      "data": {
        "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7",
        "type": "voice_in_trunks",
    "attributes": {
        "priority": 1,
        "capacity_limit": 2,
        "weight": 65535,
        "name": "Office PSTN",
        "cli_format": "e164",
        "cli_prefix": null,
        "description": null,
        "ringing_timeout": null,
        "configuration": {
            "type": "pstn_configurations",
            "attributes": {
                "dst": "18337249999"
              ]
            }
          }
        },
        "relationships": {
          "voice_in_trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/voice_in_trunks/1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7/relationships/voice_in_trunk_group",
              "related": "https://api.didww.com/v3/voice_in_trunks/1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7/voice_in_trunk_group"
            }
          }
        }
      }
    },
    {
      "data": {
        "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d",
        "type": "voice_in_trunks",
        "attributes": {
          "priority": 1,
          "capacity_limit": 18,
          "weight": 65535,
          "name": "Office sip",
          "cli_format": "e164",
          "cli_prefix": "+1",
          "description": null,
          "ringing_timeout": null,
          "configuration": {
            "type": "sip_configurations",
            "attributes": {
              "dst": "1xxxxxxxxx",
              "host": "example.com",
              "port": null,
              "codec_ids": [
                9,
                6
              ]
            }
          }
        },
        "relationships": {
          "voice_in_trunk_group": {
            "links": {
              "self": "https://api.didww.com/v3/voice_in_trunks/c606cd05-a19f-4d3c-9362-3857a79a6e1d/relationships/voice_in_trunk_group",
              "related": "https://api.didww.com/v3/voice_in_trunks/c606cd05-a19f-4d3c-9362-3857a79a6e1d/voice_in_trunk_group"
            }
          }
        }
      }
    }
  ]
}
```

[[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
