tastytradeDeveloper Docs
Legacy ↗

API Reference / Margin Requirements

Get Account Margin Requirements

getMarginAccountsAccountNumberRequirements
get/margin/accounts/{account_number}/requirements

Base URL: https://api.tastyworks.com ()

Returns the account's current margin and capital requirements report, grouped by underlying symbol. The top level summarizes the whole account (margin-requirement, maintenance-requirement, margin-equity, maintenance-excess, and buying-power figures, including separate reg-t-* values), while each entry under groups breaks down one underlying with its own requirement totals, position-entries, and price-increase-percent / price-decrease-percent values. Read this to understand how much of the account is committed to margin before placing new orders.

Code samples

curl -X GET 'https://api.tastyworks.com/margin/accounts/5WX01234/requirements' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'User-Agent: tastytrade-docs-example/1.0'

Parameters

NameInTypeDescription
account_number*pathstring
e.g. "5WX01234"

Responses

200The account's current margin/capital requirements report, grouped by underlying symbol.application/json
401Authentication failed. The Authorization bearer token is missing, expired (access tokens last 15 minutes), or the required User-Agent header is missing or malformed.application/json

Example response

{
  "error": {
    "code": "unauthorized",
    "message": "No valid access token was provided; access tokens expire after 15 minutes."
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

403Forbidden. The token is valid but its scope or the account's authority level does not permit reading this account's margin requirements.application/json

Example response

{
  "error": {
    "code": "not_permitted",
    "message": "User not permitted access"
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

404No account was found for the supplied account_number, or the wrong environment was used (sandbox vs production).application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

429Rate limit exceeded. Back off exponentially and reduce the request rate.application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

Related

Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.