API Reference / Risk Parameters
Get Account Position Limit
getAccountsAccountNumberPositionLimit/accounts/{account_number}/position-limitBase URL: https://api.cert.tastyworks.com (Sandbox) · https://api.tastyworks.com (Production)
Returns the position and order size limits configured for an account, broken out by instrument type (equities, equity options, futures, and future options). Use this to validate order and position sizing before submitting orders.
Code samples
curl -X GET 'https://api.cert.tastyworks.com/accounts/5WX01234/position-limit' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'User-Agent: tastytrade-docs-example/1.0'import requests
url = "https://api.cert.tastyworks.com/accounts/5WX01234/position-limit"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"User-Agent": "tastytrade-docs-example/1.0",
}
resp = requests.get(url, headers=headers)
print(resp.status_code, resp.json())const resp = await fetch("https://api.cert.tastyworks.com/accounts/5WX01234/position-limit", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"User-Agent": "tastytrade-docs-example/1.0",
},
})
const data = await resp.json()
console.log(resp.status, data)package main
import (
"net/http"
"io"
"fmt"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.cert.tastyworks.com/accounts/5WX01234/position-limit", nil)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("User-Agent", "tastytrade-docs-example/1.0")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.cert.tastyworks.com/accounts/5WX01234/position-limit"))
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("User-Agent", "tastytrade-docs-example/1.0")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.statusCode() + " " + resp.body());Parameters
| Name | In | Type | Description |
|---|---|---|---|
| account_number* | path | string | e.g. "5WX01234" |
Responses
Example response
{
"data": {
"id": 12345,
"account-number": "5WX01234",
"equity-option-order-size": 2500,
"equity-order-size": 10000,
"future-option-order-size": 100,
"future-order-size": 100,
"underlying-opening-order-limit": 5000,
"equity-option-position-size": 10000,
"equity-position-size": 50000,
"future-option-position-size": 500,
"future-position-size": 500
},
"context": "/accounts/{account_number}/position-limit"
}Schema
datarequiredobject (PositionLimit)The maximum order and position sizes permitted for an account, broken out by instrument type.
idinteger <int32>Unique identifier for this position-limit record.
example:
12345account-numberstringThe account these limits apply to.
example:
"5WX01234"equity-option-order-sizeinteger <int32>Maximum number of contracts allowed on a single equity option order.
example:
2500equity-order-sizeinteger <int32>Maximum number of shares allowed on a single equity order.
example:
10000future-option-order-sizeinteger <int32>Maximum number of contracts allowed on a single future option order.
example:
100future-order-sizeinteger <int32>Maximum number of contracts allowed on a single futures order.
example:
100underlying-opening-order-limitinteger <int32>Maximum opening order size permitted per underlying.
example:
5000equity-option-position-sizeinteger <int32>Maximum aggregate equity option position size, in contracts.
example:
10000equity-position-sizeinteger <int32>Maximum aggregate equity position size, in shares.
example:
50000future-option-position-sizeinteger <int32>Maximum aggregate future option position size, in contracts.
example:
500future-position-sizeinteger <int32>Maximum aggregate futures position size, in contracts.
example:
500
contextrequiredstringexample:
"/accounts/{account_number}/position-limit"
Example response
{
"error": {
"code": "unauthorized",
"message": "No valid access token was provided; access tokens expire after 15 minutes."
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Example response
{
"error": {
"code": "not_permitted",
"message": "User not permitted access"
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Example response
{
"error": {
"code": "string",
"message": "string",
"errors": [
{
"code": "string",
"message": "string",
"domain": "string"
}
]
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Example response
{
"error": {
"code": "string",
"message": "string",
"errors": [
{
"code": "string",
"message": "string",
"domain": "string"
}
]
}
}Schema
errorrequiredobjectcoderequiredstringMachine-readable error code (see the Error reference).
messagerequiredstringHuman-readable explanation.
errorsarray<object>{3 fields}Present for multi-error / validation failures; one entry per problem.
Related
- Rate-limit class:
read· idempotent — Rate limits & backoff - Error reference — codes, causes, and fixes
Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.