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

# Create Slot

> Create a new slot.



## OpenAPI

````yaml /openapi.json post /public/v1/media-service/slots
openapi: 3.1.0
info:
  title: Topsort Endpoints v2 API Reference
  description: >
    In order for a storefront to be able to run auctions in Topsort and report
    auction-related events back to Topsort,

    both the `/v2/auctions` and `/v2/events` endpoints must be integrated.

    Below are the endpoint and model definitions for each.
  contact:
    email: wicha@topsort.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  x-logo:
    url: https://assets.topsort.com/Topsort_logo_icon_dark.svg
    backgroundColor: '#fff'
    altText: Topsort
  version: 2.0.0
servers:
  - url: https://api.topsort.com
    description: Base API URL
security: []
tags:
  - name: Auctions
    description: >-
      An auction determines which products should be promoted based on the
      vendors' bids.
  - name: Events
    description: >-
      Events are sent to Topsort as part of the attribution and reporting
      journey.
  - name: Toptimize
    description: >
      An out-of-the-box solution for prediction, ranking, retrieval, and other
      elements of ad selection.
  - name: Toppie API
    description: Toppie management API.
  - name: Campaign API
    description: Full-featured campaign management API for banners and sponsored listings.
  - name: Catalog API
    description: Products catalog management API.
  - name: Billing API
    description: Marketplace and Vendor Billing management API.
  - name: Reporting API
    description: Marketplace, Vendor, Campaign, and product reporting API.
  - name: Invitation API
    description: Vendor invitations management API.
  - name: User API
    description: User management API.
  - name: Webhooks API
    description: Webhooks API that allows event-driven automation.
  - name: Assets API
    description: Assets management API.
  - name: Segments Service
    description: Segments Service.
  - name: Forecasting Service
    description: Toptimize Forecasting Service.
  - name: Offsite Ads API
    description: Offsite Ads API that allows to manage offsite ads campaigns.
  - name: Media API
    description: Ad configuration API.
paths:
  /public/v1/media-service/slots:
    post:
      tags:
        - Media API
      summary: Create Slot
      description: Create a new slot.
      operationId: create_slot
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: Request
              oneOf:
                - $ref: >-
                    #/components/schemas/Advanced_APIs_CategoryOrSearchSlotCreateRequest
                - $ref: >-
                    #/components/schemas/Advanced_APIs_LandingPageSlotCreateRequestItem
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Advanced_APIs_AdConfigSlot'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Advanced_APIs_HTTPValidationError'
      security:
        - Advanced_APIs_HTTPBearer: []
components:
  schemas:
    Advanced_APIs_CategoryOrSearchSlotCreateRequest:
      properties:
        slotId:
          type: string
          minLength: 1
          pattern: ^[\w!\"#$%&'()*+,\-._/:;<>?@\[\]^\{\}~=\\]*$
          title: Slotid
          description: The unique external slot ID that represents the slot.
          examples:
            - sidebar-2
        dimensions:
          $ref: '#/components/schemas/Advanced_APIs_SlotCreateRequestDimensions'
          description: The dimensions of the slot per device type.
        position:
          type: string
          enum:
            - category
            - search
          title: Position
      type: object
      required:
        - slotId
        - dimensions
        - position
      title: CategoryOrSearchSlotCreateRequest
      description: Category or search slot create request.
    Advanced_APIs_LandingPageSlotCreateRequestItem:
      properties:
        slotId:
          type: string
          minLength: 1
          pattern: ^[\w!\"#$%&'()*+,\-._/:;<>?@\[\]^\{\}~=\\]*$
          title: Slotid
          description: The unique external slot ID that represents the slot.
          examples:
            - sidebar-2
        dimensions:
          $ref: '#/components/schemas/Advanced_APIs_SlotCreateRequestDimensions'
          description: The dimensions of the slot per device type.
        position:
          type: string
          const: landing
          title: Position
          default: landing
        page:
          $ref: '#/components/schemas/Advanced_APIs_SlotCreateRequestPageItem'
          description: >-
            The landing page. The page is created if the page with the given
            name does not exist.
      type: object
      required:
        - slotId
        - dimensions
        - page
      title: LandingPageSlotCreateRequestItem
      description: >-
        A list item describing the fields of the landing page slot to be
        created.
    Advanced_APIs_AdConfigSlot:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: The ID of the ad config slot.
        externalId:
          type: string
          minLength: 1
          title: Externalid
          description: The external ID provided by marketplaces.
        position:
          $ref: '#/components/schemas/Advanced_APIs_PositionType'
          description: The position of the ad config slot.
        page:
          description: >-
            The page that the ad config slot belongs to. Only 'landing' slots
            can belong to a page.
          oneOf:
            - $ref: '#/components/schemas/Advanced_APIs_AdConfigPage'
            - type: 'null'
        marketplaceId:
          type: string
          format: uuid
          title: Marketplaceid
          description: The ID of the marketplace that the ad config slot belongs to.
        dimensions:
          additionalProperties:
            $ref: '#/components/schemas/Advanced_APIs_AdConfigSlotDimension'
          propertyNames:
            $ref: '#/components/schemas/Advanced_APIs_MediaDeviceType'
          type: object
          title: Dimensions
          description: >-
            The slot dimensions. There can be at most one dimension for each
            device type.
          examples:
            - desktop:
                height: 20
                width: 20
              mobile:
                height: 10
                width: 10
        isActive:
          type: boolean
          title: Isactive
          description: >-
            Indicates whether the ad config slot is active. If false, the slot
            cannot be used in campaigns.
          default: true
      type: object
      required:
        - id
        - externalId
        - position
        - marketplaceId
        - dimensions
      title: AdConfigSlot
      description: The ad config slot model.
    Advanced_APIs_HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/Advanced_APIs_ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Advanced_APIs_SlotCreateRequestDimensions:
      properties:
        desktop:
          description: The dimension of the slot for desktop.
          oneOf:
            - $ref: '#/components/schemas/Advanced_APIs_AdConfigSlotDimension'
            - type: 'null'
        mobile:
          description: The dimension of the slot for mobile.
          oneOf:
            - $ref: '#/components/schemas/Advanced_APIs_AdConfigSlotDimension'
            - type: 'null'
      type: object
      title: SlotCreateRequestDimensions
      description: >-
        The dimensions of the slot per device type. At least one of them should
        be specified.
    Advanced_APIs_SlotCreateRequestPageItem:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
          description: The name of the landing page.
          examples:
            - Homepage
        url:
          type: string
          minLength: 1
          title: Url
          description: The url or deep link of the landing page.
          examples:
            - https://app.example.com/main
      type: object
      required:
        - name
        - url
      title: SlotCreateRequestPageItem
      description: An item describing the fields of the landing page to be created.
    Advanced_APIs_PositionType:
      type: string
      enum:
        - landing
        - category_search
        - category
        - search
      title: PositionType
    Advanced_APIs_AdConfigPage:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: The ID of the ad config page.
        name:
          type: string
          minLength: 1
          title: Name
          description: The name of the landing page.
          examples:
            - Homepage
        url:
          type: string
          minLength: 1
          title: Url
          description: The url or deep link of the landing page.
          examples:
            - https://app.example.com/main
        imageUrl:
          title: Imageurl
          description: The image url of the ad config page.
          oneOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
        marketplaceId:
          type: string
          format: uuid
          title: Marketplaceid
          description: The ID of the marketplace that the ad config page belongs to.
      type: object
      required:
        - id
        - name
        - url
        - marketplaceId
      title: AdConfigPage
      description: The ad config page model.
    Advanced_APIs_AdConfigSlotDimension:
      properties:
        width:
          type: integer
          exclusiveMinimum: 0
          title: Width
          description: The width of the dimension.
        height:
          type: integer
          exclusiveMinimum: 0
          title: Height
          description: The height of the dimension.
      type: object
      required:
        - width
        - height
      title: AdConfigSlotDimension
      description: The ad config dimension model.
    Advanced_APIs_ValidationError:
      properties:
        loc:
          items:
            oneOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Advanced_APIs_HTTPBearer:
      type: http
      description: >-
        A valid API key generated in Topsort's UI. Use the TSE API key if
        calling auctions or events API, otherwise use the TSC API key.
      scheme: bearer

````