{"openapi":"3.1.0","info":{"title":"Stock Compass API","version":"1","description":"Read and record a Stock Compass user's watchlist, signals, trades, journal, alerts, cash and dividends with a personal API key (Pro). 60 requests a minute per key. Full reference: https://github.com/Stock-Compass/stock-compass-plugin/blob/main/skills/stock-compass/references/api.md","license":{"name":"Stock Compass Terms of Service","url":"https://stock-compass.app/en/terms"},"contact":{"name":"Stock Compass support","email":"support@stock-compass.app","url":"https://stock-compass.app/en/about"}},"externalDocs":{"description":"API reference","url":"https://github.com/Stock-Compass/stock-compass-plugin/blob/main/skills/stock-compass/references/api.md"},"servers":[{"url":"https://stock-compass.app/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A personal API key (sc_…), created under Settings → AI apps & API."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"reason":{"type":"string","description":"Which case of code this is, where a code covers several (exists: on_watchlist, external_id_recorded, external_id_in_batch, same_alert)."},"message":{"type":"string"},"request_id":{"type":"string"}}}}}}},"paths":{"/me":{"get":{"operationId":"getMe","summary":"Who the key acts for, what it may do, and when the key and the plan end.","description":"Needs a key with the read scope.","responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/watchlist":{"get":{"operationId":"getWatchlist","summary":"The watchlist and holdings, with stops, targets, stop history, exit mode, and when the target was reached or the stop went through.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}},{"name":"holding","in":"query","description":"true: holdings only; false: stocks not held.","schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"Page size, 1 to 1000.","schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","description":"Rows to skip. Default 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postWatchlist","summary":"Add a stock to the watchlist.","description":"Needs a key with the watchlist:write scope or the write scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["market","ticker"],"properties":{"market":{"type":"string","enum":["hk","us","cn"]},"ticker":{"type":"string"}}}}}},"responses":{"201":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/watchlist/{ticker}":{"delete":{"operationId":"deleteWatchlistTicker","summary":"Remove a stock that is not held from the watchlist, with its price alerts.","description":"Needs a key with the watchlist:write scope or the write scope.","parameters":[{"name":"ticker","in":"path","required":true,"description":"The stock.","schema":{"type":"string"}},{"name":"market","in":"query","description":"Optional when the ticker carries its suffix, as in 0700.HK.","schema":{"type":"string","enum":["hk","us","cn"]}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signals":{"get":{"operationId":"getSignals","summary":"Buy, add, trim and exit signals of the strategy in use on each date, and fired price alerts. Newest first.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}},{"name":"days","in":"query","description":"Days back from today in the market. 0 to 90, default 7.","schema":{"type":"integer","minimum":0,"maximum":90}},{"name":"from","in":"query","description":"Start date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"End date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"ticker","in":"query","description":"One stock, as 700, 0700.HK, 600519 or AAPL. Without market, the market is read from the code.","schema":{"type":"string"}},{"name":"types","in":"query","description":"Comma-separated: buy, add, exit, trim, price_alert. Default buy,add,exit,trim.","schema":{"type":"string"}},{"name":"state","in":"query","description":"all (default), new: the first day of each run, or active.","schema":{"type":"string","enum":["all","new","active"]}},{"name":"recorded_after","in":"query","description":"Only signals recorded after this time. For polling.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","description":"Page size, 1 to 500.","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","description":"Rows to skip. Default 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trades":{"get":{"operationId":"getTrades","summary":"Recorded trades, with fees or estimated fees.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}},{"name":"ticker","in":"query","description":"One stock, as 700, 0700.HK, 600519 or AAPL. Without market, the market is read from the code.","schema":{"type":"string"}},{"name":"from","in":"query","description":"Start date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"End date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"external_id","in":"query","description":"The client's own id for a trade.","schema":{"type":"string"}},{"name":"tag","in":"query","description":"Only trades carrying this tag.","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, 1 to 500.","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","description":"Rows to skip. Default 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postTrades","summary":"Record a buy or sell the user made. Cash, holding, lots and journal move in one transaction.","description":"Needs a key with the trades:write scope or the write scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["market","ticker","type","price","quantity"],"properties":{"market":{"type":"string","enum":["hk","us","cn"]},"ticker":{"type":"string"},"type":{"type":"string","enum":["buy","sell"]},"price":{"type":"number","description":"Per share, without fees."},"quantity":{"type":"integer","minimum":1},"traded_at":{"type":"string","format":"date","description":"Trade date in the market. Default: today there."},"executed_at":{"type":"string","format":"date-time","description":"Execution time with its offset; orders trades within a date."},"trigger":{"type":"string","enum":["signal","manual","other"],"description":"Buy only: why it was bought."},"stop":{"type":"number","description":"Buy only: planned stop."},"target":{"type":"number","description":"Buy only: planned target."},"thesis":{"type":"string","maxLength":1000,"description":"Buy only."},"close_reason":{"type":"string","enum":["rule_exit","rule_trim","manual_stop","manual_target","other"],"description":"Sell only."},"lesson":{"type":"string","maxLength":1000,"description":"Sell only."},"add_to_watchlist":{"type":"boolean","description":"Buy of a stock not on the watchlist: add it first."},"external_id":{"type":"string","minLength":1,"maxLength":100,"description":"The client's id, such as a broker order number. Sent again, it answers 409 with the first trade."},"fees":{"type":"number","minimum":0,"description":"What the broker charged. Without it, estimated from the trading-cost settings."},"exit_mode":{"type":"string","enum":["strategy","levels_only","external"],"description":"Buy only."},"allow_out_of_order":{"type":"boolean","description":"Record a trade dated before trades already recorded for the stock."},"tags":{"type":"array","maxItems":10,"items":{"type":"string","minLength":1,"maxLength":40},"description":"The client's labels for the trade, such as its source. A buy's journal entry keeps them, through partial sales."}}}}}},"responses":{"201":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request is well formed but cannot be acted on (no_recent_signal).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This part of the API is not available yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trades/batch":{"post":{"operationId":"postTradesBatch","summary":"Record up to 50 trades in one request, in order, each as POST /trades does; or with dry_run, say which are new, already recorded, or in conflict. With atomic, all or none.","description":"Needs a key with the trades:write scope or the write scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["trades"],"properties":{"trades":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"A trade, as the POST /trades body."}},"dry_run":{"type":"boolean","description":"Record nothing; classify each trade as new, match, conflict or invalid."},"on_error":{"type":"string","enum":["stop","continue"],"description":"After a refused trade: stop (default) or go on with the rest."},"atomic":{"type":"boolean","description":"Record every trade in one transaction, or none if any is refused. Not with on_error."}}}}}},"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trades/{id}":{"patch":{"operationId":"patchTradesId","summary":"Correct a recorded trade: price, quantity, date or fees.","description":"Needs a key with the trades:write scope or the write scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The trade id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"number"},"quantity":{"type":"integer","minimum":1},"traded_at":{"type":"string","format":"date"},"fees":{"type":"number","minimum":0}}}}}},"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteTradesId","summary":"Delete a trade recorded by mistake; cash and holding are put back.","description":"Needs a key with the trades:write scope or the write scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The trade id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/journal":{"get":{"operationId":"getJournal","summary":"Trade journal entries: thesis, trigger, plan, close reason, lesson, realized return.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}},{"name":"status","in":"query","description":"all (default), open or closed.","schema":{"type":"string","enum":["all","open","closed"]}},{"name":"ticker","in":"query","description":"One stock, as 700, 0700.HK, 600519 or AAPL. Without market, the market is read from the code.","schema":{"type":"string"}},{"name":"from","in":"query","description":"Start date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"End date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"trigger","in":"query","description":"Why it was bought.","schema":{"type":"string","enum":["signal","price_alert","manual","imported","other"]}},{"name":"tag","in":"query","description":"Only entries carrying this tag.","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, 1 to 500.","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","description":"Rows to skip. Default 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/journal/stats":{"get":{"operationId":"getJournalStats","summary":"The journal page's figures for one market: by rules against by gut feel.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","required":true,"description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}},{"name":"from","in":"query","description":"Entries opened on or after this date.","schema":{"type":"string","format":"date"}},{"name":"group_by","in":"query","description":"tag: adds by_tag, the closed trades under each tag.","schema":{"type":"string","enum":["tag"]}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/strategies":{"get":{"operationId":"getStrategies","summary":"The user's strategies, with the one in use in each market.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/strategies/{id}":{"get":{"operationId":"getStrategiesId","summary":"One strategy with its rules.","description":"Needs a key with the read scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The strategy id, as a signal gives it.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/positions/{ticker}":{"patch":{"operationId":"patchPositionsTicker","summary":"Set or clear a holding's stop and target, and how its exits are watched.","description":"Needs a key with the positions:write scope or the write scope.","parameters":[{"name":"ticker","in":"path","required":true,"description":"The stock held.","schema":{"type":"string"}},{"name":"market","in":"query","description":"Optional when the ticker carries its suffix.","schema":{"type":"string","enum":["hk","us","cn"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stop":{"type":["number","null"],"description":"null clears it."},"target":{"type":["number","null"],"description":"null clears it."},"exit_mode":{"type":"string","enum":["strategy","levels_only","external"]}}}}}},"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This part of the API is not available yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/alerts":{"get":{"operationId":"getAlerts","summary":"The user's price alerts.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postAlerts","summary":"Create a price alert. A stock not on the watchlist is checked at its quote source first (404 unknown_ticker).","description":"Needs a key with the alerts:write scope or the write scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["market","ticker","direction","threshold"],"properties":{"market":{"type":"string","enum":["hk","us","cn"]},"ticker":{"type":"string"},"direction":{"type":"string","enum":["above","below"]},"threshold":{"type":"number"},"note":{"type":"string","maxLength":1000}}}}}},"responses":{"201":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/alerts/{id}":{"patch":{"operationId":"patchAlertsId","summary":"Change a price alert: its level, its note, or watch a fired one again.","description":"Needs a key with the alerts:write scope or the write scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The alert id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"threshold":{"type":"number"},"note":{"type":["string","null"]},"rearm":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteAlertsId","summary":"Delete a price alert.","description":"Needs a key with the alerts:write scope or the write scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The alert id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account":{"get":{"operationId":"getAccount","summary":"The cash tracked in each market.","description":"Needs a key with the read scope.","responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cash/{market}":{"put":{"operationId":"putCashMarket","summary":"Set a market's cash balance; null stops tracking it.","description":"Needs a key with the write scope.","parameters":[{"name":"market","in":"path","required":true,"description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cash"],"properties":{"cash":{"type":["number","null"]}}}}}},"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"get":{"operationId":"getEvents","summary":"The writes made through API keys and connected apps, newest first: what, when, through which key or app, and what changed.","description":"Needs a key with the read scope.","parameters":[{"name":"action","in":"query","description":"One action or a comma list, such as trade.record,trade.delete.","schema":{"type":"string"}},{"name":"ticker","in":"query","description":"One stock, as 700, 0700.HK, 600519 or AAPL. Without market, the market is read from the code.","schema":{"type":"string"}},{"name":"since","in":"query","description":"Only writes after this time (ISO 8601).","schema":{"type":"string"}},{"name":"until","in":"query","description":"Only writes up to this time (ISO 8601).","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, 1 to 500.","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","description":"Rows to skip. Default 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dividends":{"get":{"operationId":"getDividends","summary":"Dividends received, newest ex-dividend date first.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}},{"name":"ticker","in":"query","description":"One stock, as 700, 0700.HK, 600519 or AAPL. Without market, the market is read from the code.","schema":{"type":"string"}},{"name":"from","in":"query","description":"Start date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"End date, inclusive.","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","description":"Page size, 1 to 500.","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","description":"Rows to skip. Default 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postDividends","summary":"Record a dividend received; with cash_amount, the cash goes up by it.","description":"Needs a key with the write scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["market","ticker","ex_div_date","dps","shares"],"properties":{"market":{"type":"string","enum":["hk","us","cn"]},"ticker":{"type":"string"},"ex_div_date":{"type":"string","format":"date"},"pay_date":{"type":"string","format":"date"},"dps":{"type":"number","description":"Dividend per share."},"shares":{"type":"number"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Default: the market's."},"cash_amount":{"type":"number","description":"What arrived in cash after tax. Without it, no cash moves."},"note":{"type":"string","maxLength":1000},"external_id":{"type":"string","minLength":1,"maxLength":100,"description":"The client's id. Sent again, it answers 409 with the first dividend."}}}}}},"responses":{"201":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"string"},"description":"Only when the body had fields this request did not use, such as a misspelt one: the write went through, and this names them, as paths like qty or trades[1].qty."}}}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The change conflicts with what is recorded (exists, oversell, out_of_order, not_on_watchlist, from_plan).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"This part of the API is not available yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dividends/{id}":{"delete":{"operationId":"deleteDividendsId","summary":"Delete a dividend recorded by mistake; what it added to cash is taken back.","description":"Needs a key with the write scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The dividend id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Nothing with that id or ticker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reconcile/positions":{"post":{"operationId":"postReconcilePositions","summary":"Compare the holdings recorded here with a broker's, for one market. Read-only: needs the read scope and changes nothing.","description":"Needs a key with the read scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["market","positions"],"properties":{"market":{"type":"string","enum":["hk","us","cn"]},"positions":{"type":"array","maxItems":2000,"description":"The broker's holdings in this market.","items":{"type":"object","required":["ticker","quantity"],"properties":{"ticker":{"type":"string"},"quantity":{"type":"number","minimum":0}}}}}}}}},"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/export":{"get":{"operationId":"getExport","summary":"Every record of your own in one answer: watchlist, trades, journal, price alerts, strategies with their rules, dividends and cash. No keys, apps or grants.","description":"Needs a key with the read scope.","responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/settings/trading-costs":{"get":{"operationId":"getSettingsTradingCosts","summary":"The fee settings estimated_fees is worked out from, with the formula.","description":"Needs a key with the read scope.","parameters":[{"name":"market","in":"query","required":true,"description":"hk, us or cn.","schema":{"type":"string","enum":["hk","us","cn"]}}],"responses":{"200":{"description":"The answer, as the reference describes it.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Identifies this request."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"A field is missing or not valid (bad_request, bad_ticker).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No key, or the key is unknown, revoked or expired (unauthorized, key_revoked, key_expired).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, the account is not on Pro, or a limit is reached (scope, pro_required, limit).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute; Retry-After says how many seconds to wait.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until requests are taken again."},"RateLimit-Limit":{"schema":{"type":"integer"},"description":"Requests allowed a minute: 60."},"RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Requests left in this minute."},"RateLimit-Reset":{"schema":{"type":"integer"},"description":"Seconds until this minute ends and the count starts again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong; quote the x-request-id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}