> ## 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.

# Get Slots

> Get slots for a given marketplace.



## OpenAPI

````yaml /openapi.json get /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:
    get:
      tags:
        - Media API
      summary: Get Slots
      description: Get slots for a given marketplace.
      operationId: get_slots
      parameters:
        - name: position
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/Advanced_APIs_PositionType'
            description: The position of the slot.
          description: The position of the slot.
        - name: page_id
          in: query
          required: false
          schema:
            description: >-
              The ID of the page. If provided, the slots will be filtered by the
              page.
            oneOf:
              - type: string
                format: uuid
              - type: 'null'
          description: >-
            The ID of the page. If provided, the slots will be filtered by the
            page.
        - name: search
          in: query
          required: false
          schema:
            type: string
            description: Search query to be matched with page url, page name or slot id.
            default: ''
          description: Search query to be matched with page url, page name or slot id.
        - name: next_page
          in: query
          required: false
          schema:
            description: >-
              Pagination cursor as provided in an earlier response. If provided
              will fetch the next page of results.
            oneOf:
              - type: string
              - type: 'null'
          description: >-
            Pagination cursor as provided in an earlier response. If provided
            will fetch the next page of results.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            exclusiveMinimum: 0
            description: >-
              Limits the number of records to be returned. The limit can not
              surpass 50 and its default is 25.
            default: 25
          description: >-
            Limits the number of records to be returned. The limit can not
            surpass 50 and its default is 25.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Advanced_APIs_GetSlotsRequest'
              description: Request body containing the orderBy dimensions and directions.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Advanced_APIs_AdConfigSlotsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Advanced_APIs_HTTPValidationError'
      security:
        - Advanced_APIs_HTTPBearer: []
components:
  schemas:
    Advanced_APIs_PositionType:
      type: string
      enum:
        - landing
        - category_search
        - category
        - search
      title: PositionType
    Advanced_APIs_GetSlotsRequest:
      properties:
        orderBy:
          items:
            $ref: '#/components/schemas/Advanced_APIs_SlotOrderByClause'
          type: array
          title: Orderby
          description: The fields to sort the results by.
      type: object
      required:
        - orderBy
      title: GetSlotsRequest
    Advanced_APIs_AdConfigSlotsResponse:
      properties:
        hasMore:
          type: boolean
          title: Hasmore
          description: >-
            Flag that indicates whether more results are available. `true`
            indicates there is a next page of results. `false` indicates  this
            response contains the last page of results.
        nextPage:
          title: Nextpage
          description: >-
            Pagination cursor. Provide this value as a `next_page` query
            parameter in a new request to retrieve the next page of results.
          examples:
            - SSBzb2xlbW5seSBzd2VhciB0aGF0IEkgYW0gdXAgdG8gbm8gZ29vZAo=
          oneOf:
            - type: string
              minLength: 1
            - type: 'null'
        slots:
          items:
            $ref: '#/components/schemas/Advanced_APIs_AdConfigSlot'
          type: array
          title: Slots
      type: object
      required:
        - hasMore
        - slots
      title: AdConfigSlotsResponse
    Advanced_APIs_HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/Advanced_APIs_ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Advanced_APIs_SlotOrderByClause:
      properties:
        dimension:
          $ref: '#/components/schemas/Advanced_APIs_SlotSortDimension'
        direction:
          $ref: '#/components/schemas/Advanced_APIs_SlotSortDirection'
      type: object
      required:
        - dimension
        - direction
      title: SlotOrderByClause
      description: >-
        The order by clause indicates a dimension and a direction to order by
        the Campaigns response.
    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_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
    Advanced_APIs_SlotSortDimension:
      type: string
      enum:
        - page_url
        - page_name
        - slot_external_id
        - slot_id
      title: SlotSortDimension
      description: The dimension to order by.
    Advanced_APIs_SlotSortDirection:
      type: string
      enum:
        - asc
        - desc
      title: SlotSortDirection
      description: The direction to order by.
    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.
  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

````