{
  "openapi": "3.1.0",
  "info": {
    "title": "Account Status",
    "version": "7.1.0",
    "description": "tastytrade Account Status API.",
    "contact": {
      "name": "tastytrade API support",
      "email": "api.support@tastytrade.com",
      "url": "https://developer.tastytrade.com"
    }
  },
  "tags": [
    {
      "name": "trading-status"
    }
  ],
  "paths": {
    "/accounts/{account_number}/trading-status": {
      "get": {
        "description": "Returns the current trading status for an account, reporting whether and how it may trade. If `is-closed` or `is-frozen` is true, trading is blocked entirely; if `is-closing-only` (or `is-cryptocurrency-closing-only` / `is-futures-closing-only`) is true, only closing trades are allowed, and `is-risk-reducing-only` restricts the account to de-risking activity. The response also exposes per-feature toggles, the live `day-trade-count`, the `options-level` tier, and margin-call flags. Check trading status before building order flows so restrictions surface up front rather than as rejected orders.",
        "parameters": [
          {
            "in": "path",
            "name": "account_number",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "5WX01234"
          }
        ],
        "responses": {
          "200": {
            "description": "The account's current trading status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TradingStatus"
                    },
                    "context": {
                      "type": "string",
                      "example": "/accounts/{account_number}/trading-status"
                    }
                  },
                  "required": [
                    "data",
                    "context"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or expired access token, or a missing/malformed `User-Agent` header. Send a valid `Authorization: Bearer <token>` (tokens last 15 minutes) and a `User-Agent` in the form `<product>/<version>`. Note that `User-Agent` rejections are returned as an HTML error page from the edge, not the JSON error envelope.",
            "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."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Authenticated, but the token's scope or the account authority does not permit reading this account's trading status.",
            "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": "not_permitted",
                      "message": "User not permitted access"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No account exists for the supplied `account_number`.",
            "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"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Request rate exceeded. Back off exponentially and reduce request frequency.",
            "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": [
          "trading-status"
        ],
        "operationId": "getAccountsAccountNumberTradingStatus",
        "x-tt-class": "read",
        "x-money-moving": false,
        "x-idempotent": true,
        "x-rate-limit-bucket": "read",
        "summary": "Get Account Trading Status"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.cert.tastyworks.com",
      "description": "Sandbox"
    },
    {
      "url": "https://api.tastyworks.com",
      "description": "Production"
    }
  ],
  "components": {
    "schemas": {
      "TradingStatus": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Internal identifier for the trading-status record.",
            "type": "integer",
            "format": "int32",
            "example": 15
          },
          "account-number": {
            "description": "The account number this trading status applies to.",
            "type": "string",
            "example": "5WX01234"
          },
          "are-deep-itm-carry-options-enabled": {
            "description": "Whether carrying deep in-the-money options through expiration is enabled for the account.",
            "type": "boolean",
            "example": false
          },
          "are-far-otm-net-options-restricted": {
            "description": "Whether far out-of-the-money net options positions are restricted for the account.",
            "type": "boolean",
            "example": true
          },
          "are-options-values-restricted-to-nlv": {
            "description": "Whether options values are capped at the account's net liquidating value.",
            "type": "boolean",
            "example": false
          },
          "are-single-tick-expiring-hedges-ignored": {
            "description": "Whether single-tick expiring hedges are ignored when computing requirements.",
            "type": "boolean",
            "example": false
          },
          "autotrade-account-type": {
            "description": "The autotrade account classification, when the account participates in autotrading.",
            "type": "string",
            "example": ""
          },
          "clearing-account-number": {
            "description": "The account number used at the clearing firm.",
            "type": "string",
            "example": "5WX01234"
          },
          "clearing-aggregation-identifier": {
            "description": "Identifier used to aggregate the account at the clearing firm.",
            "type": "string",
            "example": ""
          },
          "cmta-override": {
            "description": "CMTA (Clearing Member Trade Agreement) override value, when set.",
            "type": "integer",
            "format": "int32",
            "example": 0
          },
          "day-trade-count": {
            "description": "Live count of day trades used by the account, updated throughout the trading day.",
            "type": "integer",
            "format": "int32",
            "example": 0
          },
          "enhanced-fraud-safeguards-enabled-at": {
            "description": "Timestamp at which enhanced fraud safeguards were enabled for the account.",
            "type": "string",
            "format": "date-time",
            "example": "2016-12-29T22:51:13.729+00:00"
          },
          "equities-margin-calculation-type": {
            "description": "How equities margin is computed for the account, for example `Reg T`.",
            "type": "string",
            "example": "Reg T"
          },
          "ext-crm-id": {
            "description": "External CRM identifier associated with the account.",
            "type": "string",
            "example": ""
          },
          "fee-schedule-name": {
            "description": "Name of the fee schedule applied to the account.",
            "type": "string",
            "example": "default"
          },
          "futures-margin-rate-multiplier": {
            "description": "The account's intraday futures margin multiplier. When greater than zero, eligible outright futures positions held intraday are margined at the standard requirement divided by this value (for example `2` halves the intraday requirement); `0` means the account has no intraday futures margin and standard requirements apply. The maximum multiplier scales with the account's net liquidating value. Decimal value serialized as a JSON string (e.g. \"150.25\").",
            "type": "string",
            "format": "decimal",
            "example": "0.0"
          },
          "has-intraday-equities-margin": {
            "description": "Whether intraday equities margin treatment is enabled for the account.",
            "type": "boolean",
            "example": false
          },
          "is-aggregated-at-clearing": {
            "description": "Whether the account is aggregated with others at the clearing firm.",
            "type": "boolean",
            "example": false
          },
          "is-ascend-event-contracts-enabled": {
            "description": "Whether Ascend event contracts are enabled for the account.",
            "type": "boolean",
            "example": false
          },
          "is-closed": {
            "description": "Whether the account is closed. When true, trading is blocked entirely.",
            "type": "boolean",
            "example": false
          },
          "is-closing-only": {
            "description": "Whether the account is restricted to closing trades only. When true, only orders that close existing positions are allowed.",
            "type": "boolean",
            "example": false
          },
          "is-cryptocurrency-closing-only": {
            "description": "Whether cryptocurrency activity is restricted to closing trades only.",
            "type": "boolean",
            "example": false
          },
          "is-cryptocurrency-enabled": {
            "description": "Whether the account may trade cryptocurrency.",
            "type": "boolean",
            "example": true
          },
          "is-equity-offering-closing-only": {
            "description": "Whether equity offering activity is restricted to closing trades only.",
            "type": "boolean",
            "example": false
          },
          "is-equity-offering-enabled": {
            "description": "Whether the account may participate in equity offerings.",
            "type": "boolean",
            "example": false
          },
          "is-frozen": {
            "description": "Whether the account is frozen. When true, trading is blocked entirely.",
            "type": "boolean",
            "example": false
          },
          "is-full-equity-margin-required": {
            "description": "Whether full equity margin is required for the account.",
            "type": "boolean",
            "example": false
          },
          "is-futures-closing-only": {
            "description": "Whether futures activity is restricted to closing trades only.",
            "type": "boolean",
            "example": false
          },
          "is-futures-enabled": {
            "description": "Whether the account may trade futures.",
            "type": "boolean",
            "example": true
          },
          "is-futures-intra-day-enabled": {
            "description": "Whether intraday futures trading is enabled for the account.",
            "type": "boolean",
            "example": false
          },
          "is-in-day-trade-equity-maintenance-call": {
            "description": "Whether the account has an outstanding day-trade equity maintenance call.",
            "type": "boolean",
            "example": false
          },
          "is-in-margin-call": {
            "description": "Whether the account has an outstanding margin call.",
            "type": "boolean",
            "example": false
          },
          "is-non-retail": {
            "description": "Whether the account is classified as non-retail.",
            "type": "boolean",
            "example": false
          },
          "is-pattern-day-trader": {
            "description": "Whether pattern day trader (PDT) rules apply to the account.",
            "type": "boolean",
            "example": false
          },
          "is-portfolio-margin-enabled": {
            "description": "Whether portfolio margin is enabled for the account.",
            "type": "boolean",
            "example": false
          },
          "is-risk-reducing-only": {
            "description": "Whether the account is restricted to risk-reducing (de-risking) activity only.",
            "type": "boolean",
            "example": false
          },
          "is-roll-the-day-forward-enabled": {
            "description": "Whether roll-the-day-forward is enabled for the account.",
            "type": "boolean",
            "example": true
          },
          "is-small-notional-futures-intra-day-enabled": {
            "description": "Whether intraday trading of small-notional futures is enabled for the account.",
            "type": "boolean",
            "example": false
          },
          "options-level": {
            "description": "Highest options strategy tier permitted for the account, for example `No Restrictions`.",
            "type": "string",
            "example": "No Restrictions"
          },
          "pdt-reset-on": {
            "description": "Date on which the account's pattern day trader status resets, when applicable.",
            "type": "string",
            "format": "date",
            "example": "2023-06-30"
          },
          "short-calls-enabled": {
            "description": "Whether the account may write (sell) short call options.",
            "type": "boolean",
            "example": true
          },
          "small-notional-futures-margin-rate-multiplier": {
            "description": "Intraday margin multiplier applied to small-notional futures products (for example micro contracts), with the same semantics as `futures-margin-rate-multiplier`: the intraday requirement is the standard requirement divided by this value, and `0` disables intraday treatment. Decimal value serialized as a JSON string (e.g. \"150.25\").",
            "type": "string",
            "format": "decimal",
            "example": "0.0"
          },
          "updated-at": {
            "description": "Timestamp at which the trading status was last updated.",
            "type": "string",
            "format": "date-time",
            "example": "2023-06-29T20:51:57.617+00:00"
          }
        },
        "description": "Reports whether and how an account may trade. Combines hard gates (`is-closed`, `is-frozen`, `is-closing-only`, `is-risk-reducing-only`) with per-feature toggles, margin-call flags, the live `day-trade-count`, the permitted `options-level`, and margin-calculation settings."
      }
    }
  },
  "x-tastytrade-service": {
    "serviceName": "account-trade-status-api",
    "group": "account-status",
    "title": "Account Status"
  }
}