> ## Documentation Index
> Fetch the complete documentation index at: https://developers.criteo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# /preview/product-sets

> Create a new product set



## OpenAPI

````yaml https://api.criteo.com/preview/marketingsolutions/open-api-specifications.json post /preview/product-sets
openapi: 3.0.1
info:
  title: Criteo API
  description: Criteo API - MarketingSolutions
  version: Preview
servers:
  - url: https://api.criteo.com
security:
  - oauth: []
tags:
  - name: Advertiser
  - name: Analytics
  - name: Audience
  - name: Campaign
  - name: Catalog
  - name: Creative
  - name: Gateway
  - name: OnSiteRecommendation
  - name: Reco
paths:
  /preview/product-sets:
    post:
      tags:
        - Reco
      summary: /preview/product-sets
      description: Create a new product set
      operationId: CreateProductSet
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValueResourceInputOfCreateProductSetRequest'
        required: true
        x-bodyName: request
      responses:
        '200':
          description: Product set created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOutcomeOfProductSet'
      security:
        - oauth:
            - MarketingSolutions_Reco_Manage
components:
  schemas:
    ValueResourceInputOfCreateProductSetRequest:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ValueResourceOfCreateProductSetRequest'
      description: "Represents an API request message containing the usual valueResource data field,\r\ni.e. data is not an entity (no id). This can be used for association objects."
      example:
        data:
          type: CreateProductSetRequest
          attributes:
            datasetId: '0'
            name: My Product Set
            isDraft: true
            rules:
              - operator: IsIn
                field: Brand
                values:
                  - MyBrand
    ResourceOutcomeOfProductSet:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ResourceOfProductSet'
        errors:
          uniqueItems: false
          type: array
          items:
            $ref: '#/components/schemas/CommonProblem'
          nullable: true
          readOnly: true
        warnings:
          uniqueItems: false
          type: array
          items:
            $ref: '#/components/schemas/CommonProblem'
          nullable: true
          readOnly: true
      description: >-
        A class implementing the response of the Criteo API as described in API
        Guild Guidelines with a single entity as body
    ValueResourceOfCreateProductSetRequest:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/CreateProductSetRequest'
        type:
          type: string
      description: A class that represents a ValueType in a guild compliant way
    ResourceOfProductSet:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/ProductSet'
        id:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
      description: A class that represents an entity in a guild compliant way
      nullable: true
    CommonProblem:
      type: object
      properties:
        code:
          type: string
          description: A machine-readable error code, expressed as a string value.
          nullable: true
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem
          nullable: true
        instance:
          type: string
          description: A URI that identifies the specific occurrence of the problem.
          nullable: true
        source:
          type: object
          additionalProperties:
            type: string
          description: >-
            A machine-readable structure to reference to the exact location(s)
            causing the error(s)
          nullable: true
        stackTrace:
          type: string
          nullable: true
        title:
          type: string
          description: A short human-readable description of the problem type
          nullable: true
        traceId:
          type: string
          description: The request correlation ID this problem comes from.
          nullable: true
        traceIdentifier:
          type: string
          description: >-
            The request correlation ID this problem comes from. (deprecated, use
            traceId instead)
          nullable: true
        type:
          enum:
            - unknown
            - access-control
            - authentication
            - authorization
            - availability
            - deprecation
            - quota
            - validation
          type: string
          description: The problem's category.
          nullable: true
      description: Common problem object.
    CreateProductSetRequest:
      type: object
      properties:
        datasetId:
          type: string
        isDraft:
          type: boolean
        name:
          type: string
        rules:
          uniqueItems: false
          type: array
          items:
            $ref: '#/components/schemas/ProductSetRule'
      description: Entity to create a product set
    ProductSet:
      required:
        - clientType
        - creationDate
        - datasetId
        - keepVariantProducts
        - minimumNumberOfProducts
        - name
        - numberOfProducts
        - rules
        - status
      type: object
      properties:
        clientType:
          enum:
            - Unknown
            - CGrowth
            - CMax
          type: string
          description: The client type of the product set
        creationDate:
          type: string
          description: "The creation date of the product set (UTC time in ISO8601 format). Example: \"02/25/2022 14:51:26\".\r\nCan be null if the value isn't available."
        datasetId:
          type: string
          description: The dataset to which the product set belong
        id:
          type: string
          nullable: true
        isFallbackAllowed:
          type: boolean
        keepVariantProducts:
          type: boolean
        minimumNumberOfProducts:
          type: integer
          description: "Minimum amount of products that should match the product set to consider it valid.\r\nGreater or equal than one."
          format: int32
        name:
          type: string
          description: The name of the product set
        numberOfProducts:
          type: integer
          description: "The number of products matching the product set.\r\nCan be null for newly created product set."
          format: int32
          nullable: true
        rules:
          type: array
          items:
            $ref: '#/components/schemas/ProductSetRule'
          description: The rules identifying the product belonging to the set
        status:
          enum:
            - Unknown
            - Draft
            - Pending
            - Valid
            - Invalid
            - Deleted
          type: string
          description: The status of the product set
      description: Encapsulate a group of product
      nullable: true
    ProductSetRule:
      type: object
      properties:
        field:
          enum:
            - OBSOLETE_Extradata
            - Category1
            - Category2
            - Category3
            - ExternalItemId
            - SalePrice
            - Brand
            - CustomLabel0
            - CustomLabel1
            - CustomLabel2
            - CustomLabel3
            - CustomLabel4
          type: string
          description: The field on which we want to apply the rule
          nullable: true
        operator:
          enum:
            - IsIn
            - IsNotIn
            - Between
            - NotBetween
            - LessThan
            - GreaterThan
          type: string
          description: The operator used with the field
          nullable: true
        values:
          uniqueItems: false
          type: array
          items:
            type: string
          description: The values on which we want to apply the rule
          nullable: true
      description: Encapsulate a product rule
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.criteo.com/oauth2/token
          scopes: {}
        authorizationCode:
          authorizationUrl: https://api.criteo.com/oauth2
          tokenUrl: https://api.criteo.com/oauth2/token
          scopes: {}

````