curl --request PUT \
--url https://api.unusualwhales.com/api/watchlists/stocks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"color": "blue",
"name": "Semiconductors",
"tickers": [
"NVDA",
"AMD",
"TSM"
]
}
'import requests
url = "https://api.unusualwhales.com/api/watchlists/stocks/{id}"
payload = {
"color": "blue",
"name": "Semiconductors",
"tickers": ["NVDA", "AMD", "TSM"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({color: 'blue', name: 'Semiconductors', tickers: ['NVDA', 'AMD', 'TSM']})
};
fetch('https://api.unusualwhales.com/api/watchlists/stocks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unusualwhales.com/api/watchlists/stocks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'color' => 'blue',
'name' => 'Semiconductors',
'tickers' => [
'NVDA',
'AMD',
'TSM'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unusualwhales.com/api/watchlists/stocks/{id}"
payload := strings.NewReader("{\n \"color\": \"blue\",\n \"name\": \"Semiconductors\",\n \"tickers\": [\n \"NVDA\",\n \"AMD\",\n \"TSM\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.unusualwhales.com/api/watchlists/stocks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"blue\",\n \"name\": \"Semiconductors\",\n \"tickers\": [\n \"NVDA\",\n \"AMD\",\n \"TSM\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unusualwhales.com/api/watchlists/stocks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"blue\",\n \"name\": \"Semiconductors\",\n \"tickers\": [\n \"NVDA\",\n \"AMD\",\n \"TSM\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"color": "blue",
"id": "6b3c1e8a-58f4-4a7e-9c55-0f3c2f7f5a10",
"name": "Semiconductors",
"tickers": [
"NVDA",
"AMD",
"TSM"
]
}
}{
"msg": "Invalid path input: MSFT12 (valid example: AAPL) - Invalid query input(s): date=2023-02-140 (valid example: date=2024-01-18)",
"path": "/api/darkpool/MSFT12",
"query": "date=2023-02-140",
"url": "localhost:4000/api/darkpool/MSFT12?date=2023-02-140"
}{
"code": "authentication_required",
"documentation_url": "https://api.unusualwhales.com/docs",
"expected_format": "uuid",
"message": "The API token provided is not in the expected format. Unusual Whales API tokens are UUIDs, such as 123e4567-e89b-12d3-a456-426614174000.",
"reason": "malformed_token",
"request_id": "GNI_YTC1CRnw2LACGBvE",
"retryable": false,
"support_email": "[email protected]",
"token_url": "https://unusualwhales.com/dashboard/api"
}{
"code": "payment_required",
"documentation_url": "https://api.unusualwhales.com/docs",
"message": "This API token is paused because the payment for your API subscription failed. Update your card at https://unusualwhales.com/settings. The same token works again once a payment succeeds.",
"reason": "payment_failed",
"request_id": "GNI_YTC1CRnw2LACGBvE",
"retryable": false,
"support_email": "[email protected]",
"token_url": "https://unusualwhales.com/dashboard/api"
}{
"code": "missing_access",
"documentation_url": "https://api.unusualwhales.com/docs",
"message": "The API token provided is valid but is not permitted to access this route.",
"reason": "route_not_permitted",
"request_id": "GNI_YTC1CRnw2LACGBvE",
"retryable": false,
"support_email": "[email protected]",
"token_url": "https://unusualwhales.com/dashboard/api"
}{
"msg": "Invalid path input: MSFT12 (valid example: AAPL) - Invalid query input(s): date=2023-02-140 (valid example: date=2024-01-18)",
"path": "/api/darkpool/MSFT12",
"query": "date=2023-02-140",
"url": "localhost:4000/api/darkpool/MSFT12?date=2023-02-140"
}Something went wrongUpdate stock watchlist
Replaces the name, tickers and color of a stock watchlist.
WARNING: This endpoint replaces the whole watchlist. Tickers missing from tickers are removed from the watchlist.
To add or remove single tickers without sending the full list, use POST /api/watchlists/stocks/{id}/add-tickers or POST /api/watchlists/stocks/{id}/remove-tickers.
When color is left out, the watchlist keeps its color.
Unknown tickers and tickers without recent stock prices are left out of the watchlist. The request fails when none of the tickers remain. Default views provided by Unusual Whales cannot be updated and return 404.
curl --request PUT \
--url https://api.unusualwhales.com/api/watchlists/stocks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"color": "blue",
"name": "Semiconductors",
"tickers": [
"NVDA",
"AMD",
"TSM"
]
}
'import requests
url = "https://api.unusualwhales.com/api/watchlists/stocks/{id}"
payload = {
"color": "blue",
"name": "Semiconductors",
"tickers": ["NVDA", "AMD", "TSM"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({color: 'blue', name: 'Semiconductors', tickers: ['NVDA', 'AMD', 'TSM']})
};
fetch('https://api.unusualwhales.com/api/watchlists/stocks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unusualwhales.com/api/watchlists/stocks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'color' => 'blue',
'name' => 'Semiconductors',
'tickers' => [
'NVDA',
'AMD',
'TSM'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unusualwhales.com/api/watchlists/stocks/{id}"
payload := strings.NewReader("{\n \"color\": \"blue\",\n \"name\": \"Semiconductors\",\n \"tickers\": [\n \"NVDA\",\n \"AMD\",\n \"TSM\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.unusualwhales.com/api/watchlists/stocks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"blue\",\n \"name\": \"Semiconductors\",\n \"tickers\": [\n \"NVDA\",\n \"AMD\",\n \"TSM\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unusualwhales.com/api/watchlists/stocks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"blue\",\n \"name\": \"Semiconductors\",\n \"tickers\": [\n \"NVDA\",\n \"AMD\",\n \"TSM\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"color": "blue",
"id": "6b3c1e8a-58f4-4a7e-9c55-0f3c2f7f5a10",
"name": "Semiconductors",
"tickers": [
"NVDA",
"AMD",
"TSM"
]
}
}{
"msg": "Invalid path input: MSFT12 (valid example: AAPL) - Invalid query input(s): date=2023-02-140 (valid example: date=2024-01-18)",
"path": "/api/darkpool/MSFT12",
"query": "date=2023-02-140",
"url": "localhost:4000/api/darkpool/MSFT12?date=2023-02-140"
}{
"code": "authentication_required",
"documentation_url": "https://api.unusualwhales.com/docs",
"expected_format": "uuid",
"message": "The API token provided is not in the expected format. Unusual Whales API tokens are UUIDs, such as 123e4567-e89b-12d3-a456-426614174000.",
"reason": "malformed_token",
"request_id": "GNI_YTC1CRnw2LACGBvE",
"retryable": false,
"support_email": "[email protected]",
"token_url": "https://unusualwhales.com/dashboard/api"
}{
"code": "payment_required",
"documentation_url": "https://api.unusualwhales.com/docs",
"message": "This API token is paused because the payment for your API subscription failed. Update your card at https://unusualwhales.com/settings. The same token works again once a payment succeeds.",
"reason": "payment_failed",
"request_id": "GNI_YTC1CRnw2LACGBvE",
"retryable": false,
"support_email": "[email protected]",
"token_url": "https://unusualwhales.com/dashboard/api"
}{
"code": "missing_access",
"documentation_url": "https://api.unusualwhales.com/docs",
"message": "The API token provided is valid but is not permitted to access this route.",
"reason": "route_not_permitted",
"request_id": "GNI_YTC1CRnw2LACGBvE",
"retryable": false,
"support_email": "[email protected]",
"token_url": "https://unusualwhales.com/dashboard/api"
}{
"msg": "Invalid path input: MSFT12 (valid example: AAPL) - Invalid query input(s): date=2023-02-140 (valid example: date=2024-01-18)",
"path": "/api/darkpool/MSFT12",
"query": "date=2023-02-140",
"url": "localhost:4000/api/darkpool/MSFT12?date=2023-02-140"
}Something went wrongAuthorizations
Body
Stock watchlist
The name, tickers and color of a stock watchlist. Unknown tickers and tickers without recent stock prices are left out of the watchlist.
Was this page helpful?
