Replace Watchlist
putWatchlistsWatchlistName/watchlists/{watchlist_name}Base URL: https://api.cert.tastyworks.com (Sandbox) · https://api.tastyworks.com (Production)
Replaces **all** properties of an existing user watchlist — this is a full replacement, not a merge, so send the complete `watchlist-entries` array you want to keep; omitted entries are removed.
Code samples
curl -X PUT 'https://api.cert.tastyworks.com/watchlists/{watchlist_name}' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'User-Agent: tastytrade-docs-example/1.0' \
-H 'Content-Type: application/json' \
-d '{
"name": "Tech Megacaps",
"group-name": "Sectors",
"order-index": 10,
"watchlist-entries": [
{
"symbol": "AAPL",
"instrument-type": "Equity"
},
{
"symbol": "MSFT",
"instrument-type": "Equity"
},
{
"symbol": "NVDA",
"instrument-type": "Equity"
}
]
}'import requests
import json
url = "https://api.cert.tastyworks.com/watchlists/{watchlist_name}"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"User-Agent": "tastytrade-docs-example/1.0",
}
payload = json.loads("""
{
"name": "Tech Megacaps",
"group-name": "Sectors",
"order-index": 10,
"watchlist-entries": [
{
"symbol": "AAPL",
"instrument-type": "Equity"
},
{
"symbol": "MSFT",
"instrument-type": "Equity"
},
{
"symbol": "NVDA",
"instrument-type": "Equity"
}
]
}
""")
resp = requests.put(url, headers=headers, json=payload)
print(resp.status_code, resp.json())const resp = await fetch("https://api.cert.tastyworks.com/watchlists/{watchlist_name}", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"User-Agent": "tastytrade-docs-example/1.0",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Tech Megacaps",
"group-name": "Sectors",
"order-index": 10,
"watchlist-entries": [
{
"symbol": "AAPL",
"instrument-type": "Equity"
},
{
"symbol": "MSFT",
"instrument-type": "Equity"
},
{
"symbol": "NVDA",
"instrument-type": "Equity"
}
]
}),
})
const data = await resp.json()
console.log(resp.status, data)package main
import (
"net/http"
"io"
"fmt"
"strings"
)
func main() {
body := strings.NewReader(`{
"name": "Tech Megacaps",
"group-name": "Sectors",
"order-index": 10,
"watchlist-entries": [
{
"symbol": "AAPL",
"instrument-type": "Equity"
},
{
"symbol": "MSFT",
"instrument-type": "Equity"
},
{
"symbol": "NVDA",
"instrument-type": "Equity"
}
]
}`)
req, _ := http.NewRequest("PUT", "https://api.cert.tastyworks.com/watchlists/{watchlist_name}", body)
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("User-Agent", "tastytrade-docs-example/1.0")
req.Header.Set("Content-Type", "application/json")
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/watchlists/{watchlist_name}"))
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("User-Agent", "tastytrade-docs-example/1.0")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("""
{
"name": "Tech Megacaps",
"group-name": "Sectors",
"order-index": 10,
"watchlist-entries": [
{
"symbol": "AAPL",
"instrument-type": "Equity"
},
{
"symbol": "MSFT",
"instrument-type": "Equity"
},
{
"symbol": "NVDA",
"instrument-type": "Equity"
}
]
}
"""))
.build();
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.statusCode() + " " + resp.body());Parameters
| Name | In | Type | Description |
|---|---|---|---|
| watchlist_name* | path | string |
Request bodyrequiredapplication/json
Example
{
"name": "Tech Megacaps",
"group-name": "Sectors",
"order-index": 10,
"watchlist-entries": [
{
"symbol": "AAPL",
"instrument-type": "Equity"
},
{
"symbol": "MSFT",
"instrument-type": "Equity"
},
{
"symbol": "NVDA",
"instrument-type": "Equity"
}
]
}Schema
namerequiredstringThe watchlist name.
example:
"Tech Megacaps"group-namestringOptional group the watchlist belongs to, used to organize related watchlists.
example:
"Sectors"order-indexinteger <int32>Optional order index of the watchlist. Defaults to `9999`.
example:
10watchlist-entriesrequiredarray<object>The complete set of instruments to keep. Each entry requires a `symbol`; `instrument-type` is optional.
example:
[{"symbol":"AAPL","instrument-type":"Equity"},{"symbol":"MSFT","instrument-type":"Equity"},{"symbol":"NVDA","instrument-type":"Equity"}]symbolrequiredstringThe instrument symbol
instrument-typestringThe instrument type
Responses
Example response
{
"data": {
"name": "Tech Megacaps",
"watchlist-entries": {},
"cms-id": "tt-tech-megacaps",
"group-name": "Sectors",
"order-index": 10
},
"context": "/watchlists/{watchlist_name}"
}Schema
datarequiredobject (Watchlist)A named collection of instruments to track. Used for both user watchlists and read-only public watchlists. JSON keys are dasherized.
namestringThe name of the watchlist. For user watchlists it is the `watchlist_name` path parameter; URL-encode it when it contains spaces.
example:
"Tech Megacaps"watchlist-entriesobjectThe instruments being watched. Each entry has a `symbol` and an optional `instrument-type`.
cms-idstringContent management system identifier of the watchlist.
example:
"tt-tech-megacaps"group-namestringThe group this watchlist belongs to, used to organize related watchlists.
example:
"Sectors"order-indexinteger <int32>The order index of the watchlist.
example:
10
contextrequiredstringexample:
"/watchlists/{watchlist_name}"
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": "preflight_check_failure",
"message": "One or more preflight checks failed",
"errors": [
{
"code": "preflight_check_failure",
"message": "A specific validation failed for this order."
}
]
}
}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:
write· 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.