openapi: 3.1.0
info:
  title: Market Sessions
  version: 2.0.1
  description: tastytrade Market Sessions API.
  contact:
    name: tastytrade API support
    email: api.support@tastytrade.com
    url: https://developer.tastytrade.com
tags:
  - name: market-time
paths:
  /market-time/sessions:
    get:
      description: Returns the timings for each trading session in a date range for a
        single instrument collection. Pass `from-date`, `to-date`, and
        optionally `instrument-collection` (defaults to `Equity`); the span
        between `from-date` and `to-date` must not exceed 9 months. Useful for
        building a calendar of market hours.
      parameters:
        - in: query
          name: from-date
          description: The date to start from
          required: false
          schema:
            type: string
            format: date
            default: 2026-04-15
          example: 2024-01-15
        - in: query
          name: instrument-collection
          description: The instrument collection to get sessions for
          required: false
          schema:
            type: string
            enum:
              - Equity
              - CME
              - CFE
            default: Equity
          example: Equity
        - in: query
          name: to-date
          description: The date to end at, the difference between from and to date must
            not exceed 9 months
          required: true
          schema:
            type: string
            format: date
          example: 2024-01-15
      responses:
        "200":
          description: An array of session timings, one per trading day in the requested
            range.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/SimpleSessionDeserializer"
                    required:
                      - items
                  context:
                    type: string
                    example: /market-time/sessions
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "422":
          description: Invalid query parameters, for example a missing `to-date` or a
            `from-date`/`to-date` span that exceeds the 9-month maximum.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeSessions
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: List Sessions For Date Range
  /market-time/sessions/current:
    get:
      description: Returns the current trading session, plus its previous and next
        sessions, for an instrument collection supplied via the required
        `instrument-collections[]` query parameter (`CFE`, `CME`, or `Equity`).
        Use this to check the current market state.
      parameters:
        - in: query
          name: instrument-collections
          description: "List of instrument collections . i.e. `CFE`, `CME` or `Equity`
            (example:
            instrument-collections[]={value1}&instrument-collections[]={value2}\
            )"
          required: true
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - CFE
                - CME
                - Equity
          example:
            - CFE
      responses:
        "200":
          description: The current session with its surrounding previous and next sessions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/CurrentSessionDeserializer"
                  context:
                    type: string
                    example: /market-time/sessions/current
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "422":
          description: Invalid or missing `instrument-collections[]` values. Allowed
            values are `CFE`, `CME`, and `Equity`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeSessionsCurrent
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Current Sessions By Collection
  /market-time/equities/sessions/current:
    get:
      description: Returns the current equities trading session along with its
        previous and next sessions. Optionally pass `current-time` to evaluate
        the session as of a specific instant instead of now; the response
        `state` field indicates the market's current state.
      parameters:
        - in: query
          name: current-time
          description: The time the current session is based on
          required: false
          schema:
            type: string
            format: date-time
          example: 2024-01-15T14:30:00.000Z
      responses:
        "200":
          description: The current equities session with its surrounding previous and next
            sessions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/CurrentSession"
                  context:
                    type: string
                    example: /market-time/equities/sessions/current
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "422":
          description: The `current-time` value is not a valid ISO-8601 date-time.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeEquitiesSessionsCurrent
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Current Equities Session
  /market-time/equities/sessions/next:
    get:
      description: Returns the next equities trading session. Optionally pass `date`
        to find the first session on or after that date instead of after today.
      parameters:
        - in: query
          name: date
          description: Find session on or after this date
          required: false
          schema:
            type: string
            format: date
            default: 2026-04-15
          example: 2024-01-15
      responses:
        "200":
          description: The next equities session timings.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/NextSession"
                  context:
                    type: string
                    example: /market-time/equities/sessions/next
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "422":
          description: The `date` value is not a valid ISO-8601 date.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeEquitiesSessionsNext
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Next Equities Session
  /market-time/equities/sessions/previous:
    get:
      description: Returns the previous equities trading session. Optionally pass
        `date` to find the most recent session before that date instead of
        before today.
      parameters:
        - in: query
          name: date
          description: Find session before this date
          required: false
          schema:
            type: string
            format: date
            default: 2026-04-15
          example: 2024-01-15
      responses:
        "200":
          description: The previous equities session timings.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PreviousSession"
                  context:
                    type: string
                    example: /market-time/equities/sessions/previous
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "422":
          description: The `date` value is not a valid ISO-8601 date.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeEquitiesSessionsPrevious
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Previous Equities Session
  /market-time/equities/holidays:
    get:
      description: Returns the equity market calendar, listing full-day market
        holidays and early-close half days. Use it to skip non-trading dates and
        to flag shortened sessions in your scheduling logic.
      responses:
        "200":
          description: The equity market calendar of holidays and half days.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/MarketCalendarDeserializer"
                    required:
                      - items
                  context:
                    type: string
                    example: /market-time/equities/holidays
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeEquitiesHolidays
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Equity Market Holidays
  /market-time/futures/sessions/current:
    get:
      description: Returns the current trading session for each supported futures
        exchange (`CFE` and `CME`), each with its previous and next sessions.
        Use this to see the current session state across all futures collections
        in a single call.
      responses:
        "200":
          description: An array of current futures sessions, one per supported exchange.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/CurrentSession"
                    required:
                      - items
                  context:
                    type: string
                    example: /market-time/futures/sessions/current
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeFuturesSessionsCurrent
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Current Futures Sessions
  /market-time/futures/sessions/current/{instrument_collection}:
    get:
      description: Returns the current trading session for a single futures exchange
        identified by the `instrument_collection` path parameter (`CFE` or
        `CME`), including its previous and next sessions and current session
        state.
      parameters:
        - in: path
          name: instrument_collection
          description: "Futures exchange, one of: CFE, CME"
          required: true
          schema:
            type: string
            enum:
              - CFE
              - CME
          example: CFE
      responses:
        "200":
          description: The current futures session for the requested exchange.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/CurrentSession"
                  context:
                    type: string
                    example: /market-time/futures/sessions/current/{instrument_collection}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "404":
          description: No session found for the supplied `instrument_collection`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The `instrument_collection` path value is not a supported futures
            exchange (`CFE` or `CME`).
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeFuturesSessionsCurrentInstrumentCollection
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Current Futures Session By Exchange
  /market-time/futures/sessions/next/{instrument_collection}:
    get:
      description: Returns the next trading session for a single futures exchange
        (`CFE` or `CME`) given by the `instrument_collection` path parameter.
        Optionally pass `date` to find the first session on or after that date.
      parameters:
        - in: path
          name: instrument_collection
          description: "Futures exchange, one of: CFE, CME"
          required: true
          schema:
            type: string
            enum:
              - CFE
              - CME
          example: CFE
        - in: query
          name: date
          description: Find session on or after this date
          required: false
          schema:
            type: string
            format: date
            default: 2026-04-15
          example: 2024-01-15
      responses:
        "200":
          description: The next futures session for the requested exchange.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/NextSession"
                  context:
                    type: string
                    example: /market-time/futures/sessions/next/{instrument_collection}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "404":
          description: No session found for the supplied `instrument_collection`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The `instrument_collection` is not a supported futures exchange, or
            `date` is not a valid ISO-8601 date.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeFuturesSessionsNextInstrumentCollection
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Next Futures Session By Exchange
  /market-time/futures/sessions/previous/{instrument_collection}:
    get:
      description: Returns the previous trading session for a single futures exchange
        (`CFE` or `CME`) given by the `instrument_collection` path parameter.
        Optionally pass `date` to find the most recent session before that date.
      parameters:
        - in: path
          name: instrument_collection
          description: "Futures exchange, one of: CFE, CME"
          required: true
          schema:
            type: string
            enum:
              - CFE
              - CME
          example: CFE
        - in: query
          name: date
          description: Find session before this date
          required: false
          schema:
            type: string
            format: date
            default: 2026-04-15
          example: 2024-01-15
      responses:
        "200":
          description: The previous futures session for the requested exchange.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PreviousSession"
                  context:
                    type: string
                    example: /market-time/futures/sessions/previous/{instrument_collection}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "404":
          description: No session found for the supplied `instrument_collection`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The `instrument_collection` is not a supported futures exchange, or
            `date` is not a valid ISO-8601 date.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeFuturesSessionsPreviousInstrumentCollection
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Previous Futures Session By Exchange
  /market-time/futures/holidays/{instrument_collection}:
    get:
      description: Returns the futures market calendar for a single exchange (`CFE` or
        `CME`) given by the `instrument_collection` path parameter, listing
        full-day market holidays and early-close half days for that exchange.
      parameters:
        - in: path
          name: instrument_collection
          description: "Futures exchange, one of: CFE, CME"
          required: true
          schema:
            type: string
            enum:
              - CFE
              - CME
          example: CFE
      responses:
        "200":
          description: The futures market calendar of holidays and half days for the
            requested exchange.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/MarketCalendarDeserializer"
                    required:
                      - items
                  context:
                    type: string
                    example: /market-time/futures/holidays/{instrument_collection}
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "404":
          description: No calendar found for the supplied `instrument_collection`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The `instrument_collection` path value is not a supported futures
            exchange (`CFE` or `CME`).
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Too many requests. Back off and reduce your request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - market-time
      operationId: getMarketTimeFuturesHolidaysInstrumentCollection
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Futures Market Holidays By Exchange
servers:
  - url: https://api.cert.tastyworks.com
    description: Sandbox
  - url: https://api.tastyworks.com
    description: Production
components:
  schemas:
    SimpleSessionDeserializer:
      type: object
      properties:
        close-at:
          description: ISO-8601 date-time at which the session closes.
          type: string
          format: date-time
        close-at-ext:
          description: ISO-8601 date-time of the session's extended close.
          type: string
          format: date-time
        instrument-collection:
          description: The instrument collection this session applies to, for example
            `Equity`, `CME`, or `CFE`.
          type: string
          example: Equity
        open-at:
          description: ISO-8601 date-time at which the session opens.
          type: string
          format: date-time
        start-at:
          description: ISO-8601 date-time at which the session starts.
          type: string
          format: date-time
      description: A single trading session's timings for an instrument collection.
        Returned for each trading day when listing sessions over a date range.
    CurrentSessionDeserializer:
      type: object
      properties:
        close-at:
          description: ISO-8601 date-time at which the session closes.
          type: string
          format: date-time
        close-at-ext:
          description: ISO-8601 date-time of the session's extended close.
          type: string
          format: date-time
        instrument-collection:
          description: The instrument collection this session applies to, for example
            `Equity`, `CME`, or `CFE`.
          type: string
          example: Equity
        open-at:
          description: ISO-8601 date-time at which the session opens.
          type: string
          format: date-time
        start-at:
          description: ISO-8601 date-time at which the session starts.
          type: string
          format: date-time
        next-session:
          description: The next trading session that follows the current one.
          type: object
          properties:
            close-at:
              description: ""
              type: string
              format: date-time
            close-at-ext:
              description: ""
              type: string
              format: date-time
            instrument-collection:
              description: ""
              type: string
            open-at:
              description: ""
              type: string
              format: date-time
            session-date:
              description: ""
              type: string
              format: date
            start-at:
              description: ""
              type: string
              format: date-time
        previous-session:
          description: The previous trading session that preceded the current one.
          type: object
          properties:
            close-at:
              description: ""
              type: string
              format: date-time
            close-at-ext:
              description: ""
              type: string
              format: date-time
            instrument-collection:
              description: ""
              type: string
            open-at:
              description: ""
              type: string
              format: date-time
            session-date:
              description: ""
              type: string
              format: date
            start-at:
              description: ""
              type: string
              format: date-time
        state:
          description: The current state of the market for this session.
          type: string
      description: The current trading session for an instrument collection, including
        its state and the immediately previous and next sessions.
    CurrentSession:
      type: object
      properties:
        close-at:
          description: ISO-8601 date-time at which the session closes.
          type: string
          format: date-time
        close-at-ext:
          description: ISO-8601 date-time of the session's extended close.
          type: string
          format: date-time
        instrument-collection:
          description: The instrument collection this session applies to, for example
            `Equity`, `CME`, or `CFE`.
          type: string
          example: Equity
        open-at:
          description: ISO-8601 date-time at which the session opens.
          type: string
          format: date-time
        start-at:
          description: ISO-8601 date-time at which the session starts.
          type: string
          format: date-time
        next-session:
          description: The next trading session that follows the current one.
          type: object
          properties:
            close-at:
              description: ""
              type: string
              format: date-time
            close-at-ext:
              description: ""
              type: string
              format: date-time
            instrument-collection:
              description: ""
              type: string
            open-at:
              description: ""
              type: string
              format: date-time
            session-date:
              description: ""
              type: string
              format: date
            start-at:
              description: ""
              type: string
              format: date-time
        previous-session:
          description: The previous trading session that preceded the current one.
          type: object
          properties:
            close-at:
              description: ""
              type: string
              format: date-time
            close-at-ext:
              description: ""
              type: string
              format: date-time
            instrument-collection:
              description: ""
              type: string
            open-at:
              description: ""
              type: string
              format: date-time
            session-date:
              description: ""
              type: string
              format: date
            start-at:
              description: ""
              type: string
              format: date-time
        state:
          description: The current state of the market for this session.
          type: string
      description: The current trading session for an instrument collection, including
        its state and the immediately previous and next sessions. Returned for
        equity and futures current-session endpoints.
    NextSession:
      type: object
      properties:
        close-at:
          description: ISO-8601 date-time at which the session closes.
          type: string
          format: date-time
        close-at-ext:
          description: ISO-8601 date-time of the session's extended close.
          type: string
          format: date-time
        instrument-collection:
          description: The instrument collection this session applies to, for example
            `Equity`, `CME`, or `CFE`.
          type: string
          example: Equity
        open-at:
          description: ISO-8601 date-time at which the session opens.
          type: string
          format: date-time
        session-date:
          description: The calendar date (ISO-8601) of the trading session.
          type: string
          format: date
          example: 2026-06-10
        start-at:
          description: ISO-8601 date-time at which the session starts.
          type: string
          format: date-time
      description: The next trading session for an instrument collection, identified
        by its session date along with its session timings.
    PreviousSession:
      type: object
      properties:
        close-at:
          description: ISO-8601 date-time at which the session closes.
          type: string
          format: date-time
        close-at-ext:
          description: ISO-8601 date-time of the session's extended close.
          type: string
          format: date-time
        instrument-collection:
          description: The instrument collection this session applies to, for example
            `Equity`, `CME`, or `CFE`.
          type: string
          example: Equity
        open-at:
          description: ISO-8601 date-time at which the session opens.
          type: string
          format: date-time
        session-date:
          description: The calendar date (ISO-8601) of the trading session.
          type: string
          format: date
          example: 2026-06-08
        start-at:
          description: ISO-8601 date-time at which the session starts.
          type: string
          format: date-time
      description: The previous trading session for an instrument collection,
        identified by its session date along with its session timings.
    MarketCalendarDeserializer:
      type: object
      properties:
        market-half-days:
          description: Market half days — days on which the market closes early (a
            shortened session).
          type: object
        market-holidays:
          description: Market holidays — days on which the market is fully closed and no
            trading takes place.
          type: object
      description: A market calendar listing the non-trading and shortened-trading
        dates for an instrument collection.
x-tastytrade-service:
  serviceName: market-time-api
  group: market-sessions
  title: Market Sessions
