openapi: 3.0.3
info:
  title: Markets API
  version: 1.0.0
  description: REST API specification for public endpoints used by the Markets service.
servers:
  - url: https://gamma-api.polymarket.com
    description: Polymarket Gamma API Production Server
tags:
  - name: Gamma Status
    description: Gamma API status and health check
  - name: Sports
    description: Sports-related endpoints including teams and game data
  - name: Tags
    description: Tag management and related tag operations
  - name: Events
    description: Event management and event-related operations
  - name: Markets
    description: Market data and market-related operations
  - name: Comments
    description: Comment system and user interactions
  - name: Series
    description: Series management and related operations
  - name: Profiles
    description: User profile management
  - name: Search
    description: Search functionality across different entity types
paths:
  /status:
    get:
      tags:
        - Gamma Status
      summary: Gamma API Health check
      operationId: getGammaStatus
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: OK
  /teams:
    get:
      tags:
        - Sports
      summary: List teams
      operationId: listTeams
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: league
          in: query
          schema:
            type: array
            items:
              type: string
        - name: name
          in: query
          schema:
            type: array
            items:
              type: string
        - name: abbreviation
          in: query
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: List of teams
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Team'
  /teams/{id}:
    get:
      tags:
        - Sports
      x-excluded: true
      summary: Get team by id
      operationId: getTeam
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Team'
        '404':
          description: Not found
  /tags:
    get:
      tags:
        - Tags
      summary: List tags
      operationId: listTags
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: include_template
          in: query
          schema:
            type: boolean
        - name: is_carousel
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: List of tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
  /tags/{id}:
    get:
      tags:
        - Tags
      summary: Get tag by id
      operationId: getTag
      parameters:
        - $ref: '#/components/parameters/pathId'
        - name: include_template
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Tag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
        '404':
          description: Not found
  /tags/slug/{slug}:
    get:
      tags:
        - Tags
      summary: Get tag by slug
      operationId: getTagBySlug
      parameters:
        - $ref: '#/components/parameters/pathSlug'
        - name: include_template
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Tag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
        '404':
          description: Not found
  /tags/{id}/related-tags:
    get:
      tags:
        - Tags
      summary: Get related tags (relationships) by tag id
      operationId: getRelatedTagsById
      parameters:
        - $ref: '#/components/parameters/pathId'
        - name: omit_empty
          in: query
          schema:
            type: boolean
        - name: status
          in: query
          schema:
            type: string
            enum:
              - active
              - closed
              - all
      responses:
        '200':
          description: Related tag relationships
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RelatedTag'
  /tags/slug/{slug}/related-tags:
    get:
      tags:
        - Tags
      summary: Get related tags (relationships) by tag slug
      operationId: getRelatedTagsBySlug
      parameters:
        - $ref: '#/components/parameters/pathSlug'
        - name: omit_empty
          in: query
          schema:
            type: boolean
        - name: status
          in: query
          schema:
            type: string
            enum:
              - active
              - closed
              - all
      responses:
        '200':
          description: Related tag relationships
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RelatedTag'
  /tags/{id}/related-tags/tags:
    get:
      tags:
        - Tags
      summary: Get tags related to a tag id
      operationId: getTagsRelatedToATagById
      parameters:
        - $ref: '#/components/parameters/pathId'
        - name: omit_empty
          in: query
          schema:
            type: boolean
        - name: status
          in: query
          schema:
            type: string
            enum:
              - active
              - closed
              - all
      responses:
        '200':
          description: Related tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
  /tags/slug/{slug}/related-tags/tags:
    get:
      tags:
        - Tags
      summary: Get tags related to a tag slug
      operationId: getTagsRelatedToATagBySlug
      parameters:
        - $ref: '#/components/parameters/pathSlug'
        - name: omit_empty
          in: query
          schema:
            type: boolean
        - name: status
          in: query
          schema:
            type: string
            enum:
              - active
              - closed
              - all
      responses:
        '200':
          description: Related tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
  /events:
    get:
      tags:
        - Events
      summary: List events
      operationId: listEvents
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: tag_id
          in: query
          schema:
            type: integer
        - name: exclude_tag_id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: slug
          in: query
          schema:
            type: array
            items:
              type: string
        - name: tag_slug
          in: query
          schema:
            type: string
        - name: related_tags
          in: query
          schema:
            type: boolean
        - name: active
          in: query
          schema:
            type: boolean
        - name: archived
          in: query
          schema:
            type: boolean
        - name: featured
          in: query
          schema:
            type: boolean
        - name: cyom
          in: query
          schema:
            type: boolean
        - name: include_chat
          in: query
          schema:
            type: boolean
        - name: include_template
          in: query
          schema:
            type: boolean
        - name: recurrence
          in: query
          schema:
            type: string
        - name: closed
          in: query
          schema:
            type: boolean
        - name: liquidity_min
          in: query
          schema:
            type: number
        - name: liquidity_max
          in: query
          schema:
            type: number
        - name: volume_min
          in: query
          schema:
            type: number
        - name: volume_max
          in: query
          schema:
            type: number
        - name: start_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: start_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_max
          in: query
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: List of events
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Event'
  /events/pagination:
    get:
      x-excluded: true
      tags:
        - Events
      summary: List events (paginated)
      operationId: listEventsPagination
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: include_chat
          in: query
          schema:
            type: boolean
        - name: include_template
          in: query
          schema:
            type: boolean
        - name: recurrence
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Events with pagination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsPagination'
  /events/results:
    get:
      tags:
        - Events
        - Sports
      x-excluded: true
      summary: List sport events results
      operationId: listSportEventsResults
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
      responses:
        '200':
          description: List of events with results
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Event'
  /events/{id}:
    get:
      tags:
        - Events
      summary: Get event by id
      operationId: getEvent
      parameters:
        - $ref: '#/components/parameters/pathId'
        - name: include_chat
          in: query
          schema:
            type: boolean
        - name: include_template
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '404':
          description: Not found
  /events/{id}/tweet-count:
    get:
      tags:
        - Events
      x-excluded: true
      summary: Get event tweet count
      operationId: getEventTweetCount
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Tweet count
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTweetCount'
        '404':
          description: Not found
  /events/{id}/comments/count:
    get:
      tags:
        - Events
        - Comments
      x-excluded: true
      summary: Get event comment count
      operationId: getEventCommentsCount
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Comment count
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Count'
        '404':
          description: Not found
  /events/{id}/tags:
    get:
      tags:
        - Events
        - Tags
      summary: Get event tags
      operationId: getEventTags
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Tags attached to the event
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
        '404':
          description: Not found
  /events/slug/{slug}:
    get:
      tags:
        - Events
      summary: Get event by slug
      operationId: getEventBySlug
      parameters:
        - $ref: '#/components/parameters/pathSlug'
        - name: include_chat
          in: query
          schema:
            type: boolean
        - name: include_template
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '404':
          description: Not found
  /events/creators:
    get:
      tags:
        - Events
      x-excluded: true
      summary: List event creators
      operationId: listEventCreators
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: creator_name
          in: query
          schema:
            type: string
        - name: creator_handle
          in: query
          schema:
            type: string
      responses:
        '200':
          description: List of event creators
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventCreator'
  /events/creators/{id}:
    get:
      tags:
        - Events
      x-excluded: true
      summary: Get event creator by id
      operationId: getEventCreator
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Event creator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventCreator'
        '404':
          description: Not found
  /markets:
    get:
      tags:
        - Markets
      summary: List markets
      operationId: listMarkets
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: slug
          in: query
          schema:
            type: array
            items:
              type: string
        - name: clob_token_ids
          in: query
          schema:
            type: array
            items:
              type: string
        - name: condition_ids
          in: query
          schema:
            type: array
            items:
              type: string
        - name: market_maker_address
          in: query
          schema:
            type: array
            items:
              type: string
        - name: liquidity_num_min
          in: query
          schema:
            type: number
        - name: liquidity_num_max
          in: query
          schema:
            type: number
        - name: volume_num_min
          in: query
          schema:
            type: number
        - name: volume_num_max
          in: query
          schema:
            type: number
        - name: start_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: start_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: tag_id
          in: query
          schema:
            type: integer
        - name: related_tags
          in: query
          schema:
            type: boolean
        - name: cyom
          in: query
          schema:
            type: boolean
        - name: uma_resolution_status
          in: query
          schema:
            type: string
        - name: game_id
          in: query
          schema:
            type: string
        - name: sports_market_types
          in: query
          schema:
            type: array
            items:
              type: string
        - name: rewards_min_size
          in: query
          schema:
            type: number
        - name: question_ids
          in: query
          schema:
            type: array
            items:
              type: string
        - name: include_tag
          in: query
          schema:
            type: boolean
        - name: closed
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: List of markets
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Market'
  /markets/{id}:
    get:
      tags:
        - Markets
      summary: Get market by id
      operationId: getMarket
      parameters:
        - $ref: '#/components/parameters/pathId'
        - name: include_tag
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Market
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Market'
        '404':
          description: Not found
  /markets/{id}/description:
    get:
      tags:
        - Markets
      x-excluded: true
      summary: Get market description by id
      operationId: getMarketDescription
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Market description
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketDescription'
        '404':
          description: Not found
  /markets/{id}/tags:
    get:
      tags:
        - Markets
        - Tags
      summary: Get market tags by id
      operationId: getMarketTags
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Tags attached to the market
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
        '404':
          description: Not found
  /markets/slug/{slug}:
    get:
      tags:
        - Markets
      summary: Get market by slug
      operationId: getMarketBySlug
      parameters:
        - $ref: '#/components/parameters/pathSlug'
        - name: include_tag
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Market
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Market'
        '404':
          description: Not found
  /markets/information:
    post:
      tags:
        - Markets
      x-excluded: true
      summary: Query markets by information filters
      operationId: getMarketsInformation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarketsInformationBody'
      responses:
        '200':
          description: Filtered markets
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Market'
        '422':
          description: Validation error
  /markets/abridged:
    post:
      tags:
        - Markets
      x-excluded: true
      summary: Query abridged markets by information filters
      operationId: getAbridgedMarkets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarketsInformationBody'
      responses:
        '200':
          description: Filtered abridged markets
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Market'
        '422':
          description: Validation error
  /markets/keyset:
    get:
      tags:
        - Markets
      summary: List markets (keyset pagination)
      description: >
        Returns markets using cursor-based (keyset) pagination for stable,
        efficient paging through large result sets. Use `next_cursor` from each
        response as `after_cursor` in the next request. The `offset` parameter
        is explicitly rejected; use `after_cursor` instead.
      operationId: listMarketsKeyset
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return (max 100)
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: order
          in: query
          description: >-
            Comma-separated list of JSON field names to order by, e.g.
            volume_num,liquidity_num
          schema:
            type: string
        - name: ascending
          in: query
          description: Sort direction. Only used when order is set.
          schema:
            type: boolean
            default: true
        - name: after_cursor
          in: query
          description: Opaque cursor token from a previous response's next_cursor
          schema:
            type: string
        - name: offset
          in: query
          description: Not allowed. Returns 422 if provided.
          schema:
            type: integer
        - name: id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: slug
          in: query
          schema:
            type: array
            items:
              type: string
        - name: closed
          in: query
          schema:
            type: boolean
            default: false
        - name: decimalized
          in: query
          schema:
            type: boolean
        - name: clob_token_ids
          in: query
          schema:
            type: array
            items:
              type: string
        - name: condition_ids
          in: query
          schema:
            type: array
            items:
              type: string
        - name: question_ids
          in: query
          schema:
            type: array
            items:
              type: string
        - name: market_maker_address
          in: query
          schema:
            type: array
            items:
              type: string
        - name: liquidity_num_min
          in: query
          schema:
            type: number
        - name: liquidity_num_max
          in: query
          schema:
            type: number
        - name: volume_num_min
          in: query
          schema:
            type: number
        - name: volume_num_max
          in: query
          schema:
            type: number
        - name: start_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: start_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: tag_id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: related_tags
          in: query
          schema:
            type: boolean
        - name: tag_match
          in: query
          schema:
            type: string
        - name: cyom
          in: query
          schema:
            type: boolean
        - name: rfq_enabled
          in: query
          schema:
            type: boolean
        - name: uma_resolution_status
          in: query
          schema:
            type: string
        - name: game_id
          in: query
          schema:
            type: string
        - name: sports_market_types
          in: query
          schema:
            type: array
            items:
              type: string
        - name: include_tag
          in: query
          description: When true, includes Tags relation on each market
          schema:
            type: boolean
        - name: locale
          in: query
          schema:
            type: string
      responses:
        '200':
          description: >
            Paginated list of markets. Includes Events and Events.Series
            relations. Tags included only when include_tag=true. Nested
            clob_rewards and fee_schedule are populated on each market.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeysetMarketsResponse'
        '422':
          description: >
            Validation error. Returned when offset is provided, cursor is
            invalid, order fields are not valid, or other filter validation
            fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal server error (DB failures, cursor encode failures)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
        '503':
          description: Service unavailable when keyset pagination is not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
  /events/keyset:
    get:
      tags:
        - Events
      summary: List events (keyset pagination)
      description: >
        Returns events using cursor-based (keyset) pagination for stable,
        efficient paging through large result sets. Use `next_cursor` from each
        response as `after_cursor` in the next request. The `offset` parameter
        is explicitly rejected; use `after_cursor` instead.
      operationId: listEventsKeyset
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return (max 500)
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 20
        - name: order
          in: query
          description: Comma-separated list of JSON field names to order by
          schema:
            type: string
        - name: ascending
          in: query
          description: Sort direction. Only used when order is set.
          schema:
            type: boolean
            default: true
        - name: after_cursor
          in: query
          description: Opaque cursor token from a previous response's next_cursor
          schema:
            type: string
        - name: offset
          in: query
          description: Not allowed. Returns 422 if provided.
          schema:
            type: integer
        - name: id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: slug
          in: query
          schema:
            type: array
            items:
              type: string
        - name: closed
          in: query
          schema:
            type: boolean
        - name: live
          in: query
          schema:
            type: boolean
        - name: featured
          in: query
          schema:
            type: boolean
        - name: cyom
          in: query
          schema:
            type: boolean
        - name: title_search
          in: query
          schema:
            type: string
        - name: liquidity_min
          in: query
          schema:
            type: number
        - name: liquidity_max
          in: query
          schema:
            type: number
        - name: volume_min
          in: query
          schema:
            type: number
        - name: volume_max
          in: query
          schema:
            type: number
        - name: start_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: start_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_min
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date_max
          in: query
          schema:
            type: string
            format: date-time
        - name: start_time_min
          in: query
          schema:
            type: string
            format: date-time
        - name: start_time_max
          in: query
          schema:
            type: string
            format: date-time
        - name: tag_id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: tag_slug
          in: query
          schema:
            type: string
        - name: exclude_tag_id
          in: query
          description: Tag IDs to exclude. Cannot overlap with tag_id.
          schema:
            type: array
            items:
              type: integer
        - name: related_tags
          in: query
          schema:
            type: boolean
        - name: tag_match
          in: query
          schema:
            type: string
        - name: series_id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: game_id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: event_date
          in: query
          schema:
            type: string
            format: date-time
        - name: event_week
          in: query
          schema:
            type: integer
        - name: featured_order
          in: query
          schema:
            type: boolean
        - name: recurrence
          in: query
          schema:
            type: string
        - name: created_by
          in: query
          schema:
            type: array
            items:
              type: string
        - name: parent_event_id
          in: query
          schema:
            type: integer
        - name: include_children
          in: query
          schema:
            type: boolean
        - name: partner_slug
          in: query
          description: When set, external_partners are attached to matching events
          schema:
            type: string
        - name: include_chat
          in: query
          description: When true, includes Chats and Series.Chats relations
          schema:
            type: boolean
        - name: include_template
          in: query
          description: When true, includes Templates relation
          schema:
            type: boolean
        - name: include_best_lines
          in: query
          description: When true, includes BestLines relation
          schema:
            type: boolean
        - name: locale
          in: query
          schema:
            type: string
      responses:
        '200':
          description: >
            Paginated list of events. Always includes Series, Tags, Markets, and
            EventCreators relations. Chats/Series.Chats, Templates, and
            BestLines are optional via their respective include_ flags. Nested
            markets include clob_rewards and fee_schedule. Teams are enriched
            automatically. external_partners attached only when partner_slug is
            set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeysetEventsResponse'
        '422':
          description: >
            Validation error. Returned when offset is provided, cursor is
            invalid, order fields are not valid, tag_id overlaps with
            exclude_tag_id, invalid recurrence, or other filter validation
            fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal server error (DB failures, cursor encode failures)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
        '503':
          description: Service unavailable when keyset pagination is not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
  /series:
    get:
      tags:
        - Series
      summary: List series
      operationId: listSeries
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: slug
          in: query
          schema:
            type: array
            items:
              type: string
        - name: categories_ids
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: categories_labels
          in: query
          schema:
            type: array
            items:
              type: string
        - name: closed
          in: query
          schema:
            type: boolean
        - name: include_chat
          in: query
          schema:
            type: boolean
        - name: recurrence
          in: query
          schema:
            type: string
        - name: exclude_events
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: List of series
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Series'
  /series/{id}:
    get:
      tags:
        - Series
      summary: Get series by id
      operationId: getSeries
      parameters:
        - $ref: '#/components/parameters/pathId'
        - name: include_chat
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Series
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Series'
        '404':
          description: Not found
  /series/{id}/comments/count:
    get:
      tags:
        - Series
        - Comments
      x-excluded: true
      summary: Get series comment count
      operationId: getSeriesCommentsCount
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Comment count
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Count'
        '404':
          description: Not found
  /series-summary/{id}:
    get:
      tags:
        - Series
      x-excluded: true
      summary: Get series summary by id
      operationId: getSeriesSummaryById
      parameters:
        - $ref: '#/components/parameters/pathId'
      responses:
        '200':
          description: Series summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeriesSummary'
        '404':
          description: Not found
  /series-summary/slug/{slug}:
    get:
      tags:
        - Series
      x-excluded: true
      summary: Get series summary by slug
      operationId: getSeriesSummaryBySlug
      parameters:
        - $ref: '#/components/parameters/pathSlug'
      responses:
        '200':
          description: Series summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeriesSummary'
        '404':
          description: Not found
  /comments:
    get:
      tags:
        - Comments
      summary: List comments
      operationId: listComments
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
        - name: parent_entity_type
          in: query
          schema:
            type: string
            enum:
              - Event
              - Series
              - market
        - name: parent_entity_id
          in: query
          schema:
            type: integer
        - name: get_positions
          in: query
          schema:
            type: boolean
        - name: holders_only
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: List of comments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Comment'
  /comments/{id}:
    get:
      tags:
        - Comments
      summary: Get comments by comment id
      operationId: getCommentsById
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
        - name: get_positions
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Comments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Comment'
  /comments/user_address/{user_address}:
    get:
      tags:
        - Comments
        - Profiles
      summary: Get comments by user address
      operationId: getCommentsByUserAddress
      parameters:
        - name: user_address
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/ascending'
      responses:
        '200':
          description: Comments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Comment'
  /public-profile:
    get:
      tags:
        - Profiles
      summary: Get public profile by wallet address
      operationId: getPublicProfile
      parameters:
        - name: address
          in: query
          required: true
          description: The wallet address (proxy wallet or user address)
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b'
      responses:
        '200':
          description: Public profile information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProfileResponse'
        '400':
          description: Invalid address format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProfileError'
              example:
                type: validation error
                error: invalid address
        '404':
          description: Profile not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProfileError'
              example:
                type: not found error
                error: profile not found
  /profiles/user_address/{user_address}:
    get:
      tags:
        - Profiles
      x-excluded: true
      summary: Get public profile by user address
      operationId: getPublicProfileByUserAddress
      parameters:
        - name: user_address
          in: path
          required: true
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
      responses:
        '200':
          description: Profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '404':
          description: Not found
  /sports:
    get:
      tags:
        - Sports
      summary: Get sports metadata information
      operationId: getSportsMetadata
      responses:
        '200':
          description: >-
            List of sports metadata objects containing sport configuration
            details, visual assets, and related identifiers
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SportsMetadata'
  /sports/market-types:
    get:
      tags:
        - Sports
      summary: Get valid sports market types
      operationId: getSportsMarketTypes
      responses:
        '200':
          description: List of valid sports market types
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SportsMarketTypesResponse'
  /public-search:
    get:
      tags:
        - Search
      summary: Search markets, events, and profiles
      operationId: publicSearch
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
        - name: cache
          in: query
          schema:
            type: boolean
        - name: events_status
          in: query
          schema:
            type: string
        - name: limit_per_type
          in: query
          schema:
            type: integer
        - name: page
          in: query
          schema:
            type: integer
        - name: events_tag
          in: query
          schema:
            type: array
            items:
              type: string
        - name: keep_closed_markets
          in: query
          schema:
            type: integer
        - name: sort
          in: query
          schema:
            type: string
        - name: ascending
          in: query
          schema:
            type: boolean
        - name: search_tags
          in: query
          schema:
            type: boolean
        - name: search_profiles
          in: query
          schema:
            type: boolean
        - name: recurrence
          in: query
          schema:
            type: string
        - name: exclude_tag_id
          in: query
          schema:
            type: array
            items:
              type: integer
        - name: optimized
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Search'
components:
  parameters:
    limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 0
    offset:
      name: offset
      in: query
      schema:
        type: integer
        minimum: 0
    order:
      name: order
      in: query
      schema:
        type: string
      description: Comma-separated list of fields to order by
    ascending:
      name: ascending
      in: query
      schema:
        type: boolean
    pathId:
      name: id
      in: path
      required: true
      schema:
        type: integer
    pathSlug:
      name: slug
      in: path
      required: true
      schema:
        type: string
  schemas:
    ImageOptimization:
      type: object
      properties:
        id:
          type: string
        imageUrlSource:
          type: string
          nullable: true
        imageUrlOptimized:
          type: string
          nullable: true
        imageSizeKbSource:
          type: number
          nullable: true
        imageSizeKbOptimized:
          type: number
          nullable: true
        imageOptimizedComplete:
          type: boolean
          nullable: true
        imageOptimizedLastUpdated:
          type: string
          nullable: true
        relID:
          type: integer
          nullable: true
        field:
          type: string
          nullable: true
        relname:
          type: string
          nullable: true
    Team:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
        league:
          type: string
          nullable: true
        record:
          type: string
          nullable: true
        logo:
          type: string
          nullable: true
        abbreviation:
          type: string
          nullable: true
        alias:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    Tag:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        forceShow:
          type: boolean
          nullable: true
        publishedAt:
          type: string
          nullable: true
        createdBy:
          type: integer
          nullable: true
        updatedBy:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        forceHide:
          type: boolean
          nullable: true
        isCarousel:
          type: boolean
          nullable: true
    RelatedTag:
      type: object
      properties:
        id:
          type: string
        tagID:
          type: integer
          nullable: true
        relatedTagID:
          type: integer
          nullable: true
        rank:
          type: integer
          nullable: true
    Market:
      type: object
      properties:
        id:
          type: string
        question:
          type: string
          nullable: true
        conditionId:
          type: string
        slug:
          type: string
          nullable: true
        twitterCardImage:
          type: string
          nullable: true
        resolutionSource:
          type: string
          nullable: true
        endDate:
          type: string
          format: date-time
          nullable: true
        category:
          type: string
          nullable: true
        ammType:
          type: string
          nullable: true
        liquidity:
          type: string
          nullable: true
        sponsorName:
          type: string
          nullable: true
        sponsorImage:
          type: string
          nullable: true
        startDate:
          type: string
          format: date-time
          nullable: true
        xAxisValue:
          type: string
          nullable: true
        yAxisValue:
          type: string
          nullable: true
        denominationToken:
          type: string
          nullable: true
        fee:
          type: string
          nullable: true
        image:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        lowerBound:
          type: string
          nullable: true
        upperBound:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        outcomes:
          type: string
          nullable: true
        outcomePrices:
          type: string
          nullable: true
        volume:
          type: string
          nullable: true
        active:
          type: boolean
          nullable: true
        marketType:
          type: string
          nullable: true
        formatType:
          type: string
          nullable: true
        lowerBoundDate:
          type: string
          nullable: true
        upperBoundDate:
          type: string
          nullable: true
        closed:
          type: boolean
          nullable: true
        marketMakerAddress:
          type: string
        createdBy:
          type: integer
          nullable: true
        updatedBy:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        closedTime:
          type: string
          nullable: true
        wideFormat:
          type: boolean
          nullable: true
        new:
          type: boolean
          nullable: true
        mailchimpTag:
          type: string
          nullable: true
        featured:
          type: boolean
          nullable: true
        archived:
          type: boolean
          nullable: true
        resolvedBy:
          type: string
          nullable: true
        restricted:
          type: boolean
          nullable: true
        marketGroup:
          type: integer
          nullable: true
        groupItemTitle:
          type: string
          nullable: true
        groupItemThreshold:
          type: string
          nullable: true
        questionID:
          type: string
          nullable: true
        umaEndDate:
          type: string
          nullable: true
        enableOrderBook:
          type: boolean
          nullable: true
        orderPriceMinTickSize:
          type: number
          nullable: true
        orderMinSize:
          type: number
          nullable: true
        umaResolutionStatus:
          type: string
          nullable: true
        curationOrder:
          type: integer
          nullable: true
        volumeNum:
          type: number
          nullable: true
        liquidityNum:
          type: number
          nullable: true
        endDateIso:
          type: string
          nullable: true
        startDateIso:
          type: string
          nullable: true
        umaEndDateIso:
          type: string
          nullable: true
        hasReviewedDates:
          type: boolean
          nullable: true
        readyForCron:
          type: boolean
          nullable: true
        commentsEnabled:
          type: boolean
          nullable: true
        volume24hr:
          type: number
          nullable: true
        volume1wk:
          type: number
          nullable: true
        volume1mo:
          type: number
          nullable: true
        volume1yr:
          type: number
          nullable: true
        gameStartTime:
          type: string
          nullable: true
        secondsDelay:
          type: integer
          nullable: true
        clobTokenIds:
          type: string
          nullable: true
        disqusThread:
          type: string
          nullable: true
        shortOutcomes:
          type: string
          nullable: true
        teamAID:
          type: string
          nullable: true
        teamBID:
          type: string
          nullable: true
        umaBond:
          type: string
          nullable: true
        umaReward:
          type: string
          nullable: true
        fpmmLive:
          type: boolean
          nullable: true
        volume24hrAmm:
          type: number
          nullable: true
        volume1wkAmm:
          type: number
          nullable: true
        volume1moAmm:
          type: number
          nullable: true
        volume1yrAmm:
          type: number
          nullable: true
        volume24hrClob:
          type: number
          nullable: true
        volume1wkClob:
          type: number
          nullable: true
        volume1moClob:
          type: number
          nullable: true
        volume1yrClob:
          type: number
          nullable: true
        volumeAmm:
          type: number
          nullable: true
        volumeClob:
          type: number
          nullable: true
        liquidityAmm:
          type: number
          nullable: true
        liquidityClob:
          type: number
          nullable: true
        makerBaseFee:
          type: integer
          nullable: true
        takerBaseFee:
          type: integer
          nullable: true
        customLiveness:
          type: integer
          nullable: true
        acceptingOrders:
          type: boolean
          nullable: true
        notificationsEnabled:
          type: boolean
          nullable: true
        score:
          type: integer
          nullable: true
        imageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        iconOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        creator:
          type: string
          nullable: true
        ready:
          type: boolean
          nullable: true
        funded:
          type: boolean
          nullable: true
        pastSlugs:
          type: string
          nullable: true
        readyTimestamp:
          type: string
          format: date-time
          nullable: true
        fundedTimestamp:
          type: string
          format: date-time
          nullable: true
        acceptingOrdersTimestamp:
          type: string
          format: date-time
          nullable: true
        competitive:
          type: number
          nullable: true
        rewardsMinSize:
          type: number
          nullable: true
        rewardsMaxSpread:
          type: number
          nullable: true
        spread:
          type: number
          nullable: true
        automaticallyResolved:
          type: boolean
          nullable: true
        oneDayPriceChange:
          type: number
          nullable: true
        oneHourPriceChange:
          type: number
          nullable: true
        oneWeekPriceChange:
          type: number
          nullable: true
        oneMonthPriceChange:
          type: number
          nullable: true
        oneYearPriceChange:
          type: number
          nullable: true
        lastTradePrice:
          type: number
          nullable: true
        bestBid:
          type: number
          nullable: true
        bestAsk:
          type: number
          nullable: true
        automaticallyActive:
          type: boolean
          nullable: true
        clearBookOnStart:
          type: boolean
          nullable: true
        chartColor:
          type: string
          nullable: true
        seriesColor:
          type: string
          nullable: true
        showGmpSeries:
          type: boolean
          nullable: true
        showGmpOutcome:
          type: boolean
          nullable: true
        manualActivation:
          type: boolean
          nullable: true
        negRiskOther:
          type: boolean
          nullable: true
        gameId:
          type: string
          nullable: true
        groupItemRange:
          type: string
          nullable: true
        sportsMarketType:
          type: string
          nullable: true
        line:
          type: number
          nullable: true
        umaResolutionStatuses:
          type: string
          nullable: true
        pendingDeployment:
          type: boolean
          nullable: true
        deploying:
          type: boolean
          nullable: true
        deployingTimestamp:
          type: string
          format: date-time
          nullable: true
        scheduledDeploymentTimestamp:
          type: string
          format: date-time
          nullable: true
        rfqEnabled:
          type: boolean
          nullable: true
        eventStartTime:
          type: string
          format: date-time
          nullable: true
        feesEnabled:
          type: boolean
          nullable: true
        feeSchedule:
          $ref: '#/components/schemas/FeeSchedule'
    FeeSchedule:
      type: object
      properties:
        exponent:
          type: number
          nullable: true
        rate:
          type: number
          nullable: true
        takerOnly:
          type: boolean
          nullable: true
        rebateRate:
          type: number
          nullable: true
    MarketDescription:
      type: object
      properties:
        description:
          type: string
          nullable: true
    Category:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
          nullable: true
        parentCategory:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        publishedAt:
          type: string
          nullable: true
        createdBy:
          type: string
          nullable: true
        updatedBy:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    Event:
      type: object
      properties:
        id:
          type: string
        ticker:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        subtitle:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        resolutionSource:
          type: string
          nullable: true
        startDate:
          type: string
          format: date-time
          nullable: true
        creationDate:
          type: string
          format: date-time
          nullable: true
        endDate:
          type: string
          format: date-time
          nullable: true
        image:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        active:
          type: boolean
          nullable: true
        closed:
          type: boolean
          nullable: true
        archived:
          type: boolean
          nullable: true
        new:
          type: boolean
          nullable: true
        featured:
          type: boolean
          nullable: true
        restricted:
          type: boolean
          nullable: true
        liquidity:
          type: number
          nullable: true
        volume:
          type: number
          nullable: true
        openInterest:
          type: number
          nullable: true
        sortBy:
          type: string
          nullable: true
        category:
          type: string
          nullable: true
        subcategory:
          type: string
          nullable: true
        isTemplate:
          type: boolean
          nullable: true
        templateVariables:
          type: string
          nullable: true
        published_at:
          type: string
          nullable: true
        createdBy:
          type: string
          nullable: true
        updatedBy:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        commentsEnabled:
          type: boolean
          nullable: true
        competitive:
          type: number
          nullable: true
        volume24hr:
          type: number
          nullable: true
        volume1wk:
          type: number
          nullable: true
        volume1mo:
          type: number
          nullable: true
        volume1yr:
          type: number
          nullable: true
        featuredImage:
          type: string
          nullable: true
        disqusThread:
          type: string
          nullable: true
        parentEvent:
          type: string
          nullable: true
        enableOrderBook:
          type: boolean
          nullable: true
        liquidityAmm:
          type: number
          nullable: true
        liquidityClob:
          type: number
          nullable: true
        negRisk:
          type: boolean
          nullable: true
        negRiskMarketID:
          type: string
          nullable: true
        negRiskFeeBips:
          type: integer
          nullable: true
        commentCount:
          type: integer
          nullable: true
        imageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        iconOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        featuredImageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        subEvents:
          type: array
          items:
            type: string
          nullable: true
        markets:
          type: array
          items:
            $ref: '#/components/schemas/Market'
        series:
          type: array
          items:
            $ref: '#/components/schemas/Series'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
        collections:
          type: array
          items:
            $ref: '#/components/schemas/Collection'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        cyom:
          type: boolean
          nullable: true
        closedTime:
          type: string
          format: date-time
          nullable: true
        showAllOutcomes:
          type: boolean
          nullable: true
        showMarketImages:
          type: boolean
          nullable: true
        automaticallyResolved:
          type: boolean
          nullable: true
        enableNegRisk:
          type: boolean
          nullable: true
        automaticallyActive:
          type: boolean
          nullable: true
        eventDate:
          type: string
          nullable: true
        startTime:
          type: string
          format: date-time
          nullable: true
        eventWeek:
          type: integer
          nullable: true
        seriesSlug:
          type: string
          nullable: true
        score:
          type: string
          nullable: true
        elapsed:
          type: string
          nullable: true
        period:
          type: string
          nullable: true
        live:
          type: boolean
          nullable: true
        ended:
          type: boolean
          nullable: true
        finishedTimestamp:
          type: string
          format: date-time
          nullable: true
        gmpChartMode:
          type: string
          nullable: true
        eventCreators:
          type: array
          items:
            $ref: '#/components/schemas/EventCreator'
        tweetCount:
          type: integer
          nullable: true
        chats:
          type: array
          items:
            $ref: '#/components/schemas/Chat'
        featuredOrder:
          type: integer
          nullable: true
        estimateValue:
          type: boolean
          nullable: true
        cantEstimate:
          type: boolean
          nullable: true
        estimatedValue:
          type: string
          nullable: true
        templates:
          type: array
          items:
            $ref: '#/components/schemas/Template'
        spreadsMainLine:
          type: number
          nullable: true
        totalsMainLine:
          type: number
          nullable: true
        carouselMap:
          type: string
          nullable: true
        pendingDeployment:
          type: boolean
          nullable: true
        deploying:
          type: boolean
          nullable: true
        deployingTimestamp:
          type: string
          format: date-time
          nullable: true
        scheduledDeploymentTimestamp:
          type: string
          format: date-time
          nullable: true
        gameStatus:
          type: string
          nullable: true
    EventCreator:
      type: object
      properties:
        id:
          type: string
        creatorName:
          type: string
          nullable: true
        creatorHandle:
          type: string
          nullable: true
        creatorUrl:
          type: string
          nullable: true
        creatorImage:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    Series:
      type: object
      properties:
        id:
          type: string
        ticker:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        subtitle:
          type: string
          nullable: true
        seriesType:
          type: string
          nullable: true
        recurrence:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        image:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        layout:
          type: string
          nullable: true
        active:
          type: boolean
          nullable: true
        closed:
          type: boolean
          nullable: true
        archived:
          type: boolean
          nullable: true
        new:
          type: boolean
          nullable: true
        featured:
          type: boolean
          nullable: true
        restricted:
          type: boolean
          nullable: true
        isTemplate:
          type: boolean
          nullable: true
        templateVariables:
          type: boolean
          nullable: true
        publishedAt:
          type: string
          nullable: true
        createdBy:
          type: string
          nullable: true
        updatedBy:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        commentsEnabled:
          type: boolean
          nullable: true
        competitive:
          type: string
          nullable: true
        volume24hr:
          type: number
          nullable: true
        volume:
          type: number
          nullable: true
        liquidity:
          type: number
          nullable: true
        startDate:
          type: string
          format: date-time
          nullable: true
        pythTokenID:
          type: string
          nullable: true
        cgAssetName:
          type: string
          nullable: true
        score:
          type: integer
          nullable: true
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        collections:
          type: array
          items:
            $ref: '#/components/schemas/Collection'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        commentCount:
          type: integer
          nullable: true
        chats:
          type: array
          items:
            $ref: '#/components/schemas/Chat'
    SeriesSummary:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        eventDates:
          type: array
          items:
            type: string
        eventWeeks:
          type: array
          items:
            type: integer
        earliest_open_week:
          type: integer
          nullable: true
        earliest_open_date:
          type: string
          nullable: true
    Collection:
      type: object
      properties:
        id:
          type: string
        ticker:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        subtitle:
          type: string
          nullable: true
        collectionType:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        tags:
          type: string
          nullable: true
        image:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        headerImage:
          type: string
          nullable: true
        layout:
          type: string
          nullable: true
        active:
          type: boolean
          nullable: true
        closed:
          type: boolean
          nullable: true
        archived:
          type: boolean
          nullable: true
        new:
          type: boolean
          nullable: true
        featured:
          type: boolean
          nullable: true
        restricted:
          type: boolean
          nullable: true
        isTemplate:
          type: boolean
          nullable: true
        templateVariables:
          type: string
          nullable: true
        publishedAt:
          type: string
          nullable: true
        createdBy:
          type: string
          nullable: true
        updatedBy:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        commentsEnabled:
          type: boolean
          nullable: true
        imageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        iconOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        headerImageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
    CommentPosition:
      type: object
      properties:
        tokenId:
          type: string
          nullable: true
        positionSize:
          type: string
          nullable: true
    CommentProfile:
      type: object
      properties:
        name:
          type: string
          nullable: true
        pseudonym:
          type: string
          nullable: true
        displayUsernamePublic:
          type: boolean
          nullable: true
        bio:
          type: string
          nullable: true
        isMod:
          type: boolean
          nullable: true
        isCreator:
          type: boolean
          nullable: true
        proxyWallet:
          type: string
          nullable: true
        baseAddress:
          type: string
          nullable: true
        profileImage:
          type: string
          nullable: true
        profileImageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        positions:
          type: array
          items:
            $ref: '#/components/schemas/CommentPosition'
    Comment:
      type: object
      properties:
        id:
          type: string
        body:
          type: string
          nullable: true
        parentEntityType:
          type: string
          nullable: true
        parentEntityID:
          type: integer
          nullable: true
        parentCommentID:
          type: string
          nullable: true
        userAddress:
          type: string
          nullable: true
        replyAddress:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        profile:
          $ref: '#/components/schemas/CommentProfile'
        reactions:
          type: array
          items:
            $ref: '#/components/schemas/Reaction'
        reportCount:
          type: integer
          nullable: true
        reactionCount:
          type: integer
          nullable: true
    Reaction:
      type: object
      properties:
        id:
          type: string
        commentID:
          type: integer
          nullable: true
        reactionType:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        userAddress:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        profile:
          $ref: '#/components/schemas/CommentProfile'
    Profile:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        user:
          type: integer
          nullable: true
        referral:
          type: string
          nullable: true
        createdBy:
          type: integer
          nullable: true
        updatedBy:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        utmSource:
          type: string
          nullable: true
        utmMedium:
          type: string
          nullable: true
        utmCampaign:
          type: string
          nullable: true
        utmContent:
          type: string
          nullable: true
        utmTerm:
          type: string
          nullable: true
        walletActivated:
          type: boolean
          nullable: true
        pseudonym:
          type: string
          nullable: true
        displayUsernamePublic:
          type: boolean
          nullable: true
        profileImage:
          type: string
          nullable: true
        bio:
          type: string
          nullable: true
        proxyWallet:
          type: string
          nullable: true
        profileImageOptimized:
          $ref: '#/components/schemas/ImageOptimization'
        isCloseOnly:
          type: boolean
          nullable: true
        isCertReq:
          type: boolean
          nullable: true
        certReqDate:
          type: string
          format: date-time
          nullable: true
    PublicProfileResponse:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the profile was created
          nullable: true
        proxyWallet:
          type: string
          description: The proxy wallet address
          nullable: true
        profileImage:
          type: string
          format: uri
          description: URL to the profile image
          nullable: true
        displayUsernamePublic:
          type: boolean
          description: Whether the username is displayed publicly
          nullable: true
        bio:
          type: string
          description: Profile bio
          nullable: true
        pseudonym:
          type: string
          description: Auto-generated pseudonym
          nullable: true
        name:
          type: string
          description: User-chosen display name
          nullable: true
        users:
          type: array
          description: Array of associated user objects
          nullable: true
          items:
            $ref: '#/components/schemas/PublicProfileUser'
        xUsername:
          type: string
          description: X (Twitter) username
          nullable: true
        verifiedBadge:
          type: boolean
          description: Whether the profile has a verified badge
          nullable: true
    PublicProfileUser:
      type: object
      description: User object associated with a public profile
      properties:
        id:
          type: string
          description: User ID
        creator:
          type: boolean
          description: Whether the user is a creator
        mod:
          type: boolean
          description: Whether the user is a moderator
    PublicProfileError:
      type: object
      description: Error response for public profile endpoint
      properties:
        type:
          type: string
          description: Error type classification
        error:
          type: string
          description: Error message
    Chat:
      type: object
      properties:
        id:
          type: string
        channelId:
          type: string
          nullable: true
        channelName:
          type: string
          nullable: true
        channelImage:
          type: string
          nullable: true
        live:
          type: boolean
          nullable: true
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
    Template:
      type: object
      properties:
        id:
          type: string
        eventTitle:
          type: string
          nullable: true
        eventSlug:
          type: string
          nullable: true
        eventImage:
          type: string
          nullable: true
        marketTitle:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        resolutionSource:
          type: string
          nullable: true
        negRisk:
          type: boolean
          nullable: true
        sortBy:
          type: string
          nullable: true
        showMarketImages:
          type: boolean
          nullable: true
        seriesSlug:
          type: string
          nullable: true
        outcomes:
          type: string
          nullable: true
    EventsPagination:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        pagination:
          $ref: '#/components/schemas/Pagination'
    Pagination:
      type: object
      properties:
        hasMore:
          type: boolean
        totalResults:
          type: integer
    Count:
      type: object
      properties:
        count:
          type: integer
    EventTweetCount:
      type: object
      properties:
        tweetCount:
          type: integer
    SearchTag:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        slug:
          type: string
        event_count:
          type: integer
    Search:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
          nullable: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/SearchTag'
          nullable: true
        profiles:
          type: array
          items:
            $ref: '#/components/schemas/Profile'
          nullable: true
        pagination:
          $ref: '#/components/schemas/Pagination'
    SportsMetadata:
      type: object
      properties:
        sport:
          type: string
          description: The sport identifier or abbreviation
        image:
          type: string
          format: uri
          description: URL to the sport's logo or image asset
        resolution:
          type: string
          format: uri
          description: >-
            URL to the official resolution source for the sport (e.g., league
            website)
        ordering:
          type: string
          description: Preferred ordering for sport display, typically "home" or "away"
        tags:
          type: string
          description: >-
            Comma-separated list of tag IDs associated with the sport for
            categorization and filtering
        series:
          type: string
          description: >-
            Series identifier linking the sport to a specific tournament or
            season series
    SportsMarketTypesResponse:
      type: object
      properties:
        marketTypes:
          type: array
          description: List of all valid sports market types
          items:
            type: string
    MarketsInformationBody:
      type: object
      properties:
        id:
          type: array
          items:
            type: integer
        slug:
          type: array
          items:
            type: string
        closed:
          type: boolean
          nullable: true
        clobTokenIds:
          type: array
          items:
            type: string
        conditionIds:
          type: array
          items:
            type: string
        marketMakerAddress:
          type: array
          items:
            type: string
        liquidityNumMin:
          type: number
          nullable: true
        liquidityNumMax:
          type: number
          nullable: true
        volumeNumMin:
          type: number
          nullable: true
        volumeNumMax:
          type: number
          nullable: true
        startDateMin:
          type: string
          format: date-time
          nullable: true
        startDateMax:
          type: string
          format: date-time
          nullable: true
        endDateMin:
          type: string
          format: date-time
          nullable: true
        endDateMax:
          type: string
          format: date-time
          nullable: true
        relatedTags:
          type: boolean
          nullable: true
        tagId:
          type: integer
          nullable: true
        cyom:
          type: boolean
          nullable: true
        umaResolutionStatus:
          type: string
          nullable: true
        gameId:
          type: string
          nullable: true
        sportsMarketTypes:
          type: array
          items:
            type: string
        rewardsMinSize:
          type: number
          nullable: true
        questionIds:
          type: array
          items:
            type: string
        includeTags:
          type: boolean
          nullable: true
    KeysetMarketsResponse:
      type: object
      properties:
        markets:
          type: array
          description: Array of Market objects. Empty array if none found.
          items:
            $ref: '#/components/schemas/Market'
        next_cursor:
          type: string
          description: >
            Opaque cursor token for fetching the next page. Present only when
            the number of returned markets equals the effective limit. Omitted
            on the last page.
    KeysetEventsResponse:
      type: object
      properties:
        events:
          type: array
          description: Array of Event objects. Empty array if none found.
          items:
            $ref: '#/components/schemas/Event'
        next_cursor:
          type: string
          description: >
            Opaque cursor token for fetching the next page. Present only when
            the number of returned events equals the effective limit. Omitted on
            the last page.
    ValidationError:
      type: object
      properties:
        type:
          type: string
          example: validation error
        error:
          type: string
          example: offset is not allowed on keyset endpoints
    InternalError:
      type: object
      properties:
        type:
          type: string
          example: internal error
        error:
          type: string
          example: cannot get the information
    ServiceUnavailableError:
      type: object
      properties:
        type:
          type: string
          example: service unavailable
        error:
          type: string
          example: keyset pagination is not configured
