openapi: 3.0.0
info:
  title: Marketplaces API V2.0 API
  contact:
    name: developers@mediamath.com
    email: developers@mediamath.com
    url: https://apidocs.mediamath.com
  license:
    url: http://www.apache.org/licenses/LICENSE-2.0.html
    name: Apache 2.0
  version: '2.0'
paths:
  /deals:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List Deals
      description: >-
        List the Deals


        You can read more about deals and deal groups (including adding them
        through T1), deal ownership, and deal best practices
        [here](https://mediamathsupport.force.com/s/article/Media-Module).  You
        may also find it useful for exploring input values.
      operationId: LIST-deals
      parameters:
        - name: ids
          in: query
          description: _
          schema:
            type: string
        - name: export
          in: query
          description: _
          schema:
            type: string
        - name: deal_type
          in: query
          description: Returns a list of deals that match the specified query
          schema:
            type: string
        - name: q
          in: query
          description: Returns a list of deals that match the specified query
          schema:
            type: string
        - name: sort_by
          in: query
          description: Returns a list of deals sorted by the specified parameter
          schema:
            type: boolean
        - name: page_offset
          in: query
          description: Returns a list of deals starting from the specified page offset
          schema:
            type: string
        - name: page_limit
          in: query
          description: Returns a number of deals equal to the specified page limit
          schema:
            type: integer
        - name: currency_code
          in: query
          description: >-
            Returns a list of deals with price attributes converted to such
            currency
          schema:
            type: string
        - name: status
          in: query
          description: Returns a list of deals that match the specified status
          schema:
            type: boolean
        - name: owner.type
          in: query
          description: Returns a list of deals that match the specified owner type
          schema:
            type: string
            enum:
              - INTERNAL
              - ORGANIZATION
              - AGENCY
              - ADVERTISER
        - name: strategy_id
          in: query
          description: >-
            Returns a list of deals that are currently targeted by the strategy
            with that id
          schema:
            type: integer
        - name: owner.advertiser_id
          in: query
          description: >-
            Returns a list of deals that are editable by users of the advertiser
            with that id
          schema:
            type: integer
        - name: owner.agency_id
          in: query
          description: >-
            Returns a list of deals that are editable by users of the agency
            with that id
          schema:
            type: integer
        - name: owner.organization_id
          in: query
          description: >-
            Returns a list of deals that are editable by users of the
            organization with that id
          required: true
          schema:
            type: integer
        - name: permissions.advertiser_id
          in: query
          description: >-
            Returns a list of deals that are targetable by the advertiser with
            that id
          schema:
            type: integer
        - name: Authorization
          in: header
          description: _
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Please note that currently bill_type does not disclose here.  GET
            /deals/{deal ID) will however disclose that parameter, and the
            creation or updating of the deal will both allow bill_type to be set
            and display it in the response.
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        advertiser_id:
                          type: integer
                          description: Advertiser id is 0 for global deal
                        bill_type:
                          type: string
                          enum:
                            - EXCHANGE
                            - NONE
                            - PUBLISHER
                          description: Who will be billed for the deal
                        created_on:
                          type: string
                          format: date-time
                        currency_code:
                          type: string
                          description: ISO 4217 3-character currency code
                          minLength: 3
                          maxLength: 3
                          x-examples:
                            - USD
                        deal_identifier:
                          type: string
                          description: ID used within a bid request to reference the deal
                          maxLength: 256
                        deal_source:
                          type: string
                          enum:
                            - INTERNAL
                            - USER
                          default: INTERNAL
                        deal_type:
                          type: string
                          enum:
                            - PG
                            - STANDARD
                          description: >-
                            deal_type is the type of deal. PG is for a
                            Programmatic Guaranteed deal, and STANDARD is the
                            only other value allowed
                          default: STANDARD
                        description:
                          type: string
                          description: Description of the deal
                          maxLength: 4096
                        end_datetime:
                          type: string
                          description: >-
                            string / timestamp as full RFC 3339 date strings
                            including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                            YYYY-MM-DDTHH:MM:SS-##:##
                          format: date-time
                        entity_type:
                          type: string
                          enum:
                            - deal
                        id:
                          type: integer
                          description: ID of the deal
                        media_type:
                          type: string
                          enum:
                            - DISPLAY
                            - VIDEO
                        name:
                          type: string
                          description: Name of the deal
                          maxLength: 256
                        owner:
                          type: object
                          description: >-
                            Level of ownership for the deal (i.e. who can edit
                            the deal) and the id of the ownership entity. for
                            example, if the ownership level is set to
                            ADVERTISER, anyone with access to such advertiser
                            can edit this deal.
                          properties:
                            id:
                              type: integer
                            type:
                              type: string
                              enum:
                                - ADVERTISER
                                - AGENCY
                                - INTERNAL
                                - ORGANIZATION
                              maxLength: 32
                        partner_sourced:
                          type: boolean
                        permissions:
                          type: object
                          description: >-
                            List of entities that are allowed to target this
                            deal. if a higher-level entity is included, then do
                            not include any lower-level entity that is part of
                            the included higher level entity. for example, if an
                            organization X is listed in this parameter, then
                            automatically all agencies and advertisers that are
                            part of the organization X will be included and
                            listing any such agencies and adevertisers part of
                            organization X will cause a validation error.
                          properties:
                            advertiser_ids:
                              type: array
                              items:
                                type: integer
                            agency_ids:
                              type: array
                              items:
                                type: integer
                            all_organizations:
                              type: boolean
                            organization_ids:
                              type: array
                              items:
                                type: object
                        price:
                          type: object
                          properties:
                            currency_code:
                              type: string
                              description: ISO 4217 3-character currency code
                              minLength: 3
                              maxLength: 3
                              default: USD
                            value:
                              type: string
                              description: Maximum is 9,999,999.9999
                        price_method:
                          type: string
                          enum:
                            - CPM
                          description: CPM is the only acceptable value for now
                          maxLength: 16
                        price_type:
                          type: string
                          enum:
                            - FIXED
                            - FLOOR
                          description: >-
                            The deal is a "FLOOR" price deal (bids must be above
                            this floor, and will likely clear above this floor)
                            or "FIXED" price deal (bids must be at this price or
                            above, and will clear at the fixed price)
                          maxLength: 16
                        publisher_id:
                          type: integer
                        start_datetime:
                          type: string
                          description: >-
                            string / timestamp as full RFC 3339 date strings
                            including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                            YYYY-MM-DDTHH:MM:SS-##:##
                          format: date-time
                        status:
                          type: boolean
                          description: Whether the deal is active
                          default: true
                        sub_supply_source_id:
                          type: integer
                          description: >-
                            ID of the publisher if the supply_source_id is set
                            to 83 (BidSwitch)
                          nullable: true
                        supply_source_id:
                          type: integer
                          description: Exchange providing the deal
                        updated_on:
                          type: string
                          format: date-time
                        version:
                          type: string
                        zone_name:
                          type: string
                          maxLength: 64
                          default: America/New_York
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      offset:
                        type: integer
                      status:
                        type: string
                      total_count:
                        type: integer
              examples:
                response:
                  value:
                    data:
                      - created_on: '2019-08-14T17:23:56+00:00'
                        deal_identifier: MDM-17302-00003
                        deal_type: STANDARD
                        description: News
                        end_datetime: '2999-12-31T05:00:00+00:00'
                        entity_type: deal
                        id: 384382
                        name: >-
                          Rubicon Project_The Washington Post_EBDA_Private
                          Auction_Standard_Desktop & TabletWeb
                          Display_Display_728x90, 160x600, 300x250_FLOOR_First
                          Price_NAR_13_PREMIUM
                        owner:
                          id: 166628
                          type: ADVERTISER
                        permissions:
                          advertiser_ids:
                            - 166628
                          agency_ids: []
                          all_organizations: false
                          organization_ids: []
                        price:
                          currency_code: USD
                          value: '13.0000'
                        price_method: CPM
                        price_type: FLOOR
                        start_datetime: '2019-08-14T17:23:31+00:00'
                        status: true
                        sub_supply_source_id: null
                        supply_source_id: 11
                        updated_on: '2019-08-14T17:23:56+00:00'
                    meta:
                      count: 1
                      offset: 0
                      status: ok
                      total_count: 1
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        advertiser_id:
                          type: integer
                          description: Advertiser id is 0 for global deal
                        bill_type:
                          type: string
                          enum:
                            - EXCHANGE
                            - NONE
                            - PUBLISHER
                          description: Who will be billed for the deal
                        created_on:
                          type: string
                          format: date-time
                        currency_code:
                          type: string
                          description: ISO 4217 3-character currency code
                          minLength: 3
                          maxLength: 3
                          x-examples:
                            - USD
                        deal_identifier:
                          type: string
                          description: ID used within a bid request to reference the deal
                          maxLength: 256
                        deal_source:
                          type: string
                          enum:
                            - INTERNAL
                            - USER
                          default: INTERNAL
                        deal_type:
                          type: string
                          enum:
                            - PG
                            - STANDARD
                          description: >-
                            deal_type is the type of deal. PG is for a
                            Programmatic Guaranteed deal, and STANDARD is the
                            only other value allowed
                          default: STANDARD
                        description:
                          type: string
                          description: Description of the deal
                          maxLength: 4096
                        end_datetime:
                          type: string
                          description: >-
                            string / timestamp as full RFC 3339 date strings
                            including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                            YYYY-MM-DDTHH:MM:SS-##:##
                          format: date-time
                        entity_type:
                          type: string
                          enum:
                            - deal
                        id:
                          type: integer
                          description: ID of the deal
                        media_type:
                          type: string
                          enum:
                            - DISPLAY
                            - VIDEO
                        name:
                          type: string
                          description: Name of the deal
                          maxLength: 256
                        owner:
                          type: object
                          description: >-
                            Level of ownership for the deal (i.e. who can edit
                            the deal) and the id of the ownership entity. for
                            example, if the ownership level is set to
                            ADVERTISER, anyone with access to such advertiser
                            can edit this deal.
                          properties:
                            id:
                              type: integer
                            type:
                              type: string
                              enum:
                                - ADVERTISER
                                - AGENCY
                                - INTERNAL
                                - ORGANIZATION
                              maxLength: 32
                        partner_sourced:
                          type: boolean
                        permissions:
                          type: object
                          description: >-
                            List of entities that are allowed to target this
                            deal. if a higher-level entity is included, then do
                            not include any lower-level entity that is part of
                            the included higher level entity. for example, if an
                            organization X is listed in this parameter, then
                            automatically all agencies and advertisers that are
                            part of the organization X will be included and
                            listing any such agencies and adevertisers part of
                            organization X will cause a validation error.
                          properties:
                            advertiser_ids:
                              type: array
                              items:
                                type: integer
                            agency_ids:
                              type: array
                              items:
                                type: integer
                            all_organizations:
                              type: boolean
                            organization_ids:
                              type: array
                              items:
                                type: object
                        price:
                          type: object
                          properties:
                            currency_code:
                              type: string
                              description: ISO 4217 3-character currency code
                              minLength: 3
                              maxLength: 3
                              default: USD
                            value:
                              type: string
                              description: Maximum is 9,999,999.9999
                        price_method:
                          type: string
                          enum:
                            - CPM
                          description: CPM is the only acceptable value for now
                          maxLength: 16
                        price_type:
                          type: string
                          enum:
                            - FIXED
                            - FLOOR
                          description: >-
                            The deal is a "FLOOR" price deal (bids must be above
                            this floor, and will likely clear above this floor)
                            or "FIXED" price deal (bids must be at this price or
                            above, and will clear at the fixed price)
                          maxLength: 16
                        publisher_id:
                          type: integer
                        start_datetime:
                          type: string
                          description: >-
                            string / timestamp as full RFC 3339 date strings
                            including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                            YYYY-MM-DDTHH:MM:SS-##:##
                          format: date-time
                        status:
                          type: boolean
                          description: Whether the deal is active
                          default: true
                        sub_supply_source_id:
                          type: integer
                          description: >-
                            ID of the publisher if the supply_source_id is set
                            to 83 (BidSwitch)
                          nullable: true
                        supply_source_id:
                          type: integer
                          description: Exchange providing the deal
                        updated_on:
                          type: string
                          format: date-time
                        version:
                          type: string
                        zone_name:
                          type: string
                          maxLength: 64
                          default: America/New_York
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      offset:
                        type: integer
                      status:
                        type: string
                      total_count:
                        type: integer
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Create Deal
      description: >-
        Create Deal


        For more insight into deal creation (inside T1), read
        [here](https://mediamathsupport.force.com/s/article/Media-Module).  You
        may find it useful for exploring input values.
      operationId: POST-deal
      parameters:
        - $ref: '#/components/parameters/trait_postHeader_Content-Type'
        - $ref: '#/components/parameters/trait_cookieAuth_Cookie'
      requestBody:
        $ref: '#/components/requestBodies/create-deal'
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            default: USD
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      '':
                        type: string
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            default: USD
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      '':
                        type: string
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
        '400':
          description: >-
            Reasons may include:


            * "deal_type", "unsupported feature, cannot change deal_type from "
            + db_deal_type + " to " + request_deal_type

            * '{}' format is invalid".format(field)

            * 'deal_type' field is not present in db, requires manually
            investigations

            * end_datetime is required and must match the dates in the __
            Programmatic Guaranteed agreement

            * Entities in the 'permissions' field must be equivalent to or
            sub-entities of the owner entity

            * Invalid currency_code

            * Invalid owner.id

            * Invalid sub_supply_source_id

            * missing owner

            * overlap error: duplicate advertiserID

            * overlap error: duplicate agencyID

            * Owner type not found.

            * 'owner.id' is a required property for this owner.type

            * 'permissions.advertiser_ids' field must be present

            * 'permissions.agency_ids' field must be present

            * 'permissions.organization_ids' currently can have up to one id

            * 'permissions.organization_ids' field must be present

            * 'price.value' is invalid

            * Programmatic guaranteed deals must have a fixed price

            * start_datetime is required and must match the dates in the " +
            name + " Programmatic Guaranteed agreement

            * 'start_datetime' must be earlier than 'end_datetime'

            * 'sub_supply_source_id' is not necessary for this supply source

            * 'sub_supply_source_id' is required for this supply source

            * This deal_identifier already exists

            * This supply source does not support programmatic guaranteed deals

            * Unauthorized to set 'permissions.all_organizations' to true

            * Unauthorized to set this 'owner.type'
  /deal_analytics:
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List Deals and their reporting data
      description: >
        List the Deals


        This call returns all information you get with a deal and also the
        reporting data for a specified time interval (time_window : "yesterday",
        "last_7_days", "last_30_days", "month_to_date", or a custom range using
        "start_date" and "end_date"). You should only send time_window or
        start_date/end_date but not a combination of the both. 

        The filters field allows you to filter the results based on what you
        need, e.g: "filters": [{"field":"id", "op":"in", "value": [123]}] will
        look for deals that have 123 in their ID. 

        {"field" :"match_rate", "op":">", "value" :0} will return deals that
        have a "match_rate" greater than 0. You can also use the "sorting" field
        to sort the results, eg: "sorting":[{"field":"viewability_rate",
        "dir":"asc"}] will give the results sorted by the viewability_rate
        field. 


        ```{
          "reporting": {
            "organization_id": 100048,
            "time_window": "last_7_days",
            "start_date": null,
            "end_date": null
          },
          "filters": [
           {"field": "id",
                       "op": "in",
                       "value" : [447824]},
                       {"field": "match_rate",
                       "op": ">",
                       "value" : 0}
          ],
          "sorting": [
              {
                       "field": "viewability_rate",
                       "dir": "asc"
                   }
         
          ],
          "paging": {
            "page_offset": 0
          }
        }

        ```
      operationId: LIST-deals
      parameters:
        - $ref: '#/components/parameters/trait_postHeader_Content-Type'
        - $ref: '#/components/parameters/trait_cookieAuth_Cookie'
      requestBody:
        $ref: '#/components/requestBodies/create-deal'
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            default: USD
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      '':
                        type: string
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            default: USD
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      '':
                        type: string
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
        '400':
          description: >-
            Reasons may include:


            * "deal_type", "unsupported feature, cannot change deal_type from "
            + db_deal_type + " to " + request_deal_type

            * '{}' format is invalid".format(field)

            * 'deal_type' field is not present in db, requires manually
            investigations

            * end_datetime is required and must match the dates in the __
            Programmatic Guaranteed agreement

            * Entities in the 'permissions' field must be equivalent to or
            sub-entities of the owner entity

            * Invalid currency_code

            * Invalid owner.id

            * Invalid sub_supply_source_id

            * missing owner

            * overlap error: duplicate advertiserID

            * overlap error: duplicate agencyID

            * Owner type not found.

            * 'owner.id' is a required property for this owner.type

            * 'permissions.advertiser_ids' field must be present

            * 'permissions.agency_ids' field must be present

            * 'permissions.organization_ids' currently can have up to one id

            * 'permissions.organization_ids' field must be present

            * 'price.value' is invalid

            * Programmatic guaranteed deals must have a fixed price

            * start_datetime is required and must match the dates in the " +
            name + " Programmatic Guaranteed agreement

            * 'start_datetime' must be earlier than 'end_datetime'

            * 'sub_supply_source_id' is not necessary for this supply source

            * 'sub_supply_source_id' is required for this supply source

            * This deal_identifier already exists

            * This supply source does not support programmatic guaranteed deals

            * Unauthorized to set 'permissions.all_organizations' to true

            * Unauthorized to set this 'owner.type'
  /deals/{id}:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Get Deal
      description: >-
        Get Deal


        You can read more about deals and deal groups (including adding them
        through MediaMath Platform), deal ownership, and deal best practices
        [here](https://mediamathsupport.force.com/s/article/Media-Module).  You
        may also find it useful for exploring input values. 
      operationId: GET-deal
      parameters:
        - name: id
          in: path
          description: id
          required: true
          schema:
            type: integer
        - name: currency_code
          in: query
          description: >-
            Returns a list of deals with price attributes converted to such
            currency
          schema:
            type: string
        - name: Authorization
          in: header
          description: Authorization
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      advertiser_id:
                        type: integer
                        description: Advertiser id is 0 for global deal
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      currency_code:
                        type: string
                        description: ISO-4217 3-letter currency code
                        minLength: 3
                        maxLength: 3
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_source:
                        type: string
                        enum:
                          - INTERNAL
                          - USER
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      media_type:
                        type: string
                        enum:
                          - DISPLAY
                          - VIDEO
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      partner_sourced:
                        type: boolean
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: integer
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      publisher_id:
                        type: integer
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      version:
                        type: integer
                      zone_name:
                        type: string
                        maxLength: 64
                        default: America/New_York
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
              examples:
                response:
                  value:
                    data:
                      created_on: '2016-11-22T10:24:21+00:00'
                      deal_identifier: '416788299328261311'
                      description: ''
                      end_datetime: '2999-12-31T00:00:00+00:00'
                      entity_type: deal
                      id: 140591
                      name: Future | Tech | Standards | DELL
                      owner:
                        id: 170605
                        type: ADVERTISER
                      permissions:
                        advertiser_ids:
                          - 170605
                        agency_ids: []
                        all_organizations: false
                        organization_ids: []
                      price:
                        currency_code: GBP
                        value: '4.0000'
                      price_method: CPM
                      price_type: FLOOR
                      start_datetime: '2016-10-31T11:26:59+00:00'
                      status: true
                      sub_supply_source_id: null
                      supply_source_id: 8
                      updated_on: '2016-11-22T10:24:21+00:00'
                    meta:
                      status: ok
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      advertiser_id:
                        type: integer
                        description: Advertiser id is 0 for global deal
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      currency_code:
                        type: string
                        description: ISO-4217 3-letter currency code
                        minLength: 3
                        maxLength: 3
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_source:
                        type: string
                        enum:
                          - INTERNAL
                          - USER
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      media_type:
                        type: string
                        enum:
                          - DISPLAY
                          - VIDEO
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      partner_sourced:
                        type: boolean
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: integer
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      publisher_id:
                        type: integer
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      version:
                        type: integer
                      zone_name:
                        type: string
                        maxLength: 64
                        default: America/New_York
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Update Deal
      description: >-
        Update Deal


        You can read more about deals and deal groups (including adding them
        through T1), deal ownership, and deal best practices
        [here](https://mediamathsupport.force.com/s/article/Media-Module).  You
        may also find it useful for exploring input values.
      operationId: PUT-deal
      parameters:
        - name: id
          in: path
          description: id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/trait_postHeader_Content-Type'
        - $ref: '#/components/parameters/trait_cookieAuth_Cookie'
      requestBody:
        content:
          application/javascript:
            schema:
              $ref: '#/components/schemas/update-deal'
          application/json:
            schema:
              $ref: '#/components/schemas/update-deal'
        description: >-
          Note: The owner type and ID cannot be altered once the deal has been
          created.
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            minLength: 3
                            maxLength: 3
                            default: USD
                          value:
                            type: string
                            description: Maximum value is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
              examples:
                response:
                  value:
                    data:
                      bill_type: EXCHANGE
                      created_on: '2019-08-19T14:14:59+00:00'
                      deal_identifier: somethingelselongerstring3
                      deal_type: STANDARD
                      description: My First Deal Update
                      end_datetime: '2999-12-31T05:00:00+00:00'
                      entity_type: deal
                      id: 384607
                      name: Alec
                      owner:
                        id: 464566
                        type: INTERNAL
                      permissions:
                        advertiser_ids: []
                        agency_ids: []
                        all_organizations: true
                        organization_ids: []
                      price:
                        currency_code: EUR
                        value: '2.7500'
                      price_method: CPM
                      price_type: FLOOR
                      start_datetime: '2999-03-13T16:39:22+00:00'
                      status: true
                      sub_supply_source_id: null
                      supply_source_id: 41
                      updated_on: '2019-08-19T14:58:33+00:00'
                    meta:
                      status: ok
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            minLength: 3
                            maxLength: 3
                            default: USD
                          value:
                            type: string
                            description: Maximum value is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
        '400':
          description: >-
            Reasons may include:


            * "deal_type", "unsupported feature, cannot change deal_type from "
            + db_deal_type + " to " + request_deal_type

            * '{}' format is invalid".format(field)

            * 'deal_type' field is not present in db, requires manually
            investigations

            * end_datetime is required and must match the dates in the __
            Programmatic Guaranteed agreement

            * Entities in the 'permissions' field must be equivalent to or
            sub-entities of the owner entity

            * Invalid currency_code

            * Invalid owner.id

            * Invalid sub_supply_source_id

            * missing owner

            * overlap error: duplicate advertiserID

            * overlap error: duplicate agencyID

            * Owner type not found.

            * 'owner.id' is a required property for this owner.type

            * 'permissions.advertiser_ids' field must be present

            * 'permissions.agency_ids' field must be present

            * 'permissions.organization_ids' currently can have up to one id

            * 'permissions.organization_ids' field must be present

            * 'price.value' is invalid

            * Programmatic guaranteed deals must have a fixed price

            * start_datetime is required and must match the dates in the " +
            name + " Programmatic Guaranteed agreement

            * 'start_datetime' must be earlier than 'end_datetime'

            * 'sub_supply_source_id' is not necessary for this supply source

            * 'sub_supply_source_id' is required for this supply source

            * This deal_identifier already exists

            * This supply source does not support programmatic guaranteed deals

            * Unauthorized to set 'permissions.all_organizations' to true

            * Unauthorized to set this 'owner.type'
  /deal_groups:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List the Deal Groups
      description: >
        List the Deal Groups

        When executing the GET call, you must specify one of the following:
        'owner.organization_id', or 'ids' parameter, or else you will receive an
        error.
      operationId: LIST-deal-groups
      parameters:
        - name: ids
          in: query
          description: ids
          schema:
            type: string
        - name: export
          in: query
          description: export
          schema:
            type: string
        - name: all
          in: query
          description: all
          schema:
            type: integer
        - name: status
          in: query
          description: status
          schema:
            type: boolean
        - name: deal_id
          in: query
          description: deal_id
          schema:
            type: integer
        - name: strategy_id
          in: query
          description: strategy_id
          required: true
          schema:
            type: integer
        - name: owner.organization_id
          in: query
          description: owner.organization_id
          required: true
          schema:
            type: integer
        - name: page_offset
          in: query
          description: page_offset
          required: false
          schema:
            type: integer
        - name: page_limit
          in: query
          description: page_limit
          required: false
          schema:
            type: integer
        - name: sort_by
          in: query
          description: sort_by
          required: false
          schema:
            type: string
        - name: q
          in: query
          description: q
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Authorization
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        created_on:
                          type: string
                          format: date-time
                        deal_ids:
                          type: array
                          items:
                            type: integer
                        description:
                          type: string
                          maxLength: 4095
                        entity_type:
                          type: string
                          enum:
                            - deal_group
                        id:
                          type: integer
                        name:
                          type: string
                          maxLength: 255
                        owner:
                          type: object
                          properties:
                            id:
                              type: integer
                            type:
                              type: string
                              enum:
                                - ADVERTISER
                                - AGENCY
                                - ORGANIZATION
                        status:
                          type: boolean
                          description: >-
                            Whether the deal group is active (TRUE) or inactive
                            (FALSE)
                        updated_on:
                          type: string
                          format: date-time
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      offset:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      total_count:
                        type: integer
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        created_on:
                          type: string
                          format: date-time
                        deal_ids:
                          type: array
                          items:
                            type: integer
                        description:
                          type: string
                          maxLength: 4095
                        entity_type:
                          type: string
                          enum:
                            - deal_group
                        id:
                          type: integer
                        name:
                          type: string
                          maxLength: 255
                        owner:
                          type: object
                          properties:
                            id:
                              type: integer
                            type:
                              type: string
                              enum:
                                - ADVERTISER
                                - AGENCY
                                - ORGANIZATION
                        status:
                          type: boolean
                          description: >-
                            Whether the deal group is active (TRUE) or inactive
                            (FALSE)
                        updated_on:
                          type: string
                          format: date-time
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      offset:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      total_count:
                        type: integer
            application/vnd.mediatamth.v1+json:
              examples:
                response:
                  value:
                    data:
                      - created_on: '2019-03-21T09:58:32+00:00'
                        deal_ids:
                          - 350760
                        description: Alec's First Deal Group, updated
                        entity_type: deal_group
                        id: 553
                        name: First Deal Group, updated
                        owner:
                          id: 113372
                          type: AGENCY
                        status: true
                        updated_on: '2019-03-21T10:03:48+00:00'
                    meta:
                      count: 1
                      offset: 0
                      status: ok
                      total_count: 1
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Create a Deal Group
      description: >-
        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. 


        Note: the text above, with screenshots of T1 editing, can be found
        [here](https://mediamathsupport.force.com/s/article/Media-Module)
      operationId: POST-deal-group
      parameters:
        - name: Content-Type
          in: header
          description: _
          required: true
          schema:
            type: string
        - name: Cookie
          in: header
          description: _
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
              properties:
                deal_ids:
                  type: array
                  items:
                    type: integer
                description:
                  type: string
                name:
                  type: string
                owner:
                  type: object
                  properties:
                    id:
                      type: integer
                    type:
                      type: string
                      enum:
                        - ADVERTISER
                        - AGENCY
                        - ORGANIZATION
                status:
                  type: boolean
          application/json:
            schema:
              type: object
              properties:
                deal_ids:
                  type: array
                  items:
                    type: integer
                description:
                  type: string
                name:
                  type: string
                owner:
                  type: object
                  properties:
                    id:
                      type: integer
                    type:
                      type: string
                      enum:
                        - ADVERTISER
                        - AGENCY
                        - ORGANIZATION
                status:
                  type: boolean
        description: _
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                        format: date-time
                      deal_ids:
                        type: array
                        items:
                          type: integer
                      description:
                        type: string
                        maxLength: 4095
                      entity_type:
                        type: string
                        enum:
                          - deal_group
                      id:
                        type: integer
                      name:
                        type: string
                        maxLength: 255
                      owner:
                        type: object
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - ORGANIZATION
                      status:
                        type: boolean
                        description: >-
                          Whether the deal group is active (TRUE) or inactive
                          (FALSE)
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - ok
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                        format: date-time
                      deal_ids:
                        type: array
                        items:
                          type: integer
                      description:
                        type: string
                        maxLength: 4095
                      entity_type:
                        type: string
                        enum:
                          - deal_group
                      id:
                        type: integer
                      name:
                        type: string
                        maxLength: 255
                      owner:
                        type: object
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - ORGANIZATION
                      status:
                        type: boolean
                        description: >-
                          Whether the deal group is active (TRUE) or inactive
                          (FALSE)
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - ok
        '400':
          description: >-
            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
  /deal_groups/{id}:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Get Deal Groups
      description: |
        Get a Deal Group's Details
      operationId: GET-deal-group
      parameters:
        - name: id
          in: path
          description: _
          required: true
          schema:
            type: integer
        - name: Authorization
          in: header
          description: Authorization
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                        format: date-time
                      deal_ids:
                        type: array
                        items:
                          type: integer
                      description:
                        type: string
                        maxLength: 4095
                      entity_type:
                        type: string
                        enum:
                          - deal_group
                      id:
                        type: integer
                      name:
                        type: string
                        maxLength: 255
                      owner:
                        type: object
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - ORGANIZATION
                      status:
                        type: boolean
                        description: >-
                          Whether the deal group is active (TRUE) or inactive
                          (FALSE)
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      offset:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      total_count:
                        type: integer
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                        format: date-time
                      deal_ids:
                        type: array
                        items:
                          type: integer
                      description:
                        type: string
                        maxLength: 4095
                      entity_type:
                        type: string
                        enum:
                          - deal_group
                      id:
                        type: integer
                      name:
                        type: string
                        maxLength: 255
                      owner:
                        type: object
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - ORGANIZATION
                      status:
                        type: boolean
                        description: >-
                          Whether the deal group is active (TRUE) or inactive
                          (FALSE)
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      offset:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      total_count:
                        type: integer
            application/vnd.mediatamth.v1+json:
              examples:
                response:
                  value:
                    data:
                      created_on: '2019-03-21T09:58:32+00:00'
                      deal_ids:
                        - 350760
                      description: Alec's First Deal Group, updated
                      entity_type: deal_group
                      id: 553
                      name: First Deal Group, updated
                      owner:
                        id: 113372
                        type: AGENCY
                      status: true
                      updated_on: '2019-03-21T10:03:48+00:00'
                    meta:
                      count: 1
                      offset: 0
                      status: ok
                      total_count: 1
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Update Deal Groups
      description: >-
        Update a Deal Group's Details


        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:

        Like deals, ownership of a Deal Group cannot change once it is created.

        There are no targeting permissions set within a deal group. Deal Groups
        instead honor the targeting permissions of the deals within them.
      operationId: PUT-deal-group
      parameters:
        - name: id
          in: path
          description: _
          required: true
          schema:
            type: integer
        - name: Content-Type
          in: header
          description: _
          required: true
          schema:
            type: string
        - name: Cookie
          in: header
          description: _
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
              properties:
                name:
                  type: string
                status:
                  type: boolean
                deal_ids:
                  type: array
                  items:
                    type: integer
                description:
                  type: string
                owner:
                  type: object
                  properties:
                    type:
                      type: string
                    id:
                      type: integer
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                status:
                  type: boolean
                deal_ids:
                  type: array
                  items:
                    type: integer
                description:
                  type: string
                owner:
                  type: object
                  properties:
                    type:
                      type: string
                    id:
                      type: integer
        description: _
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                        format: date-time
                      deal_ids:
                        type: array
                        items:
                          type: integer
                      description:
                        type: string
                        maxLength: 4095
                      entity_type:
                        type: string
                        enum:
                          - deal_group
                      id:
                        type: integer
                      name:
                        type: string
                        maxLength: 255
                      owner:
                        type: object
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - ORGANIZATION
                      status:
                        type: boolean
                        description: >-
                          Whether the deal group is active (TRUE) or inactive
                          (FALSE)
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - ok
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                        format: date-time
                      deal_ids:
                        type: array
                        items:
                          type: integer
                      description:
                        type: string
                        maxLength: 4095
                      entity_type:
                        type: string
                        enum:
                          - deal_group
                      id:
                        type: integer
                      name:
                        type: string
                        maxLength: 255
                      owner:
                        type: object
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - ORGANIZATION
                      status:
                        type: boolean
                        description: >-
                          Whether the deal group is active (TRUE) or inactive
                          (FALSE)
                      updated_on:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - ok
        '400':
          description: >-
            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
  /publishers:
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Create publisher
      description: >-
        Publishers


        Information about PMP-D from the T1 side can be found
        [here](https://mediamathsupport.force.com/s/article/Private-Marketplace-Direct-PMPD)


        A video explainer on publisher management through the MediaMath app can
        be found at:
        https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806
      operationId: POST_publishers
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
              properties:
                organization_id:
                  type: integer
                  description: "ID of the organization to associate the publisher with\t"
                name:
                  type: string
                  description: "Name of the publisher\t(64 character maximum)"
                  maxLength: 64
              required:
                - organization_id
                - name
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: integer
                  description: "ID of the organization to associate the publisher with\t"
                name:
                  type: string
                  description: "Name of the publisher\t(64 character maximum)"
                  maxLength: 64
              required:
                - organization_id
                - name
        description: _
      responses:
        '200':
          description: ''
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                  data:
                    type: object
                    properties:
                      deleted_on:
                        nullable: true
                      organization_id:
                        type: integer
                      last_touch_user_id:
                        type: integer
                      updated_on:
                        type: string
                      created_on:
                        type: string
                      id:
                        type: integer
                      name:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                  data:
                    type: object
                    properties:
                      deleted_on:
                        nullable: true
                      organization_id:
                        type: integer
                      last_touch_user_id:
                        type: integer
                      updated_on:
                        type: string
                      created_on:
                        type: string
                      id:
                        type: integer
                      name:
                        type: string
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List publishers
      description: >
        Publishers are associated to an organization. A collection of publishers
        for an organization can be retrieved using an HTTP GET request
        containing an organization_id


        `Example:
        https://api.mediamath.com/deals/v1.0/publishers?organization_id=100315`


        The only sort_by parameter allowed is "name", and organization_id is the
        only required parameter


        A video explainer on publisher management through the MediaMath app can
        be found at:
        https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806
      operationId: Retrieve_publishers
      parameters:
        - name: sort_by
          in: query
          description: sort_by
          schema:
            type: string
            enum:
              - name
        - name: q
          in: query
          description: q
          schema:
            type: string
        - name: page_offset
          in: query
          description: page_offset
          schema:
            type: integer
        - name: page_limit
          in: query
          description: Maximum list page element count
          schema:
            type: integer
        - name: organization_id
          in: query
          description: organization_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            ```
            {
            "meta": {
            "count": 1,
            "status": "ok",
            "offset": 0,
            "total_count": 1
            },
            "data": [
            {
            "name": "testing",
            "last_touch_user_id": 4254,
            "id": 3,
            "updated_on": "2020-10-01T14:21:48+00:00",
            "created_on": "2020-10-01T14:21:48+00:00",
            "deleted_on": null,
            "organization_id": 100315
            }
            ]
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      status:
                        type: string
                      offset:
                        type: integer
                      total_count:
                        type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        last_touch_user_id:
                          type: integer
                        id:
                          type: integer
                        updated_on:
                          type: string
                        created_on:
                          type: string
                        deleted_on:
                          nullable: true
                        organization_id:
                          type: integer
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      status:
                        type: string
                      offset:
                        type: integer
                      total_count:
                        type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        last_touch_user_id:
                          type: integer
                        id:
                          type: integer
                        updated_on:
                          type: string
                        created_on:
                          type: string
                        deleted_on:
                          nullable: true
                        organization_id:
                          type: integer
  /publishers/{id}:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Read publisher
      description: >-
        `Example: https://api.mediamath.com/deals/v1.0/publishers/3`


        A video explainer on publisher management through the MediaMath app can
        be found at:
        https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806
      operationId: Retrieve_a_publisher_by_ID
      parameters:
        - name: id
          in: path
          description: See below
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            ```
            {
              "data": {
                "created_on": "2020-10-01T14:21:48+00:00",
                "last_touch_user_id": 4254,
                "id": 3,
                "organization_id": 100315,
                "updated_on": "2020-10-01T14:21:48+00:00",
                "name": "testing",
                "deleted_on": null
              },
              "meta": {
                "status": "ok"
              }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                      last_touch_user_id:
                        type: integer
                      id:
                        type: integer
                      organization_id:
                        type: integer
                      updated_on:
                        type: string
                      name:
                        type: string
                      deleted_on:
                        nullable: true
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                      last_touch_user_id:
                        type: integer
                      id:
                        type: integer
                      organization_id:
                        type: integer
                      updated_on:
                        type: string
                      name:
                        type: string
                      deleted_on:
                        nullable: true
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Update Publisher
      description: "`Example: POST https://api.mediamath.com/deals/v1.0/publishers/5`\n\nwhere you might want to edit to the following:\n\n```\n{\n\_\_\_ \"name\" : \"edited demo publisher 2\",\_\n}\n```\n\nA video explainer on publisher management through the MediaMath app can be found at: https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806"
      operationId: Edit_Pub_name
      parameters:
        - name: id
          in: path
          description: See below
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            {
                "data": {
                    "created_on": "2020-09-28T20:52:03+00:00",
                    "deleted_on": null,
                    "id": 5,
                    "last_touch_user_id": 1234,
                    "name": "edited demo publisher 2",
                    "organization_id": 100048,
                    "updated_on": "2020-09-28T20:52:03+00:00"
                },
                "meta": {
                    "status": "ok"
                }
            }
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                      last_touch_user_id:
                        type: integer
                      id:
                        type: integer
                      organization_id:
                        type: integer
                      updated_on:
                        type: string
                      name:
                        type: string
                      deleted_on:
                        nullable: true
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_on:
                        type: string
                      last_touch_user_id:
                        type: integer
                      id:
                        type: integer
                      organization_id:
                        type: integer
                      updated_on:
                        type: string
                      name:
                        type: string
                      deleted_on:
                        nullable: true
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
    delete:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Delete publisher
      description: >-
        `Example: DELETE https://api.mediamath.com/deals/v1.0/publishers/5`



        A video explainer on publisher management through the MediaMath app can
        be found at:
        https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806
      operationId: Delete_publisher
      parameters:
        - name: id
          in: path
          description: See below
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            ```
            {
              "meta": {
                "status": "ok"
              },
              "data": {
                "deleted_on": "2020-10-07T21:26:03+00:00",
                "organization_id": 100048,
                "last_touch_user_id": 1234,
                "updated_on": "2020-10-07T21:26:03+00:00",
                "created_on": "2020-09-28T20:52:03+00:00",
                "id": 5,
                "name": "edited demo publisher 2"
              }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                  data:
                    type: object
                    properties:
                      deleted_on:
                        type: string
                      organization_id:
                        type: integer
                      last_touch_user_id:
                        type: integer
                      updated_on:
                        type: string
                      created_on:
                        type: string
                      id:
                        type: integer
                      name:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                  data:
                    type: object
                    properties:
                      deleted_on:
                        type: string
                      organization_id:
                        type: integer
                      last_touch_user_id:
                        type: integer
                      updated_on:
                        type: string
                      created_on:
                        type: string
                      id:
                        type: integer
                      name:
                        type: string
  /channels:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List channels
      description: Displays a list of channels
      operationId: List_channels
      parameters:
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            ```
            [
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 1,
                "name": "Display",
                "pos": 1,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              },
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 2,
                "name": "Mobile Web",
                "pos": 2,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              },
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 3,
                "name": "Mobile In-app",
                "pos": 3,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              },
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 4,
                "name": "Video",
                "pos": 4,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              },
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 5,
                "name": "Audio",
                "pos": 5,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              },
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 6,
                "name": "CTV",
                "pos": 6,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              },
              {
                "created_on": "Mon, 20 Jul 2020 11:13:55 GMT",
                "id": 7,
                "name": "DOOH",
                "pos": 7,
                "updated_on": "Mon, 20 Jul 2020 11:13:55 GMT"
              }
            ]
            ```
          content:
            application/javascript:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    created_on:
                      type: string
                    id:
                      type: integer
                    name:
                      type: string
                    pos:
                      type: integer
                    updated_on:
                      type: string
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    created_on:
                      type: string
                    id:
                      type: integer
                    name:
                      type: string
                    pos:
                      type: integer
                    updated_on:
                      type: string
  /bulk_update/deals:
    put:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Bulk Update Deal
      description: Bulk Update Deal
      operationId: Update-Bulk-Deal
      parameters:
        - name: <<any other attributes>>
          in: query
          description: <<any other attributes>>
          schema:
            type: string
        - name: name
          in: query
          description: name
          schema:
            type: string
        - name: description
          in: query
          description: description
          schema:
            type: string
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
              properties:
                deals:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
          application/json:
            schema:
              type: object
              properties:
                deals:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
        description: See below
      responses:
        '200':
          description: |-
            ```
            {
                "data": {
                    "updated_deals": [
                        {
                            "updated_on": "2021-07-08T14:02:24+00:00",
                            "created_on": "2021-07-08T13:57:26+00:00",
                            "id": 429599,
                            "name": "some new name",
                            "description": "something",
                            "supply_source_id": 246,
                            "sub_supply_source_id": null,
                            "deal_identifier": "hello",
                            "start_datetime": "2020-12-31T05:00:00+00:00",
                            "end_datetime": "2999-12-31T05:00:00+00:00",
                            "price_type": "FLOOR",
                            "price_method": "CPM",
                            "status": false,
                            "bill_type": "EXCHANGE",
                            "deal_type": "STANDARD",
                            "impressions": 22,
                            "channels": [
                                {
                                    "id": 1,
                                    "name": "Display",
                                    "pos": 1,
                                    "created_on": "2020-07-20T11:13:55.015407+00:00",
                                    "updated_on": "2020-07-20T11:13:55.015407+00:00"
                                },
                                {
                                    "id": 2,
                                    "name": "Mobile Web",
                                    "pos": 2,
                                    "created_on": "2020-07-20T11:13:55.015407+00:00",
                                    "updated_on": "2020-07-20T11:13:55.015407+00:00"
                                }
                            ],
                            "publisher_id": null,
                            "organization_id": 100315,
                            "permissions": {
                                "all_organizations": false,
                                "organization_ids": [
                                    100315
                                ],
                                "agency_ids": [],
                                "advertiser_ids": []
                            },
                            "owner": {
                                "type": "ORGANIZATION",
                                "id": 100315
                            },
                            "price": {
                                "value": "1.3000",
                                "currency_code": "EUR"
                            },
                            "entity_type": "deal",
                            "deal_groups": [],
                            "strategies_count": 0
                        }
                    ],
                    "invalid_deals": []
                },
                "meta": {
                    "status": "ok"
                }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      updated_deals:
                        type: array
                        items:
                          type: object
                          properties:
                            updated_on:
                              type: string
                            created_on:
                              type: string
                            id:
                              type: integer
                            name:
                              type: string
                            description:
                              type: string
                            supply_source_id:
                              type: integer
                            sub_supply_source_id:
                              nullable: true
                            deal_identifier:
                              type: string
                            start_datetime:
                              type: string
                            end_datetime:
                              type: string
                            price_type:
                              type: string
                            price_method:
                              type: string
                            status:
                              type: boolean
                            bill_type:
                              type: string
                            deal_type:
                              type: string
                            impressions:
                              nullable: true
                            channels:
                              nullable: true
                            publisher_id:
                              nullable: true
                            permissions:
                              type: object
                              properties:
                                all_organizations:
                                  type: boolean
                                organization_ids:
                                  type: array
                                  items:
                                    type: object
                                agency_ids:
                                  type: array
                                  items:
                                    type: object
                                advertiser_ids:
                                  type: array
                                  items:
                                    type: integer
                            owner:
                              type: object
                              properties:
                                type:
                                  type: string
                                id:
                                  type: integer
                            price:
                              type: object
                              properties:
                                value:
                                  type: string
                                currency_code:
                                  type: string
                            entity_type:
                              type: string
                            deal_groups:
                              type: array
                              items:
                                type: object
                            strategies_count:
                              type: integer
                      invalid_deals:
                        type: array
                        items:
                          type: object
                          properties:
                            deal:
                              type: object
                              properties:
                                updated_on:
                                  nullable: true
                                created_on:
                                  nullable: true
                                id:
                                  type: integer
                                name:
                                  type: string
                                description:
                                  nullable: true
                                supply_source_id:
                                  nullable: true
                                sub_supply_source_id:
                                  nullable: true
                                deal_identifier:
                                  nullable: true
                                start_datetime:
                                  nullable: true
                                end_datetime:
                                  nullable: true
                                price:
                                  type: object
                                  properties:
                                    value:
                                      type: string
                                    currency_code:
                                      nullable: true
                                price_type:
                                  nullable: true
                                price_method:
                                  nullable: true
                                status:
                                  nullable: true
                                bill_type:
                                  nullable: true
                                deal_type:
                                  nullable: true
                                impressions:
                                  nullable: true
                                channels:
                                  nullable: true
                                publisher_id:
                                  nullable: true
                                permissions:
                                  type: object
                                  properties:
                                    all_organizations:
                                      nullable: true
                                    organization_ids:
                                      nullable: true
                                    agency_ids:
                                      nullable: true
                                    advertiser_ids:
                                      nullable: true
                                owner:
                                  type: object
                                  properties:
                                    type:
                                      nullable: true
                                    id:
                                      nullable: true
                                entity_type:
                                  type: string
                                deal_groups:
                                  type: array
                                  items:
                                    type: object
                                strategies_count:
                                  type: integer
                            validation_error:
                              type: string
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      updated_deals:
                        type: array
                        items:
                          type: object
                          properties:
                            updated_on:
                              type: string
                            created_on:
                              type: string
                            id:
                              type: integer
                            name:
                              type: string
                            description:
                              type: string
                            supply_source_id:
                              type: integer
                            sub_supply_source_id:
                              nullable: true
                            deal_identifier:
                              type: string
                            start_datetime:
                              type: string
                            end_datetime:
                              type: string
                            price_type:
                              type: string
                            price_method:
                              type: string
                            status:
                              type: boolean
                            bill_type:
                              type: string
                            deal_type:
                              type: string
                            impressions:
                              nullable: true
                            channels:
                              nullable: true
                            publisher_id:
                              nullable: true
                            permissions:
                              type: object
                              properties:
                                all_organizations:
                                  type: boolean
                                organization_ids:
                                  type: array
                                  items:
                                    type: object
                                agency_ids:
                                  type: array
                                  items:
                                    type: object
                                advertiser_ids:
                                  type: array
                                  items:
                                    type: integer
                            owner:
                              type: object
                              properties:
                                type:
                                  type: string
                                id:
                                  type: integer
                            price:
                              type: object
                              properties:
                                value:
                                  type: string
                                currency_code:
                                  type: string
                            entity_type:
                              type: string
                            deal_groups:
                              type: array
                              items:
                                type: object
                            strategies_count:
                              type: integer
                      invalid_deals:
                        type: array
                        items:
                          type: object
                          properties:
                            deal:
                              type: object
                              properties:
                                updated_on:
                                  nullable: true
                                created_on:
                                  nullable: true
                                id:
                                  type: integer
                                name:
                                  type: string
                                description:
                                  nullable: true
                                supply_source_id:
                                  nullable: true
                                sub_supply_source_id:
                                  nullable: true
                                deal_identifier:
                                  nullable: true
                                start_datetime:
                                  nullable: true
                                end_datetime:
                                  nullable: true
                                price:
                                  type: object
                                  properties:
                                    value:
                                      type: string
                                    currency_code:
                                      nullable: true
                                price_type:
                                  nullable: true
                                price_method:
                                  nullable: true
                                status:
                                  nullable: true
                                bill_type:
                                  nullable: true
                                deal_type:
                                  nullable: true
                                impressions:
                                  nullable: true
                                channels:
                                  nullable: true
                                publisher_id:
                                  nullable: true
                                permissions:
                                  type: object
                                  properties:
                                    all_organizations:
                                      nullable: true
                                    organization_ids:
                                      nullable: true
                                    agency_ids:
                                      nullable: true
                                    advertiser_ids:
                                      nullable: true
                                owner:
                                  type: object
                                  properties:
                                    type:
                                      nullable: true
                                    id:
                                      nullable: true
                                entity_type:
                                  type: string
                                deal_groups:
                                  type: array
                                  items:
                                    type: object
                                strategies_count:
                                  type: integer
                            validation_error:
                              type: string
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
        '400':
          description: >-
            * Programmatic guaranteed deals must have a fixed price

            * start_datetime is required and must match the dates in the " +
            name + " Programmatic Guaranteed agreement

            * 'start_datetime' must be earlier than 'end_datetime'

            * 'sub_supply_source_id' is not necessary for this supply source

            * 'sub_supply_source_id' is required for this supply source

            * This deal_identifier already exists

            * This supply source does not support programmatic guaranteed deals

            * Unauthorized to set 'permissions.all_organizations' to true

            * Unauthorized to set this 'owner.type'
  /bulk_create/deals:
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: 'Bulk Create Deal '
      description: >-
        Bulk Create Deal 

        endpoint is /deals/v1.0/bulk_create/deals


        For more insight into deal creation (inside T1), read
        [here](https://mediamathsupport.force.com/s/article/Media-Module).  You
        may find it useful for exploring input values.
      operationId: Bulk-Create-Deal
      parameters:
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
          application/json:
            schema:
              type: object
        description: |-
          ```
          {
            "data": [
              {
                "updated_on": "2021-06-09T14:29:27+00:00",
                "created_on": "2021-04-12T13:22:35+00:00",
                "id": 422839,
                "name": "UIA_Inventory_Test",
                "description": null,
                "supply_source_id": 159,
                "sub_supply_source_id": null,
                "deal_identifier": "2718951",
                "start_datetime": "2021-04-12T13:22:15+00:00",
                "end_datetime": "2999-12-31T05:00:00+00:00",
                "price_type": "FIXED",
                "price_method": "CPM",
                "status": true,
                "bill_type": "EXCHANGE",
                "deal_type": "STANDARD",
                "impressions": null,
                "channels": [],
                "publisher_id": null,
                "organization_id": 100048,
                "permissions": {
                  "all_organizations": false,
                  "organization_ids": [
                    100048
                  ],
                  "agency_ids": [],
                  "advertiser_ids": []
                },
                "owner": {
                  "type": "ORGANIZATION",
                  "id": 100048
                },
                "price": {
                  "value": "0.0073",
                  "currency_code": "USD"
                },
                "entity_type": "deal",
                "deal_groups": [],
                "strategies_count": 0
              },
              {
                "updated_on": "2018-03-01T21:43:46+00:00",
                "created_on": "2017-04-10T06:31:51+00:00",
                "id": 177130,
                "name": "pmp test",
                "description": "",
                "supply_source_id": 218,
                "sub_supply_source_id": null,
                "deal_identifier": "MM2-8G3-K3D4",
                "start_datetime": "2017-04-10T07:31:28+00:00",
                "end_datetime": "2999-12-31T00:00:00+00:00",
                "price_type": "FLOOR",
                "price_method": "CPM",
                "status": true,
                "bill_type": "EXCHANGE",
                "deal_type": "STANDARD",
                "impressions": null,
                "channels": null,
                "publisher_id": null,
                "organization_id": 100048,
                "permissions": {
                  "all_organizations": false,
                  "organization_ids": [],
                  "agency_ids": [],
                  "advertiser_ids": [
                    176789
                  ]
                },
                "owner": {
                  "type": "ADVERTISER",
                  "id": 176789
                },
                "price": {
                  "value": "8.0000",
                  "currency_code": "USD"
                },
                "entity_type": "deal",
                "deal_groups": [],
                "strategies_count": 0
              }
            ]
          }
          ```
      responses:
        '200':
          description: |-
            ```
            {
                "data": {
                    "created_deals": [
                        {
                            "updated_on": "2021-07-08T13:57:26+00:00",
                            "created_on": "2021-07-08T13:57:26+00:00",
                            "id": 429599,
                            "name": "hello",
                            "description": "hello",
                            "supply_source_id": 246,
                            "sub_supply_source_id": null,
                            "deal_identifier": "hello",
                            "start_datetime": "2020-12-31T05:00:00+00:00",
                            "end_datetime": "2999-12-31T05:00:00+00:00",
                            "price_type": "FLOOR",
                            "price_method": "CPM",
                            "status": false,
                            "bill_type": "EXCHANGE",
                            "deal_type": "STANDARD",
                            "impressions": 22,
                            "channels": [
                                {
                                    "id": 1,
                                    "name": "Display",
                                    "pos": 1,
                                    "created_on": "2020-07-20T11:13:55.015407+00:00",
                                    "updated_on": "2020-07-20T11:13:55.015407+00:00"
                                },
                                {
                                    "id": 2,
                                    "name": "Mobile Web",
                                    "pos": 2,
                                    "created_on": "2020-07-20T11:13:55.015407+00:00",
                                    "updated_on": "2020-07-20T11:13:55.015407+00:00"
                                }
                            ],
                            "publisher_id": null,
                            "organization_id": 100315,
                            "permissions": {
                                "all_organizations": false,
                                "organization_ids": [
                                    100315
                                ],
                                "agency_ids": [],
                                "advertiser_ids": []
                            },
                            "owner": {
                                "type": "ORGANIZATION",
                                "id": 100315
                            },
                            "price": {
                                "value": "1.3000",
                                "currency_code": "EUR"
                            },
                            "entity_type": "deal",
                            "deal_groups": [],
                            "strategies_count": 0
                        }
                    ],
                    "invalid_deals": []
                },
                "meta": {
                    "status": "ok"
                }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            default: USD
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      publisher_id:
                        type: integer
                    required:
                      - name
                      - owner
                      - permissions
                      - price
                      - supply_source_id
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      bill_type:
                        type: string
                        enum:
                          - EXCHANGE
                          - NONE
                          - PUBLISHER
                        description: Who will be billed for the deal
                        default: EXCHANGE
                      created_on:
                        type: string
                        format: date-time
                      deal_identifier:
                        type: string
                        description: ID used within a bid request to reference the deal
                        maxLength: 255
                      deal_type:
                        type: string
                        enum:
                          - PG
                          - STANDARD
                        description: >-
                          deal_type is the type of deal. PG is for a
                          Programmatic Guaranteed deal, and STANDARD is the only
                          other value allowed
                        default: STANDARD
                      description:
                        type: string
                        description: Description of the deal
                        maxLength: 4095
                      end_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      entity_type:
                        type: string
                        enum:
                          - deal
                      id:
                        type: integer
                        description: ID of the deal
                      name:
                        type: string
                        description: Name of the deal
                        maxLength: 255
                      owner:
                        type: object
                        description: >-
                          Level of ownership for the deal (i.e. who can edit the
                          deal) and the id of the ownership entity. for example,
                          if the ownership level is set to ADVERTISER, anyone
                          with access to such advertiser can edit this deal.
                        properties:
                          id:
                            type: integer
                          type:
                            type: string
                            enum:
                              - ADVERTISER
                              - AGENCY
                              - INTERNAL
                              - ORGANIZATION
                      permissions:
                        type: object
                        description: >-
                          List of entities that are allowed to target this deal.
                          if a higher-level entity is included, then do not
                          include any lower-level entity that is part of the
                          included higher level entity. for example, if an
                          organization X is listed in this parameter, then
                          automatically all agencies and advertisers that are
                          part of the organization X will be included and
                          listing any such agencies and adevertisers part of
                          organization X will cause a validation error.
                        properties:
                          advertiser_ids:
                            type: array
                            items:
                              type: object
                          agency_ids:
                            type: array
                            items:
                              type: integer
                          all_organizations:
                            type: boolean
                          organization_ids:
                            type: array
                            items:
                              type: object
                      price:
                        type: object
                        properties:
                          currency_code:
                            type: string
                            description: 3-character ISO 1427 currency code
                            default: USD
                          value:
                            type: string
                            description: Maximum is $9,999,999.9999
                      price_method:
                        type: string
                        enum:
                          - CPM
                        description: CPM is the only acceptable value for now
                      price_type:
                        type: string
                        enum:
                          - FIXED
                          - FLOOR
                        description: >-
                          The deal is a "FLOOR" price deal (bids must be above
                          this floor, and will likely clear above this floor) or
                          "FIXED" price deal (bids must be at this price or
                          above, and will clear at the fixed price)
                      start_datetime:
                        type: string
                        description: >-
                          string / timestamp as full RFC 3339 date strings
                          including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or
                          YYYY-MM-DDTHH:MM:SS-##:##
                        format: date-time
                      status:
                        type: boolean
                        description: Whether the deal is active
                        default: true
                      sub_supply_source_id:
                        type: integer
                        description: >-
                          ID of the publisher if the supply_source_id is set to
                          83 (BidSwitch)
                        nullable: true
                      supply_source_id:
                        type: integer
                        description: Exchange providing the deal
                      updated_on:
                        type: string
                        format: date-time
                      publisher_id:
                        type: integer
                    required:
                      - name
                      - owner
                      - permissions
                      - price
                      - supply_source_id
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
  /bulk/deals:
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Bulk Create or Update Deal
      description: >-
        Bulk Create/Update Deal 

        endpoint is /deals/v1.0/bulk/deals

        To create a deal you need to populate all the fileds. To update you need
        to provide the "id" field and only the fields that you want to change. 

        For more insight into deal creation (inside T1), read
        [here](https://mediamathsupport.force.com/s/article/Media-Module).  You
        may find it useful for exploring input values.
      operationId: Bulk-Create-Deal
      parameters:
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
          application/json:
            schema:
              type: object
        description: |-
          ```
          {
              "deals": 
              [
                  {
                      "owner": {
                          "type": "ORGANIZATION",
                          "id": 100315
                      },
                      "price_method": "CPM",
                      "deal_identifier": "Test_3",
                      "name": "Test_3",
                      "status": true,
                      "start_datetime": "2022-06-01T05:00:00+00:00",
                      "end_datetime": "2022-06-17T05:00:00+00:00",
                      "channels": [1],
                      "supply_source_id": 246,
                      "permissions": {
                          "organization_ids": [100315],
                          "agency_ids" :[],
                          "advertiser_ids":[]
                      },
                      "price": {
                          "value": "1.3",
                          "currency_code": "EUR"
                      },
                      "deal_type": "PG",
                      "price_type": "FIXED"
                  }
              ]
          }
          ```

          for update:

          ```
          {
              "deals": 
              [
                  {
                      "id": 457001,
                      "name": "Test_3_update",
                      "status": false
                  }
              ]
          }
          ```
      responses:
        '200':
          description: |-
            ```
            {
                "data": {
                    "valid_deals": [
                        {
                            "updated_on": "2022-06-28T10:11:37+00:00",
                            "created_on": "2022-06-28T10:11:37+00:00",
                            "id": 457001,
                            "name": "Test_3",
                            "description": null,
                            "supply_source_id": 246,
                            "sub_supply_source_id": null,
                            "deal_identifier": "Test_3",
                            "start_datetime": "2022-06-01T05:00:00+00:00",
                            "end_datetime": "2022-06-17T05:00:00+00:00",
                            "price_type": "FIXED",
                            "price_method": "CPM",
                            "status": true,
                            "deal_type": "PG",
                            "impressions": null,
                            "channels": [
                                {
                                    "id": 1,
                                    "name": "Display",
                                    "pos": 1,
                                    "created_on": "2020-07-20T11:13:55.015407+00:00",
                                    "updated_on": "2020-07-20T11:13:55.015407+00:00"
                                }
                            ],
                            "publisher_id": null,
                            "strategies_count": 0,
                            "organization_id": 100315,
                            "effective_status": "creating",
                            "severity": null,
                            "api_version": "v2",
                            "permissions": {
                                "all_organizations": false,
                                "organization_ids": [
                                    100315
                                ],
                                "agency_ids": [],
                                "advertiser_ids": []
                            },
                            "owner": {
                                "type": "ORGANIZATION",
                                "id": 100315
                            },
                            "price": {
                                "value": "1.3000",
                                "currency_code": "EUR"
                            },
                            "entity_type": "deal",
                            "deal_groups": [],
                            "publisher": null
                        }
                    ],
                    "invalid_deals": []
                },
                "meta": {
                    "status": "ok"
                }
            }
            ```

            for update:
            ```{
                "data": {
                    "valid_deals": [
                        {
                            "updated_on": "2022-06-28T12:21:03+00:00",
                            "created_on": "2022-06-28T12:20:05+00:00",
                            "id": 457226,
                            "name": "Test_DanTest_1_update",
                            "description": null,
                            "supply_source_id": 246,
                            "sub_supply_source_id": null,
                            "deal_identifier": "Test_DanTest_1",
                            "start_datetime": "2022-06-01T05:00:00+00:00",
                            "end_datetime": "2022-06-17T05:00:00+00:00",
                            "price_type": "FIXED",
                            "price_method": "CPM",
                            "status": false,
                            "deal_type": "PG",
                            "impressions": null,
                            "channels": [
                                {
                                    "id": 1,
                                    "name": "Display",
                                    "pos": 1,
                                    "created_on": "2020-07-20T11:13:55.015407+00:00",
                                    "updated_on": "2020-07-20T11:13:55.015407+00:00"
                                }
                            ],
                            "publisher_id": null,
                            "strategies_count": 0,
                            "organization_id": 100315,
                            "effective_status": "creating",
                            "severity": null,
                            "api_version": "v2",
                            "permissions": {
                                "all_organizations": false,
                                "organization_ids": [
                                    100315
                                ],
                                "agency_ids": [],
                                "advertiser_ids": []
                            },
                            "owner": {
                                "type": "ORGANIZATION",
                                "id": 100315
                            },
                            "price": {
                                "value": "1.3000",
                                "currency_code": "EUR"
                            },
                            "entity_type": "deal",
                            "deal_groups": [],
                            "publisher": null
                        }
                    ],
                    "invalid_deals": []
                },
                "meta": {
                    "status": "ok"
                }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      valid_deals:
                        type: array
                        items:
                          type: object
                          properties:
                            updated_on:
                              type: string
                            created_on:
                              type: string
                            id:
                              type: integer
                            name:
                              type: string
                            description:
                              nullable: true
                            supply_source_id:
                              type: integer
                            sub_supply_source_id:
                              nullable: true
                            deal_identifier:
                              type: string
                            start_datetime:
                              type: string
                            end_datetime:
                              type: string
                            price_type:
                              type: string
                            price_method:
                              type: string
                            status:
                              type: boolean
                            deal_type:
                              type: string
                            impressions:
                              nullable: true
                            channels:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                  name:
                                    type: string
                                  pos:
                                    type: integer
                                  created_on:
                                    type: string
                                  updated_on:
                                    type: string
                            publisher_id:
                              nullable: true
                            strategies_count:
                              type: integer
                            organization_id:
                              type: integer
                            effective_status:
                              type: string
                            severity:
                              nullable: true
                            api_version:
                              type: string
                            permissions:
                              type: object
                              properties:
                                all_organizations:
                                  type: boolean
                                organization_ids:
                                  type: array
                                  items:
                                    type: integer
                                agency_ids:
                                  type: array
                                  items:
                                    type: object
                                advertiser_ids:
                                  type: array
                                  items:
                                    type: object
                            owner:
                              type: object
                              properties:
                                type:
                                  type: string
                                id:
                                  type: integer
                            price:
                              type: object
                              properties:
                                value:
                                  type: string
                                currency_code:
                                  type: string
                            entity_type:
                              type: string
                            deal_groups:
                              type: array
                              items:
                                type: object
                            publisher:
                              nullable: true
                      invalid_deals:
                        type: array
                        items:
                          type: object
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                x-examples:
                  example-1:
                    data:
                      valid_deals:
                        - updated_on: '2022-06-28T10:11:37+00:00'
                          created_on: '2022-06-28T10:11:37+00:00'
                          id: 457001
                          name: Test_3
                          description: null
                          supply_source_id: 246
                          sub_supply_source_id: null
                          deal_identifier: Test_3
                          start_datetime: '2022-06-01T05:00:00+00:00'
                          end_datetime: '2022-06-17T05:00:00+00:00'
                          price_type: FIXED
                          price_method: CPM
                          status: true
                          deal_type: PG
                          impressions: null
                          channels:
                            - id: 1
                              name: Display
                              pos: 1
                              created_on: '2020-07-20T11:13:55.015407+00:00'
                              updated_on: '2020-07-20T11:13:55.015407+00:00'
                          publisher_id: null
                          strategies_count: 0
                          organization_id: 100315
                          effective_status: creating
                          severity: null
                          api_version: v2
                          permissions:
                            all_organizations: false
                            organization_ids:
                              - 100315
                            agency_ids: []
                            advertiser_ids: []
                          owner:
                            type: ORGANIZATION
                            id: 100315
                          price:
                            value: '1.3000'
                            currency_code: EUR
                          entity_type: deal
                          deal_groups: []
                          publisher: null
                      invalid_deals: []
                    meta:
                      status: ok
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      valid_deals:
                        type: array
                        items:
                          type: object
                          properties:
                            updated_on:
                              type: string
                            created_on:
                              type: string
                            id:
                              type: integer
                            name:
                              type: string
                            description:
                              nullable: true
                            supply_source_id:
                              type: integer
                            sub_supply_source_id:
                              nullable: true
                            deal_identifier:
                              type: string
                            start_datetime:
                              type: string
                            end_datetime:
                              type: string
                            price_type:
                              type: string
                            price_method:
                              type: string
                            status:
                              type: boolean
                            deal_type:
                              type: string
                            impressions:
                              nullable: true
                            channels:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                  name:
                                    type: string
                                  pos:
                                    type: integer
                                  created_on:
                                    type: string
                                  updated_on:
                                    type: string
                            publisher_id:
                              nullable: true
                            strategies_count:
                              type: integer
                            organization_id:
                              type: integer
                            effective_status:
                              type: string
                            severity:
                              nullable: true
                            api_version:
                              type: string
                            permissions:
                              type: object
                              properties:
                                all_organizations:
                                  type: boolean
                                organization_ids:
                                  type: array
                                  items:
                                    type: integer
                                agency_ids:
                                  type: array
                                  items:
                                    type: object
                                advertiser_ids:
                                  type: array
                                  items:
                                    type: object
                            owner:
                              type: object
                              properties:
                                type:
                                  type: string
                                id:
                                  type: integer
                            price:
                              type: object
                              properties:
                                value:
                                  type: string
                                currency_code:
                                  type: string
                            entity_type:
                              type: string
                            deal_groups:
                              type: array
                              items:
                                type: object
                            publisher:
                              nullable: true
                      invalid_deals:
                        type: array
                        items:
                          type: object
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                x-examples:
                  example-1:
                    data:
                      valid_deals:
                        - updated_on: '2022-06-28T10:11:37+00:00'
                          created_on: '2022-06-28T10:11:37+00:00'
                          id: 457001
                          name: Test_3
                          description: null
                          supply_source_id: 246
                          sub_supply_source_id: null
                          deal_identifier: Test_3
                          start_datetime: '2022-06-01T05:00:00+00:00'
                          end_datetime: '2022-06-17T05:00:00+00:00'
                          price_type: FIXED
                          price_method: CPM
                          status: true
                          deal_type: PG
                          impressions: null
                          channels:
                            - id: 1
                              name: Display
                              pos: 1
                              created_on: '2020-07-20T11:13:55.015407+00:00'
                              updated_on: '2020-07-20T11:13:55.015407+00:00'
                          publisher_id: null
                          strategies_count: 0
                          organization_id: 100315
                          effective_status: creating
                          severity: null
                          api_version: v2
                          permissions:
                            all_organizations: false
                            organization_ids:
                              - 100315
                            agency_ids: []
                            advertiser_ids: []
                          owner:
                            type: ORGANIZATION
                            id: 100315
                          price:
                            value: '1.3000'
                            currency_code: EUR
                          entity_type: deal
                          deal_groups: []
                          publisher: null
                      invalid_deals: []
                    meta:
                      status: ok
            example-1:
              examples:
                response:
                  value:
                    data:
                      valid_deals:
                        - updated_on: '2022-06-28T10:11:37+00:00'
                          created_on: '2022-06-28T10:11:37+00:00'
                          id: 457001
                          name: Test_3
                          description: null
                          supply_source_id: 246
                          sub_supply_source_id: null
                          deal_identifier: Test_3
                          start_datetime: '2022-06-01T05:00:00+00:00'
                          end_datetime: '2022-06-17T05:00:00+00:00'
                          price_type: FIXED
                          price_method: CPM
                          status: true
                          deal_type: PG
                          impressions: null
                          channels:
                            - id: 1
                              name: Display
                              pos: 1
                              created_on: '2020-07-20T11:13:55.015407+00:00'
                              updated_on: '2020-07-20T11:13:55.015407+00:00'
                          publisher_id: null
                          strategies_count: 0
                          organization_id: 100315
                          effective_status: creating
                          severity: null
                          api_version: v2
                          permissions:
                            all_organizations: false
                            organization_ids:
                              - 100315
                            agency_ids: []
                            advertiser_ids: []
                          owner:
                            type: ORGANIZATION
                            id: 100315
                          price:
                            value: '1.3000'
                            currency_code: EUR
                          entity_type: deal
                          deal_groups: []
                          publisher: null
                      invalid_deals: []
                    meta:
                      status: ok
  /bulk_create/publishers:
    post:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: Bulk Create Publishers
      description: >-
        This allows you to add multiple publishers at one under the same
        organization id.



        Publishers


        Information about PMP-D from the T1 side can be found
        [here](https://mediamathsupport.force.com/s/article/Private-Marketplace-Direct-PMPD) 
        A video explainer on publisher management through the MediaMath app can
        be found at:
        https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806
      operationId: Bulk-Create-Publishers
      parameters:
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      requestBody:
        content:
          application/javascript:
            schema:
              type: object
              properties:
                organization_id:
                  type: integer
                names:
                  type: array
                  items:
                    type: string
          application/json:
            schema:
              type: object
              properties:
                organization_id:
                  type: integer
                names:
                  type: array
                  items:
                    type: string
        description: >-
          `{"organization_id":100315, "names" : ["my name is..","my other name
          is"]}`
      responses:
        '200':
          description: |-
            ```
            {
              "data": [
                {
                  "updated_on": "2021-07-08T14:08:06+00:00",
                  "created_on": "2021-07-08T14:08:06+00:00",
                  "id": 514,
                  "name": "my name is..",
                  "organization_id": 100315,
                  "last_touch_user_id": 4254,
                  "deleted_on": null
                },
                {
                  "updated_on": "2021-07-08T14:08:06+00:00",
                  "created_on": "2021-07-08T14:08:06+00:00",
                  "id": 515,
                  "name": "my other name is",
                  "organization_id": 100315,
                  "last_touch_user_id": 4254,
                  "deleted_on": null
                }
              ],
              "meta": {
                "status": "ok"
              }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      total_count:
                        type: integer
                      offset:
                        type: integer
                      count:
                        type: integer
                      status:
                        type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        organization_id:
                          type: integer
                        updated_on:
                          type: string
                        deleted_on:
                          nullable: true
                        name:
                          type: string
                        created_on:
                          type: string
                        last_touch_user_id:
                          type: integer
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      total_count:
                        type: integer
                      offset:
                        type: integer
                      count:
                        type: integer
                      status:
                        type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        organization_id:
                          type: integer
                        updated_on:
                          type: string
                        deleted_on:
                          nullable: true
                        name:
                          type: string
                        created_on:
                          type: string
                        last_touch_user_id:
                          type: integer
  /deals/{id}/strategy_deals:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List Deal Strategies
      description: >-
        List Deal Strategies


        `Example: /deals/v1.0/deals/380882/strategy_deals`


        you can use the 'with' parameter to get information about the strategies
        and campaigns using the deal.

        `eg:
        /deals/v1.0/deals/380882/strategy_deals?with=strategy,campaign,advertiser`
      operationId: List-Deal-Strategies
      parameters:
        - name: id
          in: path
          description: See below
          required: true
          schema:
            type: number
        - name: sort_by
          in: query
          description: sort_by
          schema:
            type: string
        - name: with
          in: query
          description: with
          schema:
            type: string
        - name: page_offset
          in: query
          description: The list starts from the specified page offset
          schema:
            type: number
        - name: page_limit
          in: query
          description: Maximum list page element count
          schema:
            type: number
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            {
              "data": [
                {
                  "id": 852908478,
                  "entity_type": "strategy_deal"
                },
                {
                  "id": 852911871,
                  "entity_type": "strategy_deal"
                },
                {
                  "id": 852908409,
                  "entity_type": "strategy_deal"
                },
                {
                  "id": 852908397,
                  "entity_type": "strategy_deal"
                }
              ],
              "meta": {
                "count": 4,
                "total_count": 4,
                "status": "ok",
                "offset": 0
              }
            }
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        entity_type:
                          type: string
                          enum:
                            - strategy_deal
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      total_count:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      offset:
                        type: integer
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        entity_type:
                          type: string
                          enum:
                            - strategy_deal
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      total_count:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      offset:
                        type: integer
  /deal_groups/{id}/strategy_deal_groups:
    get:
      tags:
        - Private Marketplace Exchange (PMP-E)
      summary: List Deal Group Strategies
      description: >
        List deal group strategies


        `Example: /deals/v1.0/deal_groups/980/strategy_deal_groups`


        you can use the 'with param to vide the details of the strategy's
        campaign or advertiser

        eg:
        `deals/v1.0/deal_groups/980/strategy_deal_groups?with=strategy,campaign,advertiser`
      operationId: List-deal-group-strategies
      parameters:
        - name: id
          in: path
          description: See below
          required: true
          schema:
            type: number
        - name: sort_by
          in: query
          description: sort_by
          schema:
            type: string
        - name: with
          in: query
          description: with
          schema:
            type: string
        - name: page_offset
          in: query
          description: The list starts from the specified page offset
          schema:
            type: number
        - name: page_limit
          in: query
          description: Maximum list page element count
          schema:
            type: number
        - $ref: '#/components/parameters/trait_jwtAuth_JWT'
      responses:
        '200':
          description: |-
            ```
            {
              "data": [
                {
                  "id": 19744,
                  "entity_type": "strategy_deal_group"
                },
                {
                  "id": 19496,
                  "entity_type": "strategy_deal_group"
                }
              ],
              "meta": {
                "count": 2,
                "total_count": 2,
                "status": "ok",
                "offset": 0
              }
            }
            ```
          content:
            application/javascript:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        entity_type:
                          type: string
                          enum:
                            - strategy_deal_group
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      total_count:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      offset:
                        type: integer
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        entity_type:
                          type: string
                          enum:
                            - strategy_deal_group
                  meta:
                    type: object
                    properties:
                      count:
                        type: integer
                      total_count:
                        type: integer
                      status:
                        type: string
                        enum:
                          - ok
                      offset:
                        type: integer
tags:
  - name: Private Marketplace Exchange (PMP-E)
    description: Private Marketplace Direct (PMP-E)
x-tests: {}
servers:
  - url: https://api.mediamath.com/deals/v1.0
components:
  parameters:
    trait_jsonResponse_Accept:
      name: Accept
      in: header
      description: Accept
      required: false
      schema:
        type: string
        default: application/vnd.mediamath.v1+json
    trait_postHeader_Content-Type:
      name: Content-Type
      in: header
      description: Content-Type
      required: true
      schema:
        type: string
        default: application/json
    trait_cookieAuth_Cookie:
      name: Cookie
      in: header
      description: Cookie
      required: true
      schema:
        type: string
        default: adama_session=<<sessionid>>
    trait_jwtAuth_JWT:
      name: Authorization
      in: header
      description: Authorization
      schema:
        type: string
        default: Bearer $TOKEN
    trait_limit_page_limit:
      name: page_limit
      in: query
      description: page_limit
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
    trait_limit_page_offset:
      name: page_offset
      in: query
      description: Index of the first element in the collection to retrieve
      required: false
      schema:
        type: integer
    trait_querying_q:
      name: q
      in: query
      description: q
      required: false
      schema:
        type: string
    trait_returnAdditionalEntityProperties_full:
      name: full
      in: query
      description: >-
        To include all properties for all entities returned by the API call, use
        `full=*:`
      required: false
      schema:
        type: string
        default: ''
    trait_returnAdditionalEntityProperties_with:
      name: with
      in: query
      description: with
      required: false
      schema:
        type: string
    trait_sorting_sort_by:
      name: sort_by
      in: query
      description: name
      required: false
      schema:
        type: string
  requestBodies:
    create-deal:
      content:
        application/javascript:
          schema:
            $ref: '#/components/schemas/create-deal'
        application/json:
          schema:
            $ref: '#/components/schemas/create-deal'
      description: _
  schemas:
    create-deal:
      type: object
      title: Deal Fields (create)
      properties:
        bill_type:
          type: string
          enum:
            - EXCHANGE
            - NONE
            - PUBLISHER
          description: Bill recipient when creating a deal
          x-examples:
            - EXCHANGE
        deal_identifier:
          type: string
          description: the identifier used within a bid request to reference the deal
          maxLength: 255
          default: EXCHANGE
        deal_type:
          type: string
          enum:
            - PG
            - STANDARD
          description: >-
            When creating deal type `PG`, `price_type` must be set to `FIXED`
            and valid `start_datetime` and `end_datetime` must be present. 
          default: STANDARD
        description:
          type: string
          description: the description of the deal
          maxLength: 4095
        end_datetime:
          type: string
          description: >-
            string / timestamp as full RFC 3339 date strings including timezone
            offsets: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS-##:##.  Default
            is current time.
          format: date-time
        name:
          type: string
          description: the name of the deal
          maxLength: 255
        owner:
          type: object
          description: >-
            level of ownership for the deal (i.e. who can edit the deal) and the
            id of the ownership entity. for example, if the ownership level is
            set to ADVERTISER, anyone with access to such advertiser can edit
            this deal.
          properties:
            id:
              type: integer
            type:
              type: string
              enum:
                - ADVERTISER
                - AGENCY
                - INTERNAL
                - ORGANIZATION
        permissions:
          type: object
          description: >-
            List of entities that are allowed to target this deal, which should
            be either the owner entity or sub-entities of the owner entity. if a
            higher-level entity is included, then do not include any lower-level
            entity that is part of the included higher level entity. for
            example, if an organization X is listed in this parameter, then
            automatically all agencies and advertisers that are part of the
            organization X will be included and listing any such agencies and
            advertisers part of organization X will cause a validation error.
          properties:
            advertiser_ids:
              type: array
              items:
                type: integer
            agency_ids:
              type: array
              items:
                type: integer
            all_organizations:
              type: boolean
            organization_ids:
              type: array
              items:
                type: integer
          required:
            - all_organizations
        price:
          type: object
          description: >-
            price floor or fixed value to use in auction along with the
            associated currency code
          properties:
            currency_code:
              type: string
              description: 3-character currency code
              minLength: 3
              maxLength: 3
              default: USD
            value:
              type: string
              description: $9,999,999.9999 maximum
        price_method:
          type: string
          enum:
            - CPM
          description: only CPM cost accrual is supported
          default: CPM
        price_type:
          type: string
          enum:
            - FIXED
            - FLOOR
          description: >-
            The deal is a "FLOOR" price deal (bids must be above this floor, and
            will likely clear above this floor) or "FIXED" price deal (bids must
            be at this price or above, and will clear at the fixed price)
          default: FLOOR
        start_datetime:
          type: string
          description: >-
            string / timestamp as full RFC 3339 date strings including timezone
            offsets: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS-##:##.  Default
            is current time.
          format: date-time
        status:
          type: boolean
          description: If the deal is active
          default: true
        sub_supply_source_id:
          type: integer
          description: >-
            the id of the publisher if the supply_source_id is set to 83
            (BidSwitch)
          nullable: true
        supply_source_id:
          type: integer
          description: the exchange providing the deal
      required:
        - name
        - owner
        - permissions
        - price
        - supply_source_id
    update-deal:
      type: object
      title: Deal Fields (update)
      properties:
        bill_type:
          type: string
          enum:
            - EXCHANGE
            - NONE
            - PUBLISHER
          description: Bill recipient when creating a deal
          default: EXCHANGE
        deal_identifier:
          type: string
          description: the identifier used within a bid request to reference the deal
          maxLength: 255
        deal_type:
          type: string
          enum:
            - PG
            - STANDARD
          description: >-
            When updating deal to type `PG`, `price_type` must be set to `FIXED`
            and valid `start_datetime` and `end_datetime` must be present. 
          default: STANDARD
        description:
          type: string
          description: the description of the deal
          maxLength: 4095
        end_datetime:
          type: string
          description: >-
            string / timestamp as full RFC 3339 date strings including timezone
            offsets: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS-##:##
          format: date-time
        name:
          type: string
          description: the name of the deal
          maxLength: 255
        permissions:
          type: object
          description: >-
            List of entities that are allowed to target this deal, which should
            be either the owner entity or sub-entities of the owner entity. if a
            higher-level entity is included, then do not include any lower-level
            entity that is part of the included higher level entity. for
            example, if an organization X is listed in this parameter, then
            automatically all agencies and advertisers that are part of the
            organization X will be included and listing any such agencies and
            advertisers part of organization X will cause a validation error.
          properties:
            advertiser_ids:
              type: array
              items:
                type: integer
            agency_ids:
              type: array
              items:
                type: integer
            all_organizations:
              type: boolean
            organization_ids:
              type: array
              items:
                type: integer
          required:
            - all_organizations
        price:
          type: object
          description: >-
            price floor or fixed value to use in auction along with the
            associated currency code
          properties:
            currency_code:
              type: string
              description: 3-letter currency code
              minLength: 3
              maxLength: 3
            value:
              type: string
              description: Maximum is $9,999,999.9999
        price_type:
          type: string
          enum:
            - FIXED
            - FLOOR
          description: >-
            The deal is a "FLOOR" price deal (bids must be above this floor, and
            will likely clear above this floor) or "FIXED" price deal (bids must
            be at this price or above, and will clear at the fixed price)
        start_datetime:
          type: string
          description: >-
            string / timestamp as full RFC 3339 date strings including timezone
            offsets: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS-##:##
          format: date-time
        status:
          type: boolean
          description: whether the deal is active
          default: true
        sub_supply_source_id:
          type: integer
          description: >-
            the id of the publisher if the supply_source_id is set to 83
            (BidSwitch)
          nullable: true
        supply_source_id:
          type: integer
          description: the exchange providing the deal
