# Create a Deal Group

Create a Deal Group
Deal Groups are a feature that will allow you and your team to package individual deals into groups.  This should streamline targeting, improve marketability (ex. creating a viewability deal group), and simplify bulk updating of strategies targeting deals.
Deal Groups Ownership and Targeting Permissions:
Ownership: Deal Groups can be created at the Organization, Agency, or Advertiser level of the T1 hierarchy. The creating entity (ex. Agency Z) owns the Deal Group, and any users with access to that entity can edit the Deal Group. Similarly, individual deals can be created at the Organization, Agency, or Advertiser level. The creating entity owns and can edit the deal. A Deal Group can only include deals which have the same owning entity as the Deal Group. This means that a Deal Group created by Agency Z can only include deals owned by Agency Z. That Deal Group cannot include deals created by any other entity, including Agency Z’s parent Organization or subsidiary Advertisers. Like deals, ownership of a Deal Group cannot change once it is created. Please consider this when creating deals and Deal Groups and developing targeting strategies.
Targeting: Targeting permissions are set within individual deals. The default setting permissions all sub-entities of the deal owning entity to target the deal. For example, a deal created by Org X will by default be targetable by all agencies, advertisers and their strategies within Org X. Targeting permissions can also be restricted to particular subsidiary entities of the owning entity. For example, a deal may be created at the Agency level, but only permission targeting for two out of three advertisers within that agency. There are no targeting permissions set within a deal group. Deal Groups instead honor the targeting permissions of the deals within them.  Inside a strategy, users can expand Deal Groups to view the deals within them. Users will only be able to view deals which they are permissioned to target. Deals showing in gray are inactive.

Endpoint: POST /deal_groups
Version: 2.0

## Header parameters:

  - `Content-Type` (string, required)
    _

  - `Cookie` (string, required)
    _

## Request body:

  - `application/json` (unknown)
    _

## Request fields (application/json):

  - `deal_ids` (array)

  - `description` (string)

  - `name` (string)

  - `owner` (object)

  - `owner.id` (integer)

  - `owner.type` (string)
    Enum: "ADVERTISER", "AGENCY", "ORGANIZATION"

  - `status` (boolean)

## Response 200 fields (application/json):

  - `data` (object)

  - `data.created_on` (string)

  - `data.deal_ids` (array)

  - `data.description` (string)

  - `data.entity_type` (string)
    Enum: "deal_group"

  - `data.id` (integer)

  - `data.name` (string)

  - `data.owner` (object)

  - `data.owner.id` (integer)

  - `data.owner.type` (string)
    Enum: "ADVERTISER", "AGENCY", "ORGANIZATION"

  - `data.status` (boolean)
    Whether the deal group is active (TRUE) or inactive (FALSE)

  - `data.updated_on` (string)

  - `data.has_strategies` (boolean)
    Indicates if the deal has strategies assigned

  - `meta` (object)

  - `meta.status` (string)
    Enum: "ok"

## Response 400:

  - `400` (unknown)
    Reasons may include:
* deal_ids is a required field
* 'deal_ids' must be valid and must have the same owner fields as the deal group
* duplicate id's in 'deal_ids'
* Each deal group can have upto 300 deal_ids
* Invalid deal id ___
* Invalid owner.organization_id
* Invalid strategy_id
* 'page_limit' parameter cannot be greater than 100
* 'page_limit' parameter cannot be less than 0
* 'page_offset' parameter cannot be less than 0
* Request must be in JSON format
* 'sort_by' parameter must be one of id, name, updated_on, or created_on
* 'status' parameter is invalid
* The queried field '{}' is not a ___ field this resource can match
* The request is invalid!
* There are more than 1000 ids to be updated!
* There is no data to be updated!
* Unauthorized!               --             (Note: Yes, this is a roles/permissions thing)
* You cannot combine owner.organization_id with deal_id parameter
* You cannot combine strategy_id with deal_id parameter
* You cannot combine strategy_id with owner.organization_id and deal_id parameter
* You cannot combine strategy_id with owner.organization_id parameter
* You need to provide 'owner.organization_id', 'strategy_id', 'deal_id' or 'ids' parameter

