# Create Distribution Group

Create a new Distribution Group.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Distribution Groups API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.cm.com"
    }
  ],
  "paths": {
    "/voice-distributiongroupsapi/v1/{accountGuid}/distributiongroups": {
      "post": {
        "tags": [
          "Distribution Groups"
        ],
        "summary": "Create Distribution Group",
        "description": "Create a new Distribution Group.",
        "parameters": [
          {
            "name": "accountGuid",
            "in": "path",
            "description": "Unique identifier of the Logical Account or Voice Account.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "00000000-0000-0000-0000-000000000000"
          }
        ],
        "requestBody": {
          "description": "The new Distribution Group.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDistributionGroup"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDistributionGroup"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiDistributionGroup"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDistributionGroup"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorCollection"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorCollection"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiDistributionGroup": {
        "title": "Distribution Group",
        "type": "object",
        "properties": {
          "guid": {
            "type": "string",
            "description": "Unique identifier of the Distribution Group.",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "name": {
            "maxLength": 128,
            "type": "string",
            "description": "Name of the Distribution Group.",
            "nullable": true,
            "example": "My Distribution Group"
          },
          "createdOn": {
            "type": "string",
            "description": "Date and time the Distribution Group was created.",
            "format": "date-time",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedOn": {
            "type": "string",
            "description": "Date and time the Distribution Group was last updated.",
            "format": "date-time",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiEndpoint"
            },
            "description": "List of linked Distribution Group Endpoints.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A Distribution Group is a collection of Endpoints that can be grouped together."
      },
      "ApiEndpoint": {
        "title": "Endpoint",
        "type": "object",
        "properties": {
          "guid": {
            "type": "string",
            "description": "Unique identifier of the Endpoint.",
            "format": "uuid",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "name": {
            "type": "string",
            "description": "Name of the Endpoint.",
            "nullable": true,
            "example": "My Endpoint"
          },
          "ipAddress": {
            "type": "string",
            "description": "External IP address of the Endpoint.",
            "nullable": true,
            "example": "0.0.0.0"
          },
          "port": {
            "type": "integer",
            "description": "The port to be configured that is supported by CM. Supported ports: 5060-5100.",
            "format": "int32",
            "example": 5060
          },
          "priority": {
            "minimum": 1,
            "type": "integer",
            "description": "Determines the Round-Robin order of the endpoint. Each endpoint inside a Distribution Group must have a unique priority.",
            "format": "int32",
            "example": 1
          },
          "isActive": {
            "type": "boolean",
            "description": "Determines whether the Endpoint should be active or not.",
            "example": true
          },
          "tlsEnabled": {
            "type": "boolean",
            "description": "Determines whether this endpoint receives SIP traffic via TLS."
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "Key/Value Pairs of attributes configured to an Endpoint.\r\nAttributes are extra settings that can be configured to an Endpoint, for example: media encryption.\r\n            \r\nExample:\r\n{\r\n    \"medianenc\": \"SRTP\"\r\n}",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Endpoint of a Distribution Group where calls can be routed to."
      },
      "Error": {
        "title": "Error",
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ErrorCollection": {
        "title": "Error Collection",
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "X-CM-PRODUCTTOKEN": {
        "type": "apiKey",
        "description": "Your producttoken",
        "name": "X-CM-PRODUCTTOKEN",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "X-CM-PRODUCTTOKEN": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 98,
      "1": 255,
      "2": 69,
      "3": 203,
      "4": 99,
      "5": 40,
      "6": 109,
      "7": 0,
      "8": 121,
      "9": 132,
      "10": 242,
      "11": 105
    }
  }
}
```