{"components":{"examples":{"CryptoOrderResponse":{"value":{"asset_class":"crypto","asset_id":"a1733398-6acc-4e92-af24-0d0667f78713","canceled_at":null,"client_order_id":"5b5d3d67-06ad-4ffa-af65-a117d0fc5a59","created_at":"2023-12-12T22:36:51.337711497Z","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"38e482f3-79a8-4f75-a057-f07a1ec6a397","legs":null,"limit_price":"2100","notional":null,"order_class":"","order_type":"limit","qty":"0.02","replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","source":null,"status":"pending_new","stop_price":null,"submitted_at":"2023-12-12T22:36:51.313261061Z","subtag":null,"symbol":"ETH/USD","time_in_force":"gtc","trail_percent":null,"trail_price":null,"type":"limit","updated_at":"2023-12-12T22:36:51.337754768Z"}},"EquityOrderResponse":{"value":{"asset_class":"us_equity","asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","canceled_at":null,"client_order_id":"5680c4bc-9ac1-4a12-a44c-df427ba53032","created_at":"2023-12-12T22:31:24.668464435Z","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"7b08df51-c1ac-453c-99f9-323a5f075f0d","legs":null,"limit_price":"150","notional":null,"order_class":"","order_type":"limit","qty":"2","replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","source":null,"status":"accepted","stop_price":null,"submitted_at":"2023-12-12T22:31:24.577215743Z","subtag":null,"symbol":"AAPL","time_in_force":"gtc","trail_percent":null,"trail_price":null,"type":"limit","updated_at":"2023-12-12T22:31:24.668464435Z"}},"IPOOrderResponse":{"value":{"asset_class":"ipo","asset_id":"9b6c7c1a-9eb2-4d4a-8a3a-1bf4c1d5cbaa","canceled_at":null,"client_order_id":"0b3a90b6-6b5c-4d83-8c0e-9b3eaf4a8d11","created_at":"2025-09-15T13:30:42.117344821Z","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"5e2a8f1a-9c10-4d3a-8c64-7f59c1d18c11","legs":null,"limit_price":null,"notional":"500","order_class":"","order_type":"market","qty":null,"replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","source":null,"status":"accepted","stop_price":null,"submitted_at":"2025-09-15T13:30:42.094518219Z","subtag":null,"symbol":"FI111225","time_in_force":"gtc","trail_percent":null,"trail_price":null,"type":"market","updated_at":"2025-09-15T13:30:42.117344821Z"}},"MultilegOptionsOrderResponse":{"value":{"asset_class":"","asset_id":"","canceled_at":null,"client_order_id":"646b1fe6-b212-4f54-94c6-429e7bcdee04","created_at":"2024-12-10T16:15:53.677230742Z","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":"2024-12-10T16:15:53.694Z","filled_avg_price":"1.28","filled_qty":"1","hwm":null,"id":"83f37e9f-6b1f-49ed-8fc6-3e6af716323f","legs":[{"asset_class":"us_option","asset_id":"f0ea14b2-8a49-4e9b-89d1-894c6e518a76","canceled_at":null,"client_order_id":"cc8cc104-fe43-476c-b25c-f62650fb73f9","created_at":"2024-12-10T16:15:53.677230742Z","expired_at":null,"expires_at":"2024-12-10T21:00:00Z","extended_hours":false,"failed_at":null,"filled_at":"2024-12-10T16:15:53.694Z","filled_avg_price":"0.43","filled_qty":"3","hwm":null,"id":"df4ff24a-c58a-4e37-8b9f-ef32b83a11f2","legs":null,"limit_price":null,"notional":null,"order_class":"mleg","order_type":"","position_intent":"buy_to_open","qty":"3","ratio_qty":"3","replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","source":null,"status":"filled","stop_price":null,"submitted_at":"2024-12-10T16:15:53.684952901Z","subtag":null,"symbol":"AAPL241213C00250000","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"","updated_at":"2024-12-10T16:15:53.725091158Z"},{"asset_class":"us_option","asset_id":"f89940db-eeb1-46e6-8f9b-bb1f27a0b395","canceled_at":null,"client_order_id":"0bd2d36d-4af2-4dfb-8418-333a5d5026fa","created_at":"2024-12-10T16:15:53.677230742Z","expired_at":null,"expires_at":"2024-12-10T21:00:00Z","extended_hours":false,"failed_at":null,"filled_at":"2024-12-10T16:15:53.694Z","filled_avg_price":"0.01","filled_qty":"1","hwm":null,"id":"ecd91110-c34d-4e9d-a7bf-a9c27c40f8b5","legs":null,"limit_price":null,"notional":null,"order_class":"mleg","order_type":"","position_intent":"sell_to_open","qty":"1","ratio_qty":"1","replaced_at":null,"replaced_by":null,"replaces":null,"side":"sell","source":null,"status":"filled","stop_price":null,"submitted_at":"2024-12-10T16:15:53.684952901Z","subtag":null,"symbol":"AAPL241213C00260000","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"","updated_at":"2024-12-10T16:15:53.708983759Z"}],"limit_price":"10","notional":null,"order_class":"mleg","order_type":"limit","qty":"1","replaced_at":null,"replaced_by":null,"replaces":null,"side":"","source":null,"status":"filled","stop_price":null,"submitted_at":"2024-12-10T16:15:53.684952901Z","subtag":null,"symbol":"","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"limit","updated_at":"2024-12-10T16:15:53.725139688Z"}},"OptionOrderResponse":{"value":{"asset_class":"us_option","asset_id":"98359ef7-5124-49f3-85ea-5cf02df6defa","canceled_at":null,"client_order_id":"58cd43a7-029e-457e-b77f-cd4f61f00f2a","created_at":"2023-12-12T21:35:49.102449524Z","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"30a077fa-96f6-4f20-a052-4b921ee2f243","legs":null,"limit_price":"10","notional":null,"order_class":"simple","order_type":"limit","qty":"2","replaced_at":null,"replaced_by":null,"replaces":null,"side":"buy","source":null,"status":"pending_new","stop_price":null,"submitted_at":"2023-12-12T21:35:49.056332248Z","subtag":null,"symbol":"AAPL250620C00100000","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"limit","updated_at":"2023-12-12T21:35:49.102504673Z"}}},"headers":{"ratelimit_limit":{"description":"Request limit per minute.","example":100,"schema":{"type":"integer"}},"ratelimit_remaining":{"description":"Request limit per minute remaining.","example":90,"schema":{"type":"integer"}},"ratelimit_reset":{"description":"The UNIX epoch when the remaining quota changes.","example":1674044551,"schema":{"type":"integer"}}},"parameters":{"PageToken":{"description":"Used for pagination, this token retrieves the next page of results. It is obtained from the response of the preceding page when additional pages are available.","in":"query","name":"page_token","required":false,"schema":{"example":"eyJpZCI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMCJ9Cg","type":"string"}},"end":{"description":"The last date to retrieve data for (inclusive). Default: one week from the start date.\n","example":"2030-01-01","in":"query","name":"end","required":false,"schema":{"format":"date","type":"string"}},"legacy_date_type":{"description":"Indicates what start and end mean. Default: TRADING. If TRADING is specified, returns a calendar whose trading date matches start, end. If SETTLEMENT is specified, returns the calendar whose settlement date matches start and end.\n","in":"query","name":"date_type","schema":{"enum":["TRADING","SETTLEMENT"],"type":"string"}},"legacy_end":{"description":"The last date to retrieve data for (inclusive).","in":"query","name":"end","schema":{"format":"date-time","type":"string","x-go-type":"legacyTime"}},"legacy_start":{"description":"The first date to retrieve data for (inclusive).","in":"query","name":"start","schema":{"format":"date-time","type":"string","x-go-type":"legacyTime"}},"market":{"description":"The market identifier. MIC, BIC, or acronym.\n\nAvailable market codes by region:\n\n**United States**\n- `BMO`: Bank of Montreal. US banking calendar (US operations).\n- `BNYM`: The Bank of New York Mellon. US banking calendar.\n- `BOATS`: Blue Ocean Alternative Trading System. US overnight trading.\n- `IEX`: Investors Exchange. US equities.\n- `IEXG`: Investors Exchange. US equities.\n- `NASDAQ`: National Association of Securities Dealers Automated Quotations. US equities.\n- `NYSE`: New York Stock Exchange. US equities.\n- `OCEA`: BlueOcean ATS. US overnight trading.\n- `OPRA`: Options Price Reporting Authority. US options.\n- `OTC`: Over-The-Counter. US OTC equities.\n- `OTCM`: OTC Markets. US OTC equities.\n- `SIFMA`: Securities Industry and Financial Markets Association. US bonds.\n- `XNAS`: NASDAQ. US equities.\n- `XNYS`: New York Stock Exchange. US equities.\n\n**Europe**\n- `CEUX`: Cboe CEUX Europe. European equities (Cboe Netherlands).\n- `CHIX`: Cboe CHIX Europe. European equities (Cboe UK).\n- `ISE`: Euronext Dublin. Irish equities.\n- `LSE`: London Stock Exchange. UK equities.\n- `MTA`: Euronext Milan. Italian equities.\n- `MTAA`: Euronext Milan. Italian equities.\n- `XAMS`: Euronext Amsterdam. Dutch equities.\n- `XBRU`: Euronext Brussels. Belgian equities.\n- `XDUB`: Euronext Dublin. Irish equities.\n- `XETR`: Frankfurt Stock Exchange. German equities.\n- `XETRA`: Frankfurt Stock Exchange. German equities.\n- `XLIS`: Euronext Lisbon. Portuguese equities.\n- `XLON`: London Stock Exchange. UK equities.\n- `XPAR`: Euronext Paris. French equities.\n\n**Asia & Middle East**\n- `HKEX`: Hong Kong Stock Exchange. Hong Kong equities.\n- `JPX`: Japan Exchange Group. Japanese equities.\n- `TADAWUL`: Saudi Stock Exchange. Saudi equities.\n- `XHKG`: Hong Kong Stock Exchange. Hong Kong equities.\n- `XSAU`: Saudi Stock Exchange. Saudi equities.\n- `XTKS`: Japan Exchange Group. Japanese equities.\n","in":"path","name":"market","required":true,"schema":{"$ref":"#/components/schemas/market"}},"markets":{"description":"Comma-separated list of markets. Available market codes by region:\n\n**United States**\n- `BMO`: Bank of Montreal. US banking calendar (US operations).\n- `BNYM`: The Bank of New York Mellon. US banking calendar.\n- `BOATS`: Blue Ocean Alternative Trading System. US overnight trading.\n- `IEX`: Investors Exchange. US equities.\n- `IEXG`: Investors Exchange. US equities.\n- `NASDAQ`: National Association of Securities Dealers Automated Quotations. US equities.\n- `NYSE`: New York Stock Exchange. US equities.\n- `OCEA`: BlueOcean ATS. US overnight trading.\n- `OPRA`: Options Price Reporting Authority. US options.\n- `OTC`: Over-The-Counter. US OTC equities.\n- `OTCM`: OTC Markets. US OTC equities.\n- `SIFMA`: Securities Industry and Financial Markets Association. US bonds.\n- `XNAS`: NASDAQ. US equities.\n- `XNYS`: New York Stock Exchange. US equities.\n\n**Europe**\n- `CEUX`: Cboe CEUX Europe. European equities (Cboe Netherlands).\n- `CHIX`: Cboe CHIX Europe. European equities (Cboe UK).\n- `ISE`: Euronext Dublin. Irish equities.\n- `LSE`: London Stock Exchange. UK equities.\n- `MTA`: Euronext Milan. Italian equities.\n- `MTAA`: Euronext Milan. Italian equities.\n- `XAMS`: Euronext Amsterdam. Dutch equities.\n- `XBRU`: Euronext Brussels. Belgian equities.\n- `XDUB`: Euronext Dublin. Irish equities.\n- `XETR`: Frankfurt Stock Exchange. German equities.\n- `XETRA`: Frankfurt Stock Exchange. German equities.\n- `XLIS`: Euronext Lisbon. Portuguese equities.\n- `XLON`: London Stock Exchange. UK equities.\n- `XPAR`: Euronext Paris. French equities.\n\n**Asia & Middle East**\n- `HKEX`: Hong Kong Stock Exchange. Hong Kong equities.\n- `JPX`: Japan Exchange Group. Japanese equities.\n- `TADAWUL`: Saudi Stock Exchange. Saudi equities.\n- `XHKG`: Hong Kong Stock Exchange. Hong Kong equities.\n- `XSAU`: Saudi Stock Exchange. Saudi equities.\n- `XTKS`: Japan Exchange Group. Japanese equities.\n","example":"NYSE,LSE","in":"query","name":"markets","schema":{"type":"string"}},"start":{"description":"The first date to retrieve data for (inclusive). Default: today.\n","example":"2025-01-01","in":"query","name":"start","required":false,"schema":{"format":"date","type":"string"}},"time":{"description":"Instead of the current time, use this time for the clock.","in":"query","name":"time","required":false,"schema":{"format":"date-time","type":"string"}},"timezone":{"description":"Timezone of the times. Default: the timezone of the market.\n","in":"query","name":"timezone","required":false,"schema":{"enum":["UTC"],"type":"string"}}},"responses":{"400":{"description":"One of the request parameters is invalid. See the returned message for details.\n","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"401":{"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key.\n"},"403":{"description":"The requested resource is forbidden.\n"},"429":{"description":"Too many requests. You hit the rate limit. Use the X-RateLimit-... response headers to make sure you're under the rate limit.\n","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"500":{"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum.\n"}},"schemas":{"AcatcActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"$ref":"#/components/schemas/CommonAcatActivityV2"}],"description":"Automated customer account transfer service (cash)","type":"object"},"AcatsActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"$ref":"#/components/schemas/CommonAcatActivityV2"},{"properties":{"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol"],"type":"object"}],"description":"Automated customer account transfer service (stock)","type":"object"},"Account":{"description":"The account API serves important information related to an account, including account status, funds available for trade, funds available for withdrawal, and various flags relevant to an account's ability to trade. An account maybe be blocked for just for trades (trades_blocked flag) or for both trades and transfers (account_blocked flag) if Alpaca identifies the account to engaging in any suspicious activity. Please note that cryptocurrencies are not eligible assets to be used as collateral for margin accounts and will require the asset be traded using cash only.\n","properties":{"account_blocked":{"description":"If true, the account activity by user is prohibited.","type":"boolean"},"account_number":{"description":"Account number.","type":"string"},"accrued_fees":{"description":"The fees collected.","type":"string"},"balance_asof":{"description":"The date of the snapshot for `last_*` fields","example":"2021-04-01","type":"string"},"buying_power":{"description":"Current available $ buying power; If multiplier = 4, this is your daytrade buying power which is calculated as (last_equity - (last) maintenance_margin) * 4; If multiplier = 2, buying_power = max(equity - initial_margin,0) * 2; If multiplier = 1, buying_power = cash","type":"string"},"cash":{"description":"Cash Balance\n","type":"string"},"created_at":{"description":"Timestamp this account was created at\n","format":"date-time","type":"string"},"crypto_status":{"$ref":"#/components/schemas/AccountStatus"},"currency":{"description":"USD\n","example":"USD","type":"string"},"equity":{"description":"Cash + long_market_value + short_market_value","type":"string"},"id":{"description":"Account Id.\n","format":"uuid","type":"string"},"initial_margin":{"description":"Reg T initial margin requirement (continuously updated value)","type":"string"},"intraday_adjustments":{"description":"The intraday adjustment by non_trade_activities such as fund deposit/withdraw.\n","example":"0","type":"string"},"last_equity":{"description":"Equity as of previous trading day at 16:00:00 ET","type":"string"},"last_maintenance_margin":{"description":"Your maintenance margin requirement on the previous trading day","type":"string"},"long_market_value":{"description":"Real-time MtM value of all long positions held in the account\n","type":"string"},"maintenance_margin":{"description":"Maintenance margin requirement (continuously updated value)","type":"string"},"multiplier":{"description":"Buying power multiplier that represents account margin classification; valid values 1 (standard limited margin account with 1x buying power), 2 (reg T margin account with 2x intraday and overnight buying power; this is the default for all non-PDT accounts with $2,000 or more equity), 4 (PDT account with 4x intraday buying power and 2x reg T overnight buying power)","type":"string"},"non_marginable_buying_power":{"description":"Current available non-margin dollar buying power","type":"string"},"options_approved_level":{"description":"The options trading level that was approved for this account.\n0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\n","enum":[0,1,2,3],"example":3,"type":"integer"},"options_buying_power":{"description":"Your buying power for options trading\n","type":"string"},"options_trading_level":{"description":"The effective options trading level of the account.\nThis is the minimum between account options_approved_level and account configurations max_options_trading_level.\n0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.\n","enum":[0,1,2,3],"example":3,"type":"integer"},"pending_reg_taf_fees":{"description":"Pending regulatory fees for the account.\n","type":"string"},"pending_transfer_in":{"description":"Cash pending transfer in.","type":"string"},"pending_transfer_out":{"description":"Cash pending transfer out.","type":"string"},"portfolio_value":{"description":"Total value of cash + holding positions (This field is deprecated. It is equivalent to the equity field.)","type":"string"},"regt_buying_power":{"description":"Your buying power under Regulation T (your excess equity - equity minus margin value - times your margin multiplier)\n","type":"string"},"short_market_value":{"description":"Real-time MtM value of all short positions held in the account","type":"string"},"shorting_enabled":{"description":"Flag to denote whether or not the account is permitted to short","type":"boolean"},"sma":{"description":"Value of special memorandum account (will be used at a later date to provide additional buying_power)","type":"string"},"status":{"$ref":"#/components/schemas/AccountStatus"},"trade_suspended_by_user":{"description":"User setting. If true, the account is not allowed to place orders.","type":"boolean"},"trading_blocked":{"description":"If true, the account is not allowed to place orders.\n","type":"boolean"},"transfers_blocked":{"description":"If true, the account is not allowed to request money transfers.","type":"boolean"}},"required":["id","status"],"title":"Account","type":"object","x-examples":{"example-1":{"account_blocked":false,"account_number":"010203ABCD","balance_asof":"2023-09-27","buying_power":"262113.632","cash":"-23140.2","created_at":"2019-06-12T22:47:07.99658Z","currency":"USD","equity":"103820.56","id":"e6fe16f3-64a4-4921-8928-cadf02f92f98","initial_margin":"63480.38","intraday_adjustments":"0","last_equity":"103529.24","last_maintenance_margin":"38000.832","long_market_value":"126960.76","maintenance_margin":"38088.228","multiplier":"4","options_approved_level":2,"options_buying_power":"40340.18","options_trading_level":1,"pending_reg_taf_fees":"0","portfolio_value":"103820.56","regt_buying_power":"80680.36","short_market_value":"0","shorting_enabled":true,"sma":"0","status":"ACTIVE","trade_suspended_by_user":false,"trading_blocked":false,"transfers_blocked":false}}},"AccountConfigurations":{"description":"The account configuration API provides custom configurations about your trading account settings. These configurations control various allow you to modify settings to suit your trading needs.","properties":{"disable_overnight_trading":{"description":"If true, overnight trading is disabled.","type":"boolean"},"fractional_trading":{"description":"If true, account is able to participate in fractional trading","type":"boolean"},"max_margin_multiplier":{"description":"Can be \"1\", \"2\", or \"4\"","type":"string"},"max_options_trading_level":{"description":"The desired maximum options trading level. 0=disabled, 1=Covered Call/Cash-Secured Put, 2=Long Call/Put, 3=Spreads/Straddles.","enum":[0,1,2,3],"type":"integer"},"no_shorting":{"description":"If true, account becomes long-only mode.","type":"boolean"},"ptp_no_exception_entry":{"description":"If set to true then Alpaca will accept orders for PTP symbols with no exception. Default is false.","type":"boolean"},"suspend_trade":{"description":"If true, new orders are blocked.","type":"boolean"},"trade_confirm_email":{"description":"all or none. If none, emails for order fills are not sent.","type":"string"}},"title":"AccountConfigurations","type":"object","x-examples":{"example-1":{"disable_overnight_trading":false,"fractional_trading":true,"max_margin_multiplier":"4","no_shorting":false,"suspend_trade":false,"trade_confirm_email":"all"}}},"AccountStatus":{"description":"An enum representing the various possible account status values.\n\nMost likely, the account status is ACTIVE unless there is any problem. The account status may get in ACCOUNT_UPDATED when personal information is being updated from the dashboard, in which case you may not be allowed trading for a short period of time until the change is approved.\n\n- ONBOARDING\n  The account is onboarding.\n- SUBMISSION_FAILED\n  The account application submission failed for some reason.\n- SUBMITTED\n  The account application has been submitted for review.\n- ACCOUNT_UPDATED\n  The account information is being updated.\n- APPROVAL_PENDING\n  The final account approval is pending.\n- ACTIVE\n  The account is active for trading.\n- REJECTED\n  The account application has been rejected.","enum":["INACTIVE","PAPER_ONLY","ONBOARDING","SUBMISSION_FAILED","SUBMITTED","ACCOUNT_UPDATED","APPROVAL_PENDING","ACTIVE","REJECTED","ACCOUNT_CLOSED","APPROVED","ACCOUNT_CLOSED_PENDING","ACTION_REQUIRED","LIMITED"],"example":"ACTIVE","title":"AccountStatus","type":"string","x-examples":{"example-1":"ACTIVE"}},"ActivityEventV2":{"allOf":[{"$ref":"#/components/schemas/ActivityEventV2CommonFields"},{"properties":{"details":{"oneOf":[{"$ref":"#/components/schemas/ActivityV2DetailTRD"},{"$ref":"#/components/schemas/ActivityV2DetailNTA"}]}},"required":["details"],"type":"object"}],"description":"Represents an account activity, sent over the Event Streaming API.","title":"ActivityEventV2","type":"object"},"ActivityEventV2CommonFields":{"description":"Represents the common fields for all Activity V2 Events","properties":{"activity_subtype":{"description":"Sub category for activity type, if any","type":"string"},"activity_type":{"description":"The type of the activity, which can be trade or any of the non trade activities","type":"string"},"at":{"description":"Timestamp of event","format":"date-time","minLength":1,"type":"string"},"currency":{"description":"Currency code in ISO format","type":"string"},"event_id":{"description":"Lexically sortable, monotonically increasing character string","format":"ulid","type":"string"},"executed_at":{"description":"Execution time for the activity event","format":"date-time","minLength":1,"type":"string"},"net_amount":{"description":"The net amount of money (positive or negative) associated with the activity","format":"decimal","type":"string"},"previous_id":{"description":"Previous ID is presented if this activity corrects or cancels a previous trade or non trade activity. It contains execution_id or trns_id respectively","format":"uuid","type":"string"},"price":{"description":"The price of the security involved with the activity","format":"decimal","type":"string"},"qty":{"description":"The quantity of the security involved with the activity","format":"decimal","type":"string"},"ref_id":{"description":"The unique identifier for the activity. For trades, the execution_id is used, for other activities the trns_id is used.","format":"uuid","type":"string"},"settle_date":{"description":"Date when the activity settled","format":"date","minLength":1,"type":"string"},"status":{"description":"Status of the activity","type":"string"},"swap_fee_bps":{"description":"Currency conversion fee rate base-point in case of local currency activity","format":"decimal","type":"string"},"swap_rate":{"description":"Conversion rate for local currency activities","format":"decimal","type":"string"}},"required":["at","event_id","activity_type","executed_at","status","settle_date","currency","ref_id"],"type":"object"},"ActivitySubType":{"description":"Represents a more specific classification to the `activity_type`.\nThis field is optional and may not always be populated, depending on the activity type and the available data.\nEach `activity_type` has a set of valid `activity_sub_type` values.\n\nFull mapping of `activity_type` to `activity_sub_type`:\n\n- **DIV**: Dividend activity sub-types:\n  - **CDIV**: Cash Dividend\n  - **SDIV**: Stock Dividend\n  - **SPD**: Substitute Payment In Lieu Of Dividend\n\n- **FEE**: Fee-related activity sub-types:\n  - **REG**: Regulatory Fee\n  - **TAF**: Trading Activity Fee\n  - **LCT**: Local Currency Trading Fee\n  - **ORF**: Options Regulatory Fee\n  - **OCC**: Options Clearing Corporation Fee\n  - **NRC**: Non-Retail Commission Fee\n  - **NRV**: Non-Retail Venue Fee\n  - **COM**: Commission\n  - **CAT**: Consolidated Audit Trail Fee\n\n- **INT**: Interest-related activity sub-types:\n  - **MGN**: Margin Interest\n  - **CDT**: Credit Interest\n  - **SWP**: Sweep Interest\n  - **QII**: Qualified Interest\n\n- **MA**: Merger and Acquisition activity sub-types:\n  - **CMA**: Cash Merger\n  - **SMA**: Stock Merger\n  - **SCMA**: Stock & Cash Merger\n\n- **NC**: Name Change activity sub types\n  - **SNC**: Symbol Name Change\n  - **CNC**: CUSIP Name Change\n  - **SCNC**: Symbol & CUSIP Name Change\n\n- **OPCA**: Option Corporate Action activity sub-types:\n  - **DIV.CDIV**: Cash Dividend\n  - **DIV.SDIV**: Stock Dividend\n  - **MA.CMA**: Cash Merger\n  - **MA.SMA**: Stock Merger\n  - **MA.SCMA**: Stock & Cash Merger\n  - **NC.CNC**: CUSIP Name Change\n  - **NC.SNC**: Symbol Name Change\n  - **NC.SCNC**: Symbol & CUSIP Name Change\n  - **SPIN**: Spin-off\n  - **SPLIT.FSPLIT**: Forward Stock Split\n  - **SPLIT.RSPLIT**: Reverse Stock Split\n  - **SPLIT.USPLIT**: Unit Split\n\n- **REORG**: Reorganization activity sub-types:\n  - **WRM**: Worthless Removal\n\n- **SPLIT**: Stock Split activity sub-types:\n  - **FSPLIT**: Forward Stock Split\n  - **RSPLIT**: Reverse Stock Split\n  - **USPLIT**: Unit Split\n\n- **VOF**: Voluntary Offering activity sub-types:\n  - **VTND**: Tender Offer\n  - **VWRT**: Warrant Exercise\n  - **VRGT**: Rights Offer\n  - **VEXH**: Exchange Offer\n\n- **WH**: Withholding activity sub-types:\n  - **SWH**: State Withholding\n  - **FWH**: Federal Withholding\n  - **SLWH**: Sales Withholding","title":"ActivitySubType","type":"string"},"ActivityType":{"description":"- FILL\n  Order fills (both partial and full fills)\n\n- TRANS\n  Cash transactions (both CSD and CSW)\n\n- MISC\n  Miscellaneous or rarely used activity types (All types except those in TRANS, DIV, or FILL)\n\n- ACATC\n  ACATS IN/OUT (Cash)\n\n- ACATS\n  ACATS IN/OUT (Securities)\n\n- CFEE\n  Crypto fee\n\n- CGD\n  Capital gain distribution\n\n- CSD\n  Cash deposit(+)\n\n- CSW\n  Cash withdrawal(-)\n\n- DIV\n  Dividends\n\n- DIVCGL\n  Dividend (capital gain long term)\n\n- DIVCGS\n  Dividend (capital gain short term)\n\n- DIVFEE\n  Dividend fee\n\n- DIVFT\n  Dividend adjusted (Foreign Tax Withheld)\n\n- DIVNRA\n  Dividend adjusted (NRA Withheld)\n\n- DIVROC\n  Dividend return of capital\n\n- DIVTW\n  Dividend adjusted (Tefra Withheld)\n\n- DIVTXEX\n  Dividend (tax exempt)\n\n- FEE\n  Fee denominated in USD\n\n- INT\n  Interest (credit/margin)\n\n- INTNRA\n  Interest adjusted (NRA Withheld)\n\n- INTTW\n  Interest adjusted (Tefra Withheld)\n\n- JNL\n  Journal entry\n\n- JNLC\n  Journal entry (cash)\n\n- JNLS\n  Journal entry (stock)\n\n- MA\n  Merger/Acquisition\n\n- NC\n  Name change\n\n- OPASN\n  Option assignment\n\n- OPCA\n  Option corporate action\n\n- OPCSH\n  Option cash deliverable for non-standard contracts\n\n- OPEXC\n  Option exercise\n\n- OPEXP\n  Option expiration\n\n- OPTRD\n  Option trade\n\n- PTC\n  Pass Thru Charge\n\n- PTR\n  Pass Thru Rebate\n\n- REORG\n  Reorg CA\n\n- SPIN\n  Stock spinoff\n\n- SPLIT\n  Stock split\n\n- FOPT\n  Free of Payment Transfers","enum":["FILL","TRANS","MISC","ACATC","ACATS","CFEE","CGD","CSD","CSW","DIV","DIVCGL","DIVCGS","DIVFEE","DIVFT","DIVNRA","DIVROC","DIVTW","DIVTXEX","FEE","INT","INTNRA","INTTW","JNL","JNLC","JNLS","MA","NC","OPASN","OPCA","OPCSH","OPEXC","OPEXP","OPTRD","PTC","PTR","REORG","SPIN","SPLIT","FOPT"],"title":"ActivityType","type":"string","x-examples":{"example-1":"FILL"}},"ActivityV2DetailNTA":{"allOf":[{"oneOf":[{"$ref":"#/components/schemas/DIVSPDActivityV2"},{"$ref":"#/components/schemas/CDIVActivityV2"},{"$ref":"#/components/schemas/SDIVActivityV2"},{"$ref":"#/components/schemas/ForwardSplitActivityV2"},{"$ref":"#/components/schemas/ReverseSplitActivityV2"},{"$ref":"#/components/schemas/UnitSplitActivityV2"},{"$ref":"#/components/schemas/SpinoffActivityV2"},{"$ref":"#/components/schemas/MAActivityV2"},{"$ref":"#/components/schemas/NCActivityV2"},{"$ref":"#/components/schemas/FixedIncomeRedemptionActivityV2"},{"$ref":"#/components/schemas/RightsDistributionActivityV2"},{"$ref":"#/components/schemas/RightsSubscriptionElectionActivityV2"},{"$ref":"#/components/schemas/TenderOfferActivityV2"},{"$ref":"#/components/schemas/ExchangeOfferActivityV2"},{"$ref":"#/components/schemas/WarrantExerciseElectionActivityV2"},{"$ref":"#/components/schemas/WRMActivityV2"},{"$ref":"#/components/schemas/OpcaCDIVActivityV2"},{"$ref":"#/components/schemas/OpcaSDIVActivityV2"},{"$ref":"#/components/schemas/OpcaMAActivityV2"},{"$ref":"#/components/schemas/OpcaNCActivityV2"},{"$ref":"#/components/schemas/OpcaSPINActivityV2"},{"$ref":"#/components/schemas/OpcaFSPLITActivityV2"},{"$ref":"#/components/schemas/OpcaUSPLITActivityV2"},{"$ref":"#/components/schemas/OpcaRSPLITActivityV2"},{"$ref":"#/components/schemas/OPASNActivityV2"},{"$ref":"#/components/schemas/OPEXCActivityV2"},{"$ref":"#/components/schemas/OPEXPActivityV2"},{"$ref":"#/components/schemas/OPTRDActivityV2"},{"$ref":"#/components/schemas/AcatsActivityV2"},{"$ref":"#/components/schemas/AcatcActivityV2"},{"$ref":"#/components/schemas/FOPTActivityV2"},{"$ref":"#/components/schemas/DIVNRAActivityV2"},{"$ref":"#/components/schemas/JNLSActivityV2"},{"$ref":"#/components/schemas/JNLCActivityV2"},{"$ref":"#/components/schemas/CSWActivityV2"},{"$ref":"#/components/schemas/FEEActivityV2"}]}],"type":"object"},"ActivityV2DetailTRD":{"description":"Activity details for a fill or partial_fill event","properties":{"asset_id":{"description":"Asset ID (For options this represents the option contract ID)","format":"uuid","type":"string"},"client_order_id":{"description":"Order ID provided by the customer","type":"string"},"commission":{"description":"Commission to collect from the account holder","format":"decimal","type":"string"},"cum_qty":{"description":"Total filled quantity on the order","format":"decimal","type":"string"},"cusip":{"description":"CUSIP of the security involved with the activity","type":"string"},"execution_type":{"description":"The execution type","enum":["fill","trade_correct","trade_bust"],"type":"string"},"leaves_qty":{"description":"Unfilled quantity on the order, when order is filled value could be 0","format":"decimal","type":"string"},"order_id":{"description":"Order ID generated by Alpaca","format":"uuid","type":"string"},"order_status":{"description":"Identifies the current status of the order","type":"string"},"side":{"description":"Represents what side of the transaction an order was on","enum":["buy","sell"],"type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["order_id","side","symbol","asset_id","leaves_qty","cum_qty","order_status","execution_type"],"type":"object"},"AdvancedInstructions":{"description":"Advanced instructions for Elite Smart Router: https://docs.alpaca.markets/docs/alpaca-elite-smart-router","properties":{"algorithm":{"description":"The advanced routing algorithm to use for the order","enum":["DMA","TWAP","VWAP"],"example":"DMA","type":"string"},"destination":{"description":"Target exchange for order execution","enum":["NYSE","NASDAQ","ARCA"],"example":"NYSE","type":"string"},"display_qty":{"description":"Maximum shares/contracts displayed on the exchange at any time. Must be in round lot increments","example":"100","format":"decimal","type":"string"},"end_time":{"description":"When the algorithm is to be done executing. Must be within current market trading hours","example":"2025-07-21T15:30:00-04:00","format":"date-time","type":"string"},"max_percentage":{"description":"Maximum percentage of the ticker's period volume this order might participate in. Must be 0 < max_percentage < 1, with up to 3 decimal points precision.","example":"0.314","format":"decimal","type":"string"},"start_time":{"description":"When the algorithm is to start executing. Must be within current market trading hours","example":"2025-07-21T09:30:00-04:00","format":"date-time","type":"string"}},"title":"AdvancedInstructions","type":"object","x-examples":{"example-1":{"algorithm":"DMA","destination":"NYSE","display_qty":100},"example-2":{"algorithm":"TWAP","end_time":"2025-07-21T15:30:00-04:00","max_percentage":0.314,"start_time":"2025-07-21T09:30:00-04:00"},"example-3":{"algorithm":"VWAP","end_time":"2025-07-21T15:30:00-04:00","max_percentage":0.314,"start_time":"2025-07-21T09:30:00-04:00"}}},"AssetAttribute":{"description":"Unique characteristic of an asset. Supported values:\n- `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default.\n- `ptp_with_exception`: Users can open positions in these PTPs without general restrictions.\n- `ipo`: Accepting limit orders only before the stock begins trading on the secondary market.\n- `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up.\n- `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET.\n- `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled).\n- `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform.\n- `overnight_halted`: Asset is eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.","enum":["ptp_no_exception","ptp_with_exception","ipo","has_options","options_late_close","fractional_eh_enabled","overnight_tradable","overnight_halted"],"example":"ptp_no_exception","type":"string"},"AssetClass":{"description":"This represents the category to which the asset belongs to. It serves to identify the nature of the financial instrument, with options including \"us_equity\" for U.S. equities, \"us_option\" for U.S. options, \"crypto\" for cryptocurrencies, and \"ipo\" for IPO indications of interest/orders. This `asset_class: ipo` value is distinct from the assets API `attributes: [\"ipo\"]` flag.","enum":["us_equity","us_option","crypto","crypto_perp","treasury","corporate","global_equity","us_index","us_equity_chain","ipo"],"example":"us_equity","title":"AssetClass","type":"string","x-examples":{"example-1":"us_equity"}},"Assets":{"description":"The assets API serves as the master list of assets available for trade and data consumption from Alpaca. Assets are sorted by asset class, exchange and symbol. Some assets are only available for data consumption via Polygon, and are not tradable with Alpaca. These assets will be marked with the flag tradable=false.\n","properties":{"attributes":{"example":["ptp_no_exception","ipo"],"items":{"$ref":"#/components/schemas/AssetAttribute"},"type":"array"},"borrow_status":{"description":"Borrow status for US equity assets. This field is omitted for non-US-equity assets.","enum":["easy_to_borrow","hard_to_borrow"],"example":"easy_to_borrow","type":"string"},"class":{"$ref":"#/components/schemas/AssetClass"},"cusip":{"description":"The CUSIP identifier for the asset (US Equities only).\nTo request a specific CUSIP, please reach out to Alpaca support.\n","example":"987654321","nullable":true,"type":"string"},"easy_to_borrow":{"deprecated":true,"description":"**deprecated**: Please use borrow_status instead.\nAsset is easy-to-borrow or not (filtering for easy_to_borrow = True is the best way to check whether the name is currently available to short at Alpaca).\n","type":"boolean","x-deprecation":{"reason":"Use borrow_status instead.","since":"2026-06-22","sunset":"2026-09-22"}},"exchange":{"$ref":"#/components/schemas/Exchange"},"fractionable":{"description":"Asset is fractionable or not","type":"boolean"},"id":{"description":"Asset ID","format":"uuid","type":"string"},"maintenance_margin_requirement":{"deprecated":true,"description":"**deprecated**: Please use margin_requirement_long or margin_requirement_short instead. Note that these fields are of type string.\nShows the margin requirement percentage for the asset (equities only).\n","type":"number"},"margin_requirement_long":{"description":"The margin requirement percentage for the asset's long positions (equities only).","type":"string"},"margin_requirement_short":{"description":"The margin requirement percentage for the asset's short positions (equities only).","type":"string"},"marginable":{"description":"Asset is marginable or not","type":"boolean"},"min_order_size":{"description":"Minimum order size. Field available for crypto only.","format":"decimal","type":"string"},"min_trade_increment":{"description":"Amount a trade quantity can be incremented by. Field available for crypto only.","format":"decimal","type":"string"},"name":{"description":"The official name of the asset","minLength":1,"type":"string"},"price_increment":{"description":"Amount the price can be incremented by. Field available for crypto only.","format":"decimal","type":"string"},"shortable":{"description":"Asset is shortable or not","type":"boolean"},"status":{"description":"active or inactive","enum":["active","inactive"],"example":"active","type":"string"},"symbol":{"description":"The symbol of the asset","example":"AAPL","type":"string"},"tradable":{"description":"Asset is tradable on Alpaca or not","type":"boolean"}},"required":["id","class","exchange","symbol","name","status","tradable","marginable","shortable","easy_to_borrow","fractionable"],"title":"Assets","type":"object","x-examples":{"example-1":{"borrow_status":"easy_to_borrow","class":"us_equity","easy_to_borrow":true,"exchange":"NASDAQ","fractionable":true,"id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","marginable":true,"name":"Apple Inc. Common Stock","shortable":true,"status":"active","symbol":"AAPL","tradable":true}}},"CDIVActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"$ref":"#/components/schemas/CommonCDIVActivityV2"},{"properties":{"cash_payout":{"description":"Total cash amount paid","type":"string"},"entitled_qty":{"description":"Quantity of shares entitled to receive the dividend","type":"string"}},"required":["entitled_qty","cash_payout"],"type":"object"}],"description":"Cash dividend","type":"object"},"CSWActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"bank_transaction_id":{"description":"The bank transaction's ID","format":"uuid","type":"string"}},"type":"object"}],"description":"Cash withdrawal","type":"object"},"CanceledOrderResponse":{"description":"Represents the result of a request to cancel and order","properties":{"id":{"description":"orderId","format":"uuid","type":"string"},"status":{"description":"http response code","example":200,"type":"integer"}},"title":"CanceledOrderResponse","type":"object","x-examples":{"example-1":{"id":"d56ba3ea-6d04-48ce-8175-817e242ee608","status":200}}},"CommonAcatActivityV2":{"properties":{"external_id":{"description":"The ID that DTCC assigned to this transfer","type":"string"},"hold_date":{"description":"Hold date when the transfers settle","format":"date","minLength":1,"type":"string"},"request_id":{"description":"The ID for original ACATS request","format":"uuid","type":"string"}},"required":["external_id","request_id"],"type":"object"},"CommonCDIVActivityV2":{"properties":{"cusip":{"description":"The CUSIP of the security involved with the activity","type":"string"},"due_bill_off_date":{"description":"When due bills stop applying for this event","format":"date","minLength":1,"type":"string"},"due_bill_on_date":{"description":"When due bills begin to apply for this event","format":"date","minLength":1,"type":"string"},"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"foreign":{"description":"Indicates if related to a non-US security","type":"boolean"},"payable_date":{"description":"The payable_date for this corporate action","format":"date","minLength":1,"type":"string"},"rate":{"description":"Dividend rate per share","type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"special":{"description":"Indicates if this is a special dividend","type":"boolean"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol","cusip","rate","foreign","special"],"type":"object"},"CommonCaActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"ca_id":{"description":"The unique identifier for this corporate action","format":"uuid","type":"string"},"position_date":{"description":"The position_date for this corporate action","format":"date","minLength":1,"type":"string"},"reorg_id":{"description":"The reorg identifier, if present in the source corporate action definition","type":"string"}},"required":["position_date"],"type":"object"}],"type":"object"},"CommonJournalActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"journal_id":{"description":"The journal's ID","format":"uuid","type":"string"}},"type":"object"}],"type":"object"},"CommonMAActivityV2":{"properties":{"acquiree_cusip":{"description":"CUSIP of the acquiree","type":"string"},"acquiree_rate":{"description":"Rate of the acquiree","type":"string"},"acquiree_symbol":{"description":"Symbol of the acquiree","type":"string"},"acquirer_cusip":{"description":"CUSIP of the acquirer","type":"string"},"acquirer_rate":{"description":"Rate of the acquirer","type":"string"},"acquirer_symbol":{"description":"Symbol of the acquirer","type":"string"},"effective_date":{"description":"When the merger/acquisition becomes effective","format":"date","minLength":1,"type":"string"},"payable_date":{"description":"The payable date","format":"date","minLength":1,"type":"string"}},"required":["acquiree_cusip","acquiree_symbol","effective_date","payable_date"],"type":"object"},"CommonNCActivityV2":{"properties":{"new_cusip":{"description":"New CUSIP for the name change","type":"string"},"new_symbol":{"description":"New symbol for the name change","type":"string"},"old_cusip":{"description":"Old CUSIP for the name change","type":"string"},"old_symbol":{"description":"Old symbol for the name change","type":"string"}},"required":["old_cusip","old_symbol","new_cusip","new_symbol"],"type":"object"},"CommonNTAActivityV2":{"properties":{"group_id":{"description":"Optional group ID which can help grouping together related activities","format":"uuid","type":"string"},"system_date":{"description":"The date when the activity was booked","format":"date","minLength":1,"type":"string"}},"required":["system_date"],"type":"object"},"CommonOPCAActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"properties":{"new_contract_symbol":{"description":"The new contract symbol","type":"string"},"new_qty":{"description":"used when the old contract's quantity is not equal to the new contract's quantity. Mutually exclusive with 'qty'.","type":"string"},"old_contract_symbol":{"description":"The old contract symbol","type":"string"},"old_qty":{"description":"used when the old contract's quantity is not equal to the new contract's quantity. Mutually exclusive with 'qty'.","type":"string"},"qty":{"description":"used when the old contract's quantity is equal to the new contract's quantity. Mutually exclusive with 'old_qty' and 'new_qty'","type":"string"}},"required":["old_contract_symbol","new_contract_symbol"],"type":"object"}],"type":"object"},"CommonOptionsActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"}],"required":["group_id"],"type":"object"},"CommonSDIVActivityV2":{"properties":{"cusip":{"description":"The CUSIP of the security involved with the activity","type":"string"},"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"payable_date":{"description":"The payable_date for this corporate action","format":"date","minLength":1,"type":"string"},"rate":{"description":"Dividend rate per share","type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol","cusip","rate"],"type":"object"},"CommonSpinoffActivityV2":{"properties":{"due_bill_redemption_date":{"description":"When due bills related to the spinoff are redeemed","format":"date","minLength":1,"type":"string"},"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"new_cusip":{"description":"CUSIP of the new security","type":"string"},"new_price":{"description":"Market price of new shares after the spinoff","type":"string"},"new_rate":{"description":"Ratio of new shares received","type":"string"},"new_symbol":{"description":"Symbol of the new security","type":"string"},"payable_date":{"description":"The payable_date for this corporate action","format":"date","minLength":1,"type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"source_cusip":{"description":"CUSIP of the parent security","type":"string"},"source_price":{"description":"Market price of parent shares before the spinoff","type":"string"},"source_rate":{"description":"Ratio of parent shares","type":"string"},"source_symbol":{"description":"Symbol of the parent security","type":"string"}},"required":["source_cusip","source_symbol","source_rate","source_price","new_cusip","new_symbol","new_rate","new_price"],"type":"object"},"CommonSplitActivityV2":{"properties":{"new_cusip":{"description":"CUSIP of the new security after the split","type":"string"},"new_rate":{"description":"Ratio of new shares received","type":"string"},"old_cusip":{"description":"CUSIP of the old security before the split","type":"string"},"old_rate":{"description":"Ratio of old shares exchanged","type":"string"},"payable_date":{"description":"The payable_date for this corporate action","format":"date","minLength":1,"type":"string"}},"required":["old_cusip","new_cusip","old_rate","new_rate"],"type":"object"},"CommonSplitStockActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"$ref":"#/components/schemas/CommonSplitActivityV2"},{"properties":{"new_qty":{"description":"The new quantity after the split","type":"string"},"old_qty":{"description":"The old quantity before the split","type":"string"}},"required":["old_qty","new_qty"],"type":"object"}],"type":"object"},"CommonVOFSubtypeActivityV2":{"properties":{"new_cusip":{"description":"CUSIP of the new security","type":"string"},"new_symbol":{"description":"Symbol of the new security","type":"string"},"source_cusip":{"description":"CUSIP of the parent security","type":"string"},"source_symbol":{"description":"Symbol of the parent security","type":"string"}},"required":["source_cusip","source_symbol"],"type":"object"},"CreateCryptoTransferRequest":{"properties":{"address":{"description":"The destination wallet address","type":"string"},"amount":{"description":"The amount, denoted in the specified asset, to be withdrawn from the user's wallet","type":"string"},"asset":{"description":"The crypto asset symbol, e.g. BTC, ETH, USDT.","type":"string"},"chain":{"$ref":"#/components/schemas/CryptoChain"}},"required":["amount","address","asset"],"title":"CreateCryptoTransferRequest","type":"object"},"CreateLocateRequest":{"description":"Request to locate shares for a short sale.","example":{"all_or_none":false,"limit_price":"0.05","qty":100,"symbol":"TSLA"},"properties":{"all_or_none":{"default":false,"description":"Reject the locate unless the full requested quantity is available.","example":false,"type":"boolean"},"limit_price":{"description":"Maximum acceptable locate fee per share, as a decimal string in USD.\nIf omitted, any quoted fee is accepted.\n","example":"0.05","nullable":true,"type":"string"},"qty":{"description":"Number of shares to locate. Must be positive and in round lots of 100; invalid quantities return HTTP 400.","example":100,"format":"int64","minimum":1,"type":"integer"},"symbol":{"description":"Stock symbol.","example":"TSLA","type":"string"}},"required":["symbol","qty"],"type":"object"},"CryptoChain":{"description":"Chain identifier for multi-chain crypto assets.","enum":["SOL","ETH","BTC","XRP","ARB"],"example":"ETH","type":"string"},"CryptoTransfer":{"description":"Transfers allow you to transfer assets into your end customer's account (deposits) or out (withdrawal).","properties":{"amount":{"description":"Amount of transfer denominated in the underlying crypto asset","type":"string"},"asset":{"description":"Symbol of crypto asset for given transfer (e.g. BTC)","type":"string"},"chain":{"description":"Underlying network for given transfer","type":"string"},"created_at":{"description":"Timestamp when transfer was created","format":"date-time","type":"string"},"direction":{"$ref":"#/components/schemas/TransferDirection"},"fees":{"type":"string"},"from_address":{"description":"Originating address of the transfer","type":"string"},"id":{"description":"The crypto transfer ID","format":"uuid","type":"string"},"network_fee":{"type":"string"},"status":{"$ref":"#/components/schemas/CryptoTransferStatus"},"to_address":{"description":"Destination address of the transfer","type":"string"},"tx_hash":{"description":"On-chain transaction hash (e.g. 0xabc...xyz)","type":"string"},"usd_value":{"description":"Equivalent USD value at time of transfer","type":"string"}},"type":"object"},"CryptoTransferStatus":{"enum":["PROCESSING","FAILED","COMPLETE"],"example":"PROCESSING","type":"string"},"CryptoWallet":{"properties":{"address":{"type":"string"},"chain":{"type":"string"},"created_at":{"description":"Timestamp (RFC3339) of account creation.","format":"date-time","type":"string"}},"type":"object"},"DIVNRAActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"cusip":{"description":"The CUSIP of the security involved with the activity","type":"string"},"parent_id":{"description":"The ref_id of the parent dividend","type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["cusip","symbol","parent_id"],"type":"object"}],"description":"Dividend withholding for non resident aliens","type":"object"},"DIVSPDActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"properties":{"cash_payout":{"description":"Total cash amount paid","type":"string"},"cusip":{"description":"The CUSIP of the security involved with the activity","type":"string"},"due_bill_off_date":{"description":"When due bills stop applying for this event","format":"date","minLength":1,"type":"string"},"due_bill_on_date":{"description":"When due bills begin to apply for this event","format":"date","minLength":1,"type":"string"},"entitled_qty":{"description":"Quantity of shares entitled to receive cash in lieu","type":"string"},"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"foreign":{"description":"Indicates if related to a non-US security","type":"boolean"},"payable_date":{"description":"The payable_date for this corporate action","format":"date","minLength":1,"type":"string"},"rate":{"description":"Cash payout per share","type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"special":{"description":"Indicates if this is a special dividend","type":"boolean"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["entitled_qty","cash_payout","symbol","cusip","rate","foreign","special"],"type":"object"}],"description":"Substitute payment in lieu of dividend","type":"object"},"Error":{"properties":{"code":{"type":"number"},"message":{"type":"string"}},"required":["code","message"],"title":"Error","type":"object"},"ErrorResponse":{"description":"API error response.","properties":{"message":{"example":"Internal Server Error","type":"string"}},"type":"object"},"Exchange":{"description":"Represents the current exchanges Alpaca supports. List is currently:\n\n- AMEX\n- ARCA\n- BATS\n- NYSE\n- NASDAQ\n- NYSEARCA\n- OTC\n- CRYPTO","enum":["AMEX","ARCA","BATS","NYSE","NASDAQ","NYSEARCA","OTC","CRYPTO"],"example":"NYSE","title":"Exchange","type":"string"},"ExchangeForPosition":{"description":"Represents the current exchanges Alpaca supports. List is currently:\n\n- AMEX\n- ARCA\n- BATS\n- NYSE\n- NASDAQ\n- NYSEARCA\n- OTC\n- CRYPTO\n\nCan be empty if not applicable (e.g., for options contracts)","enum":["AMEX","ARCA","BATS","NYSE","NASDAQ","NYSEARCA","OTC","CRYPTO",""],"example":"NYSE","title":"Exchange","type":"string"},"ExchangeOfferActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"$ref":"#/components/schemas/CommonVOFSubtypeActivityV2"}],"type":"object"},"FEEActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"parent_id":{"description":"The parent transaction's ID","format":"uuid","type":"string"}},"required":["parent_id"],"type":"object"}],"description":"Fee","type":"object"},"FOPTActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"contra":{"description":"Contra for the transfer","type":"string"},"external_id":{"description":"External ID of the transfer","type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["external_id","contra","symbol"],"type":"object"}],"description":"Free-of-payment (FOP) transfers","type":"object"},"FixedIncomeRedemptionActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"properties":{"ca_id":{"description":"The unique identifier for this corporate action","format":"uuid","type":"string"},"cash_payout":{"description":"The cash payout","type":"string"},"cusip":{"description":"The CUSIP of the security involved with the activity","type":"string"},"payment_date":{"description":"The payment date","format":"date","minLength":1,"type":"string"},"qty":{"description":"Quantity for the redemption","type":"string"}},"required":["ca_id","payment_date","cusip","qty","cash_payout"],"type":"object"}],"description":"Redemption","type":"object"},"ForwardSplitActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonSplitStockActivityV2"},{"properties":{"due_bill_redemption_date":{"description":"When due bills related to the split are redeemed","format":"date","minLength":1,"type":"string"},"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"symbol":{"description":"The symbol of the security being split","type":"string"}},"required":["symbol"],"type":"object"}],"description":"Forward stock split","type":"object"},"JNLCActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonJournalActivityV2"}],"description":"Journal entry (cash)","type":"object"},"JNLSActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonJournalActivityV2"},{"properties":{"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol"],"type":"object"}],"description":"Journal entry (stock)","type":"object"},"ListLocateQuotesResponse":{"description":"Response to a successful request for locate quotes.","example":{"errors":[{"code":"symbol_not_found","message":"symbol not found","symbol":"META"}],"quotes":[{"available_qty":1000,"price":"0.0123","quoted_at":"2026-01-02T15:04:05Z","symbol":"TSLA"}]},"properties":{"errors":{"description":"Symbols that could not be quoted.","items":{"$ref":"#/components/schemas/LocateQuoteError"},"type":"array"},"quotes":{"description":"Locate quotes returned for requested symbols.","items":{"$ref":"#/components/schemas/LocateQuote"},"type":"array"}},"required":["quotes"],"type":"object"},"ListLocatesResponse":{"description":"Response to a successful request for a list of locates.","example":{"locates":[{"all_or_none":false,"created_at":"2026-01-02T15:04:05Z","expires_at":"2026-01-03T01:00:00Z","id":"550e8400-e29b-41d4-a716-446655440000","limit_price":"0.05","located_price":"0.05","located_qty":100,"requested_qty":100,"status":"active","symbol":"TSLA","total_fee":"5.00"}],"next_page_token":"eyJpZCI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMCJ9Cg"},"properties":{"locates":{"description":"Locates matching the filter criteria.","items":{"$ref":"#/components/schemas/Locate"},"type":"array"},"next_page_token":{"description":"The token to use to retrieve the next page of results. If `null`, there are no more pages.","nullable":true,"type":"string"}},"required":["locates","next_page_token"],"type":"object"},"Locate":{"description":"A locate request and its current lifecycle status.","example":{"all_or_none":false,"created_at":"2026-01-02T15:04:05Z","expires_at":"2026-01-03T01:00:00Z","id":"550e8400-e29b-41d4-a716-446655440000","limit_price":"0.05","located_price":"0.05","located_qty":100,"requested_qty":100,"status":"active","symbol":"TSLA","total_fee":"5.00"},"properties":{"all_or_none":{"description":"Whether the request required the full quantity.","example":false,"type":"boolean"},"created_at":{"description":"Time when the locate was created.","example":"2026-01-02T15:04:05Z","format":"date-time","type":"string"},"expires_at":{"description":"Time when the active locate expires. Omitted when rejected.","example":"2026-01-03T01:00:00Z","format":"date-time","nullable":true,"type":"string"},"id":{"description":"Locate ID.","example":"550e8400-e29b-41d4-a716-446655440000","format":"uuid","type":"string"},"limit_price":{"description":"Maximum acceptable fee per share from the request.","example":"0.05","nullable":true,"type":"string"},"located_price":{"description":"Locate fee per share in USD. Omitted when rejected.","example":"0.05","nullable":true,"type":"string"},"located_qty":{"description":"Number of shares located. Omitted when rejected.","example":100,"format":"int64","nullable":true,"type":"integer"},"rejection_reason":{"description":"Machine-readable rejection reason.","example":"inventory_unavailable","nullable":true,"type":"string"},"requested_qty":{"description":"Number of shares requested.","example":100,"format":"int64","type":"integer"},"status":{"$ref":"#/components/schemas/LocateStatus"},"symbol":{"description":"Stock symbol.","example":"TSLA","type":"string"},"total_fee":{"description":"Total locate fee in USD. Omitted when rejected.","example":"5.00","nullable":true,"type":"string"}},"required":["id","symbol","requested_qty","all_or_none","status","created_at"],"type":"object"},"LocateError":{"description":"Locates API error response. Locate-specific 400 and create locate 422 errors include a machine-readable `code`.","properties":{"code":{"description":"Machine-readable error code. Present on locate-specific 400 and create locate 422 errors.","enum":["invalid_input","invalid_request_body","invalid_limit_price","invalid_symbols","symbol_not_found","security_not_found","insufficient_buying_power","easy_to_borrow","threshold_security"],"example":"invalid_symbols","type":"string"},"message":{"description":"Error message.","example":"symbols must contain at most 100 unique symbols","type":"string"}},"required":["message"],"type":"object"},"LocateQuote":{"description":"Current locate pricing and availability for a symbol.","example":{"available_qty":1000,"price":"0.0123","quoted_at":"2026-01-02T15:04:05Z","symbol":"TSLA"},"properties":{"available_qty":{"description":"Available locate quantity.","example":1000,"format":"int64","type":"integer"},"price":{"description":"Locate fee per share. Omitted when no quantity is available.","example":"0.0123","type":"string"},"quoted_at":{"description":"Time when the quote was issued.","example":"2026-01-02T15:04:05Z","format":"date-time","type":"string"},"symbol":{"description":"Stock symbol.","example":"TSLA","type":"string"}},"required":["symbol","available_qty","quoted_at"],"type":"object"},"LocateQuoteError":{"description":"Error returned for a symbol that could not be quoted.","example":{"code":"symbol_not_found","message":"symbol not found","symbol":"META"},"properties":{"code":{"description":"Error code.","enum":["symbol_not_found","easy_to_borrow","threshold_security","corporate_action"],"example":"symbol_not_found","type":"string"},"message":{"description":"Error message.","example":"symbol not found","type":"string"},"symbol":{"description":"Requested stock symbol that could not be quoted.","example":"FB","type":"string"}},"required":["symbol","code","message"],"type":"object"},"LocateStatus":{"description":"Locate status.","enum":["active","expired","rejected"],"example":"active","type":"string"},"MAActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"$ref":"#/components/schemas/CommonMAActivityV2"},{"properties":{"acquiree_qty":{"description":"Quantity of the acquiree","type":"string"},"acquirer_qty":{"description":"Quantity of the acquirer","type":"string"},"cash_payout":{"description":"The cash payout","type":"string"},"cash_rate":{"description":"The cash rate","type":"string"}},"required":["acquiree_qty"],"type":"object"}],"description":"Merger and acquisition","type":"object"},"MLegOrderLeg":{"description":"Represents an individual leg of a multi-leg options order.","properties":{"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"ratio_qty":{"description":"proportional quantity of this leg in relation to the overall multi-leg order qty","type":"string"},"side":{"$ref":"#/components/schemas/OrderSide"},"symbol":{"description":"symbol or asset ID to identify the asset to trade","type":"string"}},"required":["symbol","ratio_qty"],"title":"MLegOrderLeg","type":"object"},"NCActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"$ref":"#/components/schemas/CommonNCActivityV2"},{"properties":{"position_qty":{"description":"The position quantity","type":"string"}},"required":["position_qty"],"type":"object"}],"description":"Name change","type":"object"},"NextPageToken":{"description":"Use this token in your next API call to paginate through the dataset and retrieve the next page of results. A null token indicates there are no more data to fetch.\n","example":"MTAwMA==","nullable":true,"type":"string"},"NonTradeActivities":{"properties":{"activity_sub_type":{"$ref":"#/components/schemas/ActivitySubType"},"activity_type":{"$ref":"#/components/schemas/ActivityType"},"created_at":{"description":"Valid only for non-trading activity types. Null for trading activites.","format":"date-time","type":"string"},"currency":{"description":"Currency denomination of the activity (e.g. USD). Included in NTA stream events and activity responses.","example":"USD","type":"string"},"cusip":{"description":"The CUSIP of the security involved with the activity. Not present for all activity types.","type":"string"},"date":{"description":"The date on which the activity occurred or on which the transaction associated with the activity settled.","format":"date-time","type":"string"},"group_id":{"description":"ID used to link activities who share a sibling relationship.","type":"string"},"id":{"description":"An ID for the activity, always in \"::\" format. Can be sent as page_token in requests to facilitate the paging of results.","type":"string"},"net_amount":{"description":"The net amount of money (positive or negative) associated with the activity.","type":"string"},"per_share_amount":{"description":"For dividend activities, the average amount paid per share. Not present for other activity types.","type":"string"},"qty":{"description":"For dividend activities, the number of shares that contributed to the payment. Not present for other activity types.\n","type":"string"},"status":{"description":"The activity status.","enum":["executed","correct","canceled"],"type":"string"},"symbol":{"description":"The symbol of the security involved with the activity. Not present for all activity types.","type":"string"}},"title":"AccountNonTradeActivities","type":"object","x-examples":{"example-1":{"activity_sub_type":"SDIV","activity_type":"DIV","created_at":"2021-05-10T14:01:04.650275Z","currency":"USD","date":"2019-08-01","id":"20190801011955195::5f596936-6f23-4cef-bdf1-3806aae57dbf","net_amount":"1.02","per_share_amount":"0.51","qty":"2","status":"executed","symbol":"T"}}},"OPASNActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOptionsActivityV2"}],"description":"Option assignment","type":"object"},"OPEXCActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOptionsActivityV2"}],"description":"Option exercise","type":"object"},"OPEXPActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOptionsActivityV2"}],"description":"Option expiry","type":"object"},"OPTRDActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOptionsActivityV2"}],"description":"Trading activity that is paired with the assignment/exercise","type":"object"},"OpcaCDIVActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonCDIVActivityV2"}],"description":"Options corporate action of Cash dividend","type":"object"},"OpcaFSPLITActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonSplitActivityV2"},{"properties":{"due_bill_redemption_date":{"description":"When due bills related to the split are redeemed","format":"date","minLength":1,"type":"string"},"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol"],"type":"object"}],"description":"Options corporate action of forward-splits","type":"object"},"OpcaMAActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonMAActivityV2"}],"description":"Options corporate action of Mergers & Acquisitions","type":"object"},"OpcaNCActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonNCActivityV2"}],"description":"Options corporate action of name changes","type":"object"},"OpcaRSPLITActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonSplitActivityV2"},{"properties":{"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"new_symbol":{"description":"Symbol of the new security after the split","type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol"],"type":"object"}],"description":"Options corporate action of reverse-splits","type":"object"},"OpcaSDIVActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonSDIVActivityV2"}],"description":"Options corporate action of stock dividend","type":"object"},"OpcaSPINActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonSpinoffActivityV2"}],"description":"Options corporate action of spin-offs","type":"object"},"OpcaUSPLITActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonOPCAActivityV2"},{"$ref":"#/components/schemas/CommonSplitActivityV2"},{"properties":{"alternate_cusip":{"description":"CUSIP for the alternate security after the split","type":"string"},"alternate_rate":{"description":"Ratio of alternate shares received","type":"string"},"alternate_symbol":{"description":"Symbol for the alternate security after the split","type":"string"},"effective_date":{"description":"When the unit split becomes effective","format":"date","minLength":1,"type":"string"},"new_symbol":{"description":"Symbol of the new security after the unit split","type":"string"},"old_symbol":{"description":"The old symbol of the security involved with the activity","type":"string"}},"required":["old_symbol","new_symbol","alternate_cusip","alternate_symbol","alternate_rate","effective_date"],"type":"object"}],"description":"Options corporate action of unit-splits","type":"object"},"OptionContract":{"properties":{"close_price":{"description":"The close price of the option contract.","example":"148.38","type":"string"},"close_price_date":{"description":"The date of the close price data.","example":"2023-12-11","format":"date","type":"string"},"deliverables":{"description":"Represents the deliverables tied to the option contract. While standard contracts entail a single deliverable, non-standard ones can encompass multiple deliverables, each potentially customized with distinct parameters.\nThis array is included in the list contracts response only if the query parameter show_deliverables=true is provided.\n","items":{"$ref":"#/components/schemas/OptionDeliverable"},"type":"array"},"expiration_date":{"description":"The expiration date of the option contract.","example":"2025-06-20","format":"date","type":"string"},"id":{"description":"The unique identifier of the option contract.","example":"98359ef7-5124-49f3-85ea-5cf02df6defa","format":"uuid","type":"string"},"multiplier":{"description":"The multiplier of the option contract is crucial for calculating both the trade premium and the extended strike price. In standard contracts, the multiplier is always set to 100.\nFor instance, if a contract is traded at $1.50 and the multiplier is 100, the total amount debited when buying the contract would be $150.00.\nSimilarly, when exercising a call contract, the total cost will be equal to the strike price times the multiplier.","example":"100","format":"decimal","type":"string"},"name":{"description":"The name of the option contract.","example":"AAPL Jun 20 2025 100 Call","type":"string"},"open_interest":{"description":"The open interest of the option contract.","example":"237","type":"string"},"open_interest_date":{"description":"The date of the open interest data.","example":"2023-12-11","format":"date","type":"string"},"root_symbol":{"description":"The root symbol of the option contract.","example":"AAPL","type":"string"},"size":{"description":"Represents the number of underlying shares to be delivered in case the contract is exercised/assigned. For standard contracts, this is always 100.\nThis field should **not** be used as a multiplier, specially for non-standard contracts.","example":"100","type":"string"},"status":{"description":"The status of the option contract.","enum":["active","inactive"],"example":"active","type":"string"},"strike_price":{"description":"The strike price of the option contract.","example":"100","format":"decimal","type":"string"},"style":{"$ref":"#/components/schemas/OptionContractStyle"},"symbol":{"description":"The symbol representing the option contract.","example":"AAPL250620C00100000","type":"string"},"tradable":{"description":"Indicates whether the option contract is tradable.","example":true,"type":"boolean"},"type":{"$ref":"#/components/schemas/OptionContractType"},"underlying_asset_id":{"description":"The unique identifier of the underlying asset.","example":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","format":"uuid","type":"string"},"underlying_symbol":{"description":"The underlying symbol of the option contract.","example":"AAPL","type":"string"}},"required":["id","symbol","name","status","tradable","expiration_date","underlying_symbol","underlying_asset_id","type","style","strike_price","multiplier","size"],"type":"object"},"OptionContractStyle":{"description":"The style of the option contract.","enum":["american","european"],"example":"american","type":"string"},"OptionContractType":{"description":"The type of the option contract.","enum":["call","put"],"example":"call","type":"string"},"OptionDeliverable":{"properties":{"allocation_percentage":{"description":"Cost allocation percentage of the deliverable.\nThis is used to determine the cost basis of the equity shares received from the exercise, specially for non-standard contracts with multiple deliverables.\n","example":"100","type":"string"},"amount":{"description":"The deliverable amount. For cash deliverables, this is the cash amount.\nFor standard contract, this is always 100.\nThis field can be null in case the deliverable settlement is delayed and the amount is yet to be determined.\n","example":"100","type":"string"},"asset_id":{"description":"Unique identifier of the deliverable asset. For standard contracts, this is equivalent to underlying_asset_id of the contracts.\nThis field is not returned for cash deliverables.\n","example":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","format":"uuid","type":"string"},"delayed_settlement":{"description":"If true, the settlement of the deliverable will be delayed.\nFor instance, in the event of a contract with a delayed deliverable being exercised, both the availability of the deliverable and its settlement may be postponed beyond the typical timeframe.\n","example":false,"type":"boolean"},"settlement_method":{"description":"Indicates the settlement method that will be used:\n- **BTOB**: Broker to Broker\n- **CADF**: Cash Difference\n- **CAFX**: Cash Fixed\n- **CCC**: Correspondent Clearing Corp\n","enum":["BTOB","CADF","CAFX","CCC"],"example":"CCC","type":"string"},"settlement_type":{"description":"Indicates when the deliverable will be settled if the contract is exercised/assigned.\n","enum":["T+0","T+1","T+2","T+3","T+4","T+5"],"example":"T+2","type":"string"},"symbol":{"description":"Symbol of the deliverable. For standard contracts, this is equivalent to the underlying symbol of the contract.\n","example":"AAPL","type":"string"},"type":{"description":"Type of deliverable, indicating whether it's cash or equity. For standard contracts, it is always \"equity\".\n","enum":["cash","equity"],"example":"equity","type":"string"}},"required":["type","symbol","amount","allocation_percentage","settlement_type","settlement_method","delayed_settlement"],"type":"object"},"Order":{"description":"The Orders API allows a user to monitor, place and cancel their orders with Alpaca.\n\nEach order has a unique identifier provided by the client. This client-side unique order ID will be automatically generated by the system if not provided by the client, and will be returned as part of the order object along with the rest of the fields described below. Once an order is placed, it can be queried using the client-side order ID to check the status.\n\nUpdates on open orders at Alpaca will also be sent over the streaming interface, which is the recommended method of maintaining order state.","properties":{"asset_class":{"$ref":"#/components/schemas/AssetClass"},"asset_id":{"description":"Asset ID (For options this represents the option contract ID)","format":"uuid","type":"string"},"canceled_at":{"format":"date-time","nullable":true,"type":"string"},"client_order_id":{"description":"Client unique order ID","maxLength":128,"type":"string"},"created_at":{"format":"date-time","type":"string"},"expired_at":{"format":"date-time","nullable":true,"type":"string"},"expires_at":{"format":"date-time","type":"string"},"extended_hours":{"description":"If true, eligible for execution outside regular trading hours.","type":"boolean"},"failed_at":{"format":"date-time","nullable":true,"type":"string"},"filled_at":{"format":"date-time","nullable":true,"type":"string"},"filled_avg_price":{"description":"Filled average price","nullable":true,"type":"string"},"filled_qty":{"description":"Filled quantity","minLength":1,"type":"string"},"hwm":{"description":"The highest (lowest) market price seen since the trailing stop order was submitted.","nullable":true,"type":"string"},"id":{"description":"Order ID","format":"uuid","type":"string"},"legs":{"description":"When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order. Otherwise, null. Required if order class is `mleg`.","items":{"$ref":"#/components/schemas/OrderLeg"},"nullable":true,"type":"array"},"limit_price":{"description":"Limit price","nullable":true,"type":"string"},"notional":{"description":"Ordered notional amount. If entered, qty will be null. Can take up to 9 decimal points.","minLength":1,"nullable":true,"type":"string"},"order_class":{"$ref":"#/components/schemas/OrderClass"},"order_type":{"deprecated":true,"description":"Deprecated in favour of the field \"type\" ","type":"string"},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"qty":{"description":"Ordered quantity. If entered, notional will be null. Can take up to 9 decimal points. Required if order class is `mleg`.","minLength":1,"nullable":true,"type":"string"},"ratio_qty":{"description":"The proportional quantity of this leg in relation to the overall multi-leg order quantity.","format":"decimal","nullable":true,"type":"string"},"replaced_at":{"format":"date-time","nullable":true,"type":"string"},"replaced_by":{"description":"The order ID that this order was replaced by","format":"uuid","nullable":true,"type":"string"},"replaces":{"description":"The order ID that this order replaces","format":"uuid","nullable":true,"type":"string"},"side":{"$ref":"#/components/schemas/OrderSide"},"status":{"$ref":"#/components/schemas/OrderStatus"},"stop_price":{"description":"Stop price","nullable":true,"type":"string"},"submitted_at":{"format":"date-time","nullable":true,"type":"string"},"symbol":{"description":"Asset symbol, required for all order classes except for `mleg`","minLength":1,"type":"string"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"trail_percent":{"description":"The percent value away from the high water mark for trailing stop orders.","nullable":true,"type":"string"},"trail_price":{"description":"The dollar value away from the high water mark for trailing stop orders.","nullable":true,"type":"string"},"type":{"$ref":"#/components/schemas/OrderType"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["notional","type","time_in_force"],"title":"Order","type":"object"},"OrderClass":{"description":"The order classes supported by Alpaca vary based on the order's security type. The following provides a comprehensive breakdown of the supported order classes for each category:\n  - Equity trading: simple (or \"\"), oco, oto, bracket.\n  - Options trading:\n    - simple (or \"\")\n    - mleg (required for multi-leg complex option strategies)\n  - Crypto trading: simple (or \"\").","enum":["simple","bracket","oco","oto","mleg",""],"example":"bracket","title":"OrderClass","type":"string"},"OrderLeg":{"description":"This is copy of Order response schemas as a workaround of displaying issue of nested Order recursively for legs","properties":{"asset_class":{"$ref":"#/components/schemas/AssetClass"},"asset_id":{"description":"Asset ID (For options this represents the option contract ID)","format":"uuid","type":"string"},"canceled_at":{"format":"date-time","nullable":true,"type":"string"},"client_order_id":{"description":"Client unique order ID","maxLength":128,"type":"string"},"created_at":{"format":"date-time","type":"string"},"expired_at":{"format":"date-time","nullable":true,"type":"string"},"extended_hours":{"description":"If true, eligible for execution outside regular trading hours.","type":"boolean"},"failed_at":{"format":"date-time","nullable":true,"type":"string"},"filled_at":{"format":"date-time","nullable":true,"type":"string"},"filled_avg_price":{"description":"Filled average price","nullable":true,"type":"string"},"filled_qty":{"description":"Filled quantity","minLength":1,"type":"string"},"hwm":{"description":"The highest (lowest) market price seen since the trailing stop order was submitted.","nullable":true,"type":"string"},"id":{"description":"Order ID","format":"uuid","type":"string"},"legs":{"description":"Always null for an order leg; legs are not nested beyond one level.","example":null,"items":{"type":"object"},"nullable":true,"type":"array"},"limit_price":{"description":"Limit price","nullable":true,"type":"string"},"notional":{"description":"Ordered notional amount. If entered, qty will be null. Can take up to 9 decimal points.","minLength":1,"nullable":true,"type":"string"},"order_class":{"$ref":"#/components/schemas/OrderClass"},"order_type":{"deprecated":true,"description":"Deprecated in favour of the field \"type\" ","type":"string"},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"qty":{"description":"Ordered quantity. If entered, notional will be null. Can take up to 9 decimal points.","minLength":1,"nullable":true,"type":"string"},"replaced_at":{"format":"date-time","nullable":true,"type":"string"},"replaced_by":{"description":"The order ID that this order was replaced by","format":"uuid","nullable":true,"type":"string"},"replaces":{"description":"The order ID that this order replaces","format":"uuid","nullable":true,"type":"string"},"side":{"$ref":"#/components/schemas/OrderSide"},"status":{"$ref":"#/components/schemas/OrderStatus"},"stop_price":{"description":"Stop price","nullable":true,"type":"string"},"submitted_at":{"format":"date-time","nullable":true,"type":"string"},"symbol":{"description":"Asset symbol","minLength":1,"type":"string"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"trail_percent":{"description":"The percent value away from the high water mark for trailing stop orders.","nullable":true,"type":"string"},"trail_price":{"description":"The dollar value away from the high water mark for trailing stop orders.","nullable":true,"type":"string"},"type":{"$ref":"#/components/schemas/OrderType"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["symbol","type","time_in_force","notional","qty","side"],"title":"Order","type":"object"},"OrderSide":{"description":"Represents which side this order was on:\n- buy\n- sell\nRequired for all order classes except for mleg.","enum":["buy","sell"],"example":"buy","title":"OrderSide","type":"string"},"OrderStatus":{"description":"An order executed through Alpaca can experience several status changes during its lifecycle. The most common statuses are described in detail below:\n\n- new\n  The order has been received by Alpaca, and routed to exchanges for execution. This is the usual initial state of an order.\n\n- partially_filled\n  The order has been partially filled.\n\n- filled\n  The order has been filled, and no further updates will occur for the order.\n\n- done_for_day\n  The order is done executing for the day, and will not receive further updates until the next trading day.\n\n- canceled\n  The order has been canceled, and no further updates will occur for the order. This can be either due to a cancel request by the user, or the order has been canceled by the exchanges due to its time-in-force.\n\n- expired\n  The order has expired, and no further updates will occur for the order.\n\n- replaced\n  The order was replaced by another order, or was updated due to a market event such as corporate action.\n\n- pending_cancel\n  The order is waiting to be canceled.\n\n- pending_replace\n  The order is waiting to be replaced by another order. The order will reject cancel request while in this state.\n\nLess common states are described below. Note that these states only occur on very rare occasions, and most users will likely never see their orders reach these states:\n\n- accepted\n  The order has been received by Alpaca, but hasn't yet been routed to the execution venue. This could be seen often out side of trading session hours.\n\n- pending_new\n  The order has been received by Alpaca, and routed to the exchanges, but has not yet been accepted for execution. This state only occurs on rare occasions.\n\n- accepted_for_bidding\n  The order has been received by exchanges, and is evaluated for pricing. This state only occurs on rare occasions.\n\n- stopped\n  The order has been stopped, and a trade is guaranteed for the order, usually at a stated price or better, but has not yet occurred. This state only occurs on rare occasions.\n\n- rejected\n  The order has been rejected, and no further updates will occur for the order. This state occurs on rare occasions and may occur based on various conditions decided by the exchanges.\n\n- suspended\n  The order has been suspended, and is not eligible for trading. This state only occurs on rare occasions.\n\n- calculated\n  The order has been completed for the day (either filled or done for day), but remaining settlement calculations are still pending. This state only occurs on rare occasions.\n\n\nAn order may be canceled through the API up until the point it reaches a state of either filled, canceled, or expired.","enum":["new","partially_filled","filled","done_for_day","canceled","expired","replaced","pending_cancel","pending_replace","accepted","pending_new","accepted_for_bidding","stopped","rejected","suspended","calculated","held"],"example":"new","title":"OrderStatus","type":"string"},"OrderType":{"description":"The order types supported by Alpaca vary based on the order's security type. The following provides a comprehensive breakdown of the supported order types for each category:\n - Equity trading: market, limit, stop, stop_limit, trailing_stop.\n - Options trading: market, limit.\n - Multileg Options trading: market, limit.\n - Crypto trading: market, limit, stop_limit.","enum":["market","limit","stop","stop_limit","trailing_stop"],"example":"market","title":"OrderType","type":"string"},"PatchOrderRequest":{"description":"Represents a request to patch an order.\n\nNote: `qty` and `notional` are mutually exclusive on a single replace request. `notional` is only valid for IPO indications of interest (`asset_class: \"ipo\"`); non-IPO notional orders cannot be replaced at all.","properties":{"advanced_instructions":{"$ref":"#/components/schemas/AdvancedInstructions"},"client_order_id":{"description":"A unique identifier for the new order. Automatically generated if not sent. (<= 128 characters)","maxLength":128,"type":"string"},"limit_price":{"description":"Required if original order's `type` field was `limit` or `stop_limit`.\nIn case of `mleg`, the limit_price parameter is expressed with the following notation:\n- A positive value indicates a debit, representing a cost or payment to be made.\n- A negative value signifies a credit, reflecting an amount to be received.","example":"3.14","type":"string"},"notional":{"description":"New notional (dollar amount) for the order. Only valid for IPO indications of interest (`asset_class: \"ipo\"`); will be rejected for any other asset class.\nMutually exclusive with `qty` on the same replace request.","example":"750","type":"string"},"qty":{"description":"number of shares to trade.\n\nYou can only patch full shares for now.\n\nQty of equity fractional orders are not allowed to change. Non-IPO notional orders cannot be replaced at all - no fields (qty, limit_price, stop_price, etc.) can be modified; cancel and resubmit instead.","example":"4","type":"string"},"stop_price":{"description":"required if original order type is limit or stop_limit","example":"3.14","type":"string"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"trail":{"description":"the new value of the trail_price or trail_percent value (works only for type=\"trailing_stop\")","example":"3.14","type":"string"}},"title":"PatchOrderRequest","type":"object"},"PortfolioHistory":{"description":"Timeseries data for equity and profit loss information of the account.","properties":{"base_value":{"description":"basis in dollar of the profit loss calculation","type":"number"},"base_value_asof":{"description":"If included, then it indicates that the base_value is the account's closing\nequity value at this trading date.\n\nIf not specified, then the baseline calculation is done against the earliest returned data item. This could happen for\naccounts without prior closing balances (e.g. new account) or for queries with 1D timeframes, where the first data point\nis used as a reference point.\n","example":"2023-10-20","format":"date","type":"string"},"cashflow":{"description":"accumulated value in dollar amount as of the end of each time window","type":"object"},"equity":{"description":"equity value of the account in dollar amount as of the end of each time window","items":{"type":"number"},"type":"array"},"profit_loss":{"description":"profit/loss in dollar from the base value","items":{"type":"number"},"type":"array"},"profit_loss_pct":{"description":"profit/loss in percentage from the base value","example":[0.001,0.002],"items":{"type":"number"},"type":"array"},"timeframe":{"description":"time window size of each data element","example":"15Min","type":"string"},"timestamp":{"description":"Time of each data element, left-labeled (the beginning of time window).\n\nThe values returned are in [UNIX epoch format](https://en.wikipedia.org/wiki/Unix_time).\n","items":{"type":"integer"},"type":"array"}},"required":["timestamp","equity","profit_loss","profit_loss_pct","base_value","timeframe"],"title":"PortfolioHistory","type":"object","x-examples":{"example-cashflows":{"base_value":8413.04,"base_value_asof":"2026-04-06","cashflow":{"CSD":[9.93,10.13,10.16,0],"DIV":[0,0,0.63,0]},"equity":[8425.21,8639.77,8766.1,8835.31],"profit_loss":[12.17,214.56,126.33,69.21],"profit_loss_pct":[0.0014,0.0255,0.0146,0.0079],"timeframe":"1D","timestamp":[1775606400,1775692800,1775779200,1775865600]},"example-intraday-query-15min-1d":{"base_value":2774.16,"base_value_asof":"2023-10-18","equity":[2773.79,2769.04,2768.65,2765.11,2763.03,2763.17,2763.17,2763.47,2763.91,2768.13,2774.98,2757.94,2757.65,2774.54,2775.58,2775.28,2767.9,2762.26,2762.56,2756.99,2756.84,2752.43,2752.13,2748.44,2751.23,2747.54,2748.74],"profit_loss":[-0.37,-5.12,-5.51,-9.05,-11.13,-10.99,-10.99,-10.69,-10.25,-6.03,0.82,-16.22,-16.51,0.38,1.42,1.12,-6.26,-11.9,-11.6,-17.17,-17.32,-21.73,-22.03,-25.72,-22.93,-26.62,-25.42],"profit_loss_pct":[-0.0001,-0.0018,-0.002,-0.0033,-0.004,-0.004,-0.004,-0.0039,-0.0037,-0.0022,0.0003,-0.0058,-0.006,0.0001,0.0005,0.0004,-0.0023,-0.0043,-0.0042,-0.0062,-0.0062,-0.0078,-0.0079,-0.0093,-0.0083,-0.0096,-0.0092],"timeframe":"15Min","timestamp":[1697722200,1697723100,1697724000,1697724900,1697725800,1697726700,1697727600,1697728500,1697729400,1697730300,1697731200,1697732100,1697733000,1697733900,1697734800,1697735700,1697736600,1697737500,1697738400,1697739300,1697740200,1697741100,1697742000,1697742900,1697743800,1697744700,1697745600]},"example-query-1d-7d":{"base_value":2784.79,"equity":[2784.79,2794.79,2805.46,2774.16,2748.73],"profit_loss":[0,10.0022,10.6692,-31.2996,-25.4232],"profit_loss_pct":[0,0.0035,0.0074,-0.0038,-0.0129],"timeframe":"1D","timestamp":[1697241600,1697500800,1697587200,1697673600,1697760000]}}},"Position":{"description":"The positions API provides information about an account's current open positions. The response will include information such as cost basis, shares traded, and market value, which will be updated live as price information is updated. Once a position is closed, it will no longer be queryable through this API.","properties":{"asset_class":{"$ref":"#/components/schemas/AssetClass"},"asset_id":{"description":"Asset ID (For options this represents the option contract ID)","format":"uuid","type":"string"},"asset_marginable":{"type":"boolean"},"avg_entry_price":{"description":"Average entry price of the position","minLength":1,"type":"string"},"avg_entry_swap_rate":{"description":"The weighted-average exchange rate at the time the position was entered.","format":"decimal","type":"string"},"change_today":{"description":"Percent change from last day price (by a factor of 1)","minLength":1,"type":"string"},"cost_basis":{"description":"Total cost basis in dollar","minLength":1,"type":"string"},"current_price":{"description":"Current asset price per share","minLength":1,"type":"string"},"exchange":{"$ref":"#/components/schemas/ExchangeForPosition"},"lastday_price":{"description":"Last day's asset price per share based on the closing value of the last trading day","minLength":1,"type":"string"},"market_value":{"description":"Total dollar amount of the position","minLength":1,"type":"string"},"prev_swap_rate":{"description":"The exchange rate as of the previous close (i.e. yesterday's rate)","format":"decimal","type":"string"},"qty":{"description":"The number of shares","minLength":1,"type":"string"},"qty_available":{"description":"Total number of shares available minus open orders / locked for options covered call","minLength":1,"type":"string"},"side":{"description":"long","enum":["long","short"],"type":"string"},"swap_rate":{"description":"The current exchange rate (without mark-up) used to convert local-currency position values into USD. Present only for LCT (Local Currency Trading) accounts","format":"decimal","type":"string"},"symbol":{"description":"Symbol name of the asset","example":"AAPL","type":"string"},"unrealized_intraday_pl":{"description":"Unrealized profit/loss in dollars for the day","minLength":1,"type":"string"},"unrealized_intraday_plpc":{"description":"Unrealized profit/loss percent (by a factor of 1)","minLength":1,"type":"string"},"unrealized_pl":{"description":"Unrealized profit/loss in dollars","minLength":1,"type":"string"},"unrealized_plpc":{"description":"Unrealized profit/loss percent (by a factor of 1)","minLength":1,"type":"string"},"usd":{"$ref":"#/components/schemas/USDPositionValues"}},"required":["asset_id","symbol","exchange","asset_class","avg_entry_price","qty","side","market_value","cost_basis","unrealized_pl","unrealized_plpc","unrealized_intraday_pl","unrealized_intraday_plpc","current_price","lastday_price","change_today","asset_marginable"],"title":"Position","type":"object","x-examples":{"example-1":{"asset_class":"us_equity","asset_id":"904837e3-3b76-47ec-b432-046db621571b","avg_entry_price":"100.0","change_today":"0.0084","cost_basis":"500.0","current_price":"120.0","exchange":"NASDAQ","lastday_price":"119.0","market_value":"600.0","qty":"5","qty_available":"4","side":"long","symbol":"AAPL","unrealized_intraday_pl":"10.0","unrealized_intraday_plpc":"0.0084","unrealized_pl":"100.0","unrealized_plpc":"0.20"},"example-2":{"asset_class":"us_equity","asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","asset_marginable":false,"avg_entry_price":"174.78","change_today":"-0.0018326556325525","cost_basis":"349.56","current_price":"174.29","exchange":"NASDAQ","lastday_price":"174.61","market_value":"348.58","qty":"2","qty_available":"2","side":"long","symbol":"AAPL","unrealized_intraday_pl":"-0.98","unrealized_intraday_plpc":"-0.0028035244307129","unrealized_pl":"-0.98","unrealized_plpc":"-0.0028035244307129"}}},"PositionClosedReponse":{"description":"Represents the result of asking the api to close a position. ","properties":{"body":{"$ref":"#/components/schemas/Order"},"status":{"description":"HTTP status code for the attempt to close this position","type":"integer"},"symbol":{"description":"Symbol name of the asset","type":"string"}},"required":["symbol","status"],"title":"PositionClosedReponse","type":"object","x-examples":{"example-1":{"body":{"asset_class":"us_equity","asset_id":"b0b6dd9d-8b9b-48a9-ba46-b9d54906e415","canceled_at":null,"client_order_id":"52f8574c-96d5-49b6-94c1-2570a268434e","created_at":"2022-02-04T16:53:29.53427917Z","expired_at":null,"extended_hours":false,"failed_at":null,"filled_at":null,"filled_avg_price":null,"filled_qty":"0","hwm":null,"id":"f7f25e89-939a-4587-aaf6-414a6b3c341d","legs":null,"limit_price":null,"notional":null,"order_class":"","order_type":"market","qty":"2","replaced_at":null,"replaced_by":null,"replaces":null,"side":"sell","status":"accepted","stop_price":null,"submitted_at":"2022-02-04T16:53:29.533738219Z","symbol":"AAPL","time_in_force":"day","trail_percent":null,"trail_price":null,"type":"market","updated_at":"2022-02-04T16:53:29.53427917Z"},"status":200,"symbol":"AAPL"}}},"PositionIntent":{"description":"Represents the desired position strategy.","enum":["buy_to_open","buy_to_close","sell_to_open","sell_to_close"],"example":"buy_to_open","title":"PositionIntent","type":"string"},"ReverseSplitActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonSplitStockActivityV2"},{"properties":{"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"new_symbol":{"description":"Symbol of the new security after the split","type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["symbol"],"type":"object"}],"description":"Reverse stock split","type":"object"},"RightsDistributionActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"properties":{"ex_date":{"description":"The ex_date for this corporate action","format":"date","minLength":1,"type":"string"},"expiration_date":{"description":"The expiration date for the rights distribution","format":"date","type":"string"},"new_cusip":{"description":"The new CUSIP","type":"string"},"new_qty":{"description":"The new quantity","type":"string"},"new_symbol":{"description":"The new symbol","type":"string"},"payable_date":{"description":"The payable_date for this corporate action","format":"date","minLength":1,"type":"string"},"rate":{"description":"The rate for the rights distribution","type":"string"},"record_date":{"description":"The record_date for this corporate action","format":"date","minLength":1,"type":"string"},"source_cusip":{"description":"The source CUSIP","type":"string"},"source_qty":{"description":"The source quantity","type":"string"},"source_symbol":{"description":"The source symbol","type":"string"}},"required":["source_cusip","source_symbol","source_qty","new_cusip","new_symbol","new_qty","rate"],"type":"object"}],"description":"Rights distribution","type":"object"},"RightsSubscriptionElectionActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"$ref":"#/components/schemas/CommonVOFSubtypeActivityV2"}],"type":"object"},"SDIVActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"$ref":"#/components/schemas/CommonSDIVActivityV2"},{"properties":{"entitled_qty":{"description":"Quantity of shares entitled to receive the dividend","type":"string"},"new_qty":{"description":"The total number of shares after the dividend","type":"string"},"paid_qty":{"description":"The paid quantity","type":"string"}},"required":["entitled_qty","paid_qty","new_qty"],"type":"object"}],"description":"Stock dividend","type":"object"},"SpinoffActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"$ref":"#/components/schemas/CommonSpinoffActivityV2"},{"properties":{"new_qty":{"description":"The new quantity","type":"string"},"source_qty":{"description":"The source quantity","type":"string"}},"required":["source_qty","new_qty"],"type":"object"}],"description":"Spinoff","type":"object"},"TenderOfferActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"$ref":"#/components/schemas/CommonVOFSubtypeActivityV2"}],"type":"object"},"TimeInForce":{"description":"The Time-In-Force values supported by Alpaca vary based on the order's security type. Here is a breakdown of the supported TIFs for each specific security type:\n- Equity trading: day, gtc, opg, cls, ioc, fok.\n- Options trading: day.\n- Crypto trading: gtc, ioc.\n\nBelow are the descriptions of each TIF:\n- day:\n  A day order is eligible for execution only on the day it is live. By default, the order is only valid during Regular Trading Hours (9:30am - 4:00pm ET). If unfilled after the closing auction, it is automatically canceled. If submitted after the close, it is queued and submitted the following trading day. However, if marked as eligible for extended hours, the order can also execute during supported extended hours.\n\n- gtc:\n  The order is good until canceled. Non-marketable GTC limit orders are subject to price adjustments to offset corporate actions affecting the issue. We do not currently support Do Not Reduce (DNR) orders to opt out of such price adjustments.\n\n- opg:\n  Use this TIF with a market/limit order type to submit \"market on open\" (MOO) and \"limit on open\" (LOO) orders. This order is eligible to execute only in the market opening auction. Any unfilled orders after the open will be cancelled. OPG orders submitted after 9:28am but before 7:00pm ET will be rejected. OPG orders submitted after 7:00pm will be queued and routed to the following day's opening auction. On open/on close orders are routed to the primary exchange. Such orders do not necessarily execute exactly at 9:30am / 4:00pm ET but execute per the exchange's auction rules.\n\n- cls:\n  Use this TIF with a market/limit order type to submit \"market on close\" (MOC) and \"limit on close\" (LOC) orders. This order is eligible to execute only in the market closing auction. Any unfilled orders after the close will be cancelled. CLS orders submitted after 3:50pm but before 7:00pm ET will be rejected. CLS orders submitted after 7:00pm will be queued and routed to the following day's closing auction. Only available with API v2.\n\n- ioc:\n  An Immediate Or Cancel (IOC) order requires all or part of the order to be executed immediately. Any unfilled portion of the order is canceled. Only available with API v2. Most market makers who receive IOC orders will attempt to fill the order on a principal basis only, and cancel any unfilled balance. On occasion, this can result in the entire order being cancelled if the market maker does not have any existing inventory of the security in question.\n\n- fok:\n  A Fill or Kill (FOK) order is only executed if the entire order quantity can be filled, otherwise the order is canceled. Only available with API v2.","enum":["day","gtc","opg","cls","ioc","fok"],"example":"day","title":"TimeInForce","type":"string"},"TokenizationIssuer":{"description":"The tokenized asset's issuer","enum":["xstocks","st0x"],"example":"xstocks","title":"TokenizationIssuer","type":"string"},"TokenizationMintRequest":{"properties":{"issuer":{"$ref":"#/components/schemas/TokenizationIssuer"},"network":{"$ref":"#/components/schemas/TokenizationNetwork"},"qty":{"description":"The underlying quantity to convert into the tokenized asset. It can be fractional.","type":"string"},"underlying_symbol":{"description":"The underlying asset symbol","type":"string"},"wallet_address":{"description":"The wallet address to receive the tokenized asset","type":"string"}},"required":["underlying_symbol","qty","issuer","network","wallet_address"],"title":"TokenizationMintRequest","type":"object"},"TokenizationMintResponse":{"properties":{"created_at":{"format":"date-time","type":"string"},"issuer":{"$ref":"#/components/schemas/TokenizationIssuer"},"network":{"$ref":"#/components/schemas/TokenizationNetwork"},"qty":{"description":"The quantity to convert for this tokenization request. It can be fractional.","type":"string"},"status":{"$ref":"#/components/schemas/TokenizationRequestStatus"},"token_symbol":{"description":"The tokenized asset symbol","type":"string"},"tokenization_request_id":{"description":"Unique identifier of the tokenization request set by Alpaca","type":"string"},"underlying_symbol":{"description":"The underlying asset symbol","type":"string"}},"required":["tokenization_request_id","status","underlying_symbol","token_symbol","qty","created_at","issuer","network"],"title":"TokenizationMintResponse","type":"object"},"TokenizationNetwork":{"description":"The token's blockchain network","enum":["solana","arbitrum","ethereum","binance","base","ton","tron","mantle"],"example":"solana","title":"TokenizationNetwork","type":"string"},"TokenizationRequest":{"properties":{"account":{"description":"Alpaca account ID associated with this tokenization request","type":"string"},"created_at":{"format":"date-time","type":"string"},"fees":{"description":"Fees charged for this tokenization request","nullable":true,"type":"string"},"issuer":{"$ref":"#/components/schemas/TokenizationIssuer"},"issuer_account":{"description":"Issuer's account ID associated with this tokenization request","type":"string"},"issuer_request_id":{"description":"Unique identifier of the tokenization request set by the issuer","nullable":true,"type":"string"},"network":{"$ref":"#/components/schemas/TokenizationNetwork"},"qty":{"description":"The quantity to convert for this tokenization request. It can be fractional.","type":"string"},"status":{"$ref":"#/components/schemas/TokenizationRequestStatus"},"token_symbol":{"description":"The tokenized asset symbol","type":"string"},"tokenization_request_id":{"description":"Unique identifier of the tokenization request set by Alpaca","type":"string"},"tx_hash":{"description":"Transaction hash of the completed request on the blockchain","nullable":true,"type":"string"},"type":{"$ref":"#/components/schemas/TokenizationRequestType"},"underlying_symbol":{"description":"The underlying asset symbol","type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"},"wallet_address":{"description":"The wallet address associated with this tokenization request","type":"string"}},"required":["tokenization_request_id","created_at","type","status","underlying_symbol","token_symbol","qty","issuer","network","wallet_address"],"title":"TokenizationRequest","type":"object"},"TokenizationRequestStatus":{"description":"Status of the tokenization request","enum":["pending","rejected","completed"],"example":"completed","title":"TokenizationRequestStatus","type":"string"},"TokenizationRequestType":{"description":"Tokenization request type","enum":["mint","redeem"],"example":"mint","title":"TokenizationRequestType","type":"string"},"TradingActivities":{"properties":{"activity_type":{"$ref":"#/components/schemas/ActivityType"},"cum_qty":{"description":"The cumulative quantity of shares involved in the execution.","type":"string"},"id":{"description":"An id for the activity. Always in \"::\" format. Can be sent as page_token in requests to facilitate the paging of results.","type":"string"},"leaves_qty":{"description":"For partially_filled orders, the quantity of shares that are left to be filled.\n","type":"string"},"order_id":{"description":"The id for the order that filled.","format":"uuid","type":"string"},"order_status":{"$ref":"#/components/schemas/OrderStatus"},"price":{"description":"The per-share price that the trade was executed at.","type":"string"},"qty":{"description":"The number of shares involved in the trade execution.","type":"string"},"side":{"description":"buy or sell","type":"string"},"symbol":{"description":"The symbol of the security being traded.","example":"AAPL","type":"string"},"transaction_time":{"description":"The time at which the execution occurred.","format":"date-time","type":"string"},"type":{"description":"fill or partial_fill","enum":["fill","partial_fill"],"example":"fill","type":"string"}},"title":"AccountTradingActivities","type":"object","x-examples":{"example-1":{"activity_type":"FILL","cum_qty":"2","id":"20220202135509981::2d7be4ff-d1f3-43e9-856a-0f5cf5c5088e","leaves_qty":"0","order_id":"b5abe576-6a8a-49f3-a353-46b72c1ccae9","order_status":"filled","price":"174.78","qty":"2","side":"buy","symbol":"AAPL","transaction_time":"2022-02-02T18:55:09.981482Z","type":"fill"}}},"TransferDirection":{"enum":["INCOMING","OUTGOING"],"example":"INCOMING","type":"string"},"USDPositionValues":{"description":"Position values in USD. This is returned for LCT (non-USD) accounts only.","properties":{"avg_entry_price":{"description":"Average entry price of the position in USD","example":"71.43","format":"decimal","type":"string"},"change_today":{"description":"Percent change from last day price (by a factor of 1)","example":"0.67","format":"decimal","type":"string"},"cost_basis":{"description":"Total cost basis in USD","example":"333.33","format":"decimal","type":"string"},"current_price":{"description":"Current asset price per share in USD","example":"80.0","format":"decimal","type":"string"},"lastday_price":{"description":"Last day's asset price per share based on the closing value of the last trading day in USD","example":"79.33","format":"decimal","type":"string"},"market_value":{"description":"Total market value of the position in USD","example":"400.00","format":"decimal","type":"string"},"unrealized_intraday_pl":{"description":"Unrealized profit/loss in USD for the day","example":"6.67","format":"decimal","type":"string"},"unrealized_intraday_plpc":{"description":"Unrealized intraday profit/loss percent (by a factor of 1)","example":"0.0084","format":"decimal","type":"string"},"unrealized_pl":{"description":"Unrealized profit/loss in USD","example":"66.67","format":"decimal","type":"string"},"unrealized_plpc":{"description":"Unrealized profit/loss percent (by a factor of 1)","example":"0.2","format":"decimal","type":"string"}},"required":["avg_entry_price","cost_basis"],"title":"USDPositionValues","type":"object"},"UnitSplitActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonSplitStockActivityV2"},{"properties":{"alternate_cusip":{"description":"CUSIP for the alternate security after the split","type":"string"},"alternate_qty":{"description":"Quantity of alternate shares received","type":"string"},"alternate_rate":{"description":"Ratio of alternate shares received","type":"string"},"alternate_symbol":{"description":"Symbol for the alternate security after the split","type":"string"},"effective_date":{"description":"When the unit split becomes effective","format":"date","minLength":1,"type":"string"},"new_symbol":{"description":"Symbol of the new security after the split","type":"string"},"old_symbol":{"description":"Symbol of the old security before the split","type":"string"}},"required":["old_symbol","new_symbol","alternate_cusip","alternate_symbol","alternate_rate","alternate_qty","effective_date"],"type":"object"}],"description":"Unit split","type":"object"},"UpdateWatchlistRequest":{"description":"Request format used for creating a new watchlist or updating an existing watchlist with a set of assets and name.","properties":{"name":{"description":"The watchlist name.","type":"string"},"symbols":{"description":"List of asset symbols to include in the watchlist.","items":{"nullable":true,"type":"string"},"type":"array"}},"required":["name"],"title":"PostWatchlistRequest","type":"object"},"WRMActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonCaActivityV2"},{"properties":{"cusip":{"description":"The CUSIP of the security involved with the activity","type":"string"},"removed_qty":{"description":"The removed quantity","type":"string"},"symbol":{"description":"The symbol of the security involved with the activity","type":"string"}},"required":["cusip","symbol","removed_qty"],"type":"object"}],"description":"Worthless Removal","type":"object"},"WalletFeeEstimateResponse":{"description":"Estimated on-chain fee breakdown for a proposed crypto withdrawal, including the total fee and the underlying network (gas) fee.","properties":{"fee":{"example":"0.0505","format":"decimal","type":"string"},"network_fee":{"example":"0.0825","format":"decimal","type":"string"}},"type":"object"},"WarrantExerciseElectionActivityV2":{"allOf":[{"$ref":"#/components/schemas/CommonNTAActivityV2"},{"$ref":"#/components/schemas/CommonVOFSubtypeActivityV2"}],"type":"object"},"Watchlist":{"description":"The watchlist API provides CRUD operation for the account's watchlist. An account can have multiple watchlists and each is uniquely identified by id but can also be addressed by user-defined name. Each watchlist is an ordered list of assets.\n","properties":{"account_id":{"description":"account ID","format":"uuid","type":"string"},"assets":{"description":"the content of this watchlist, in the order as registered by the client","items":{"$ref":"#/components/schemas/Assets"},"type":"array"},"created_at":{"format":"date-time","type":"string"},"id":{"description":"watchlist id","format":"uuid","type":"string"},"name":{"description":"user-defined watchlist name (up to 64 characters)","minLength":1,"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","account_id","created_at","updated_at","name"],"title":"Watchlist","type":"object","x-examples":{"example-1":{"account_id":"abe25343-a7ba-4255-bdeb-f7e013e9ee5d","assets":[{"class":"us_equity","easy_to_borrow":true,"exchange":"NASDAQ","fractionable":true,"id":"8ccae427-5dd0-45b3-b5fe-7ba5e422c766","marginable":true,"name":"Tesla, Inc. Common Stock","shortable":true,"status":"active","symbol":"TSLA","tradable":true}],"created_at":"2022-01-31T21:49:05.14628Z","id":"3174d6df-7726-44b4-a5bd-7fda5ae6e009","name":"Primary Watchlist","updated_at":"2022-01-31T21:49:05.14628Z"}}},"WatchlistWithoutAsset":{"description":"The watchlist API provides CRUD operation for the account's watchlist. An account can have multiple watchlists and each is uniquely identified by id but can also be addressed by user-defined name.\n","properties":{"account_id":{"description":"account ID","format":"uuid","type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"description":"watchlist id","format":"uuid","type":"string"},"name":{"description":"user-defined watchlist name (up to 64 characters)","minLength":1,"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","account_id","created_at","updated_at","name"],"title":"Watchlist","type":"object","x-examples":{"example-1":{"account_id":"abe25343-a7ba-4255-bdeb-f7e013e9ee5d","created_at":"2022-01-31T21:49:05.14628Z","id":"3174d6df-7726-44b4-a5bd-7fda5ae6e009","name":"Primary Watchlist","updated_at":"2022-01-31T21:49:05.14628Z"}}},"WhitelistedAddress":{"properties":{"address":{"description":"The whitelisted address","type":"string"},"asset":{"description":"Symbol of underlying asset for the whitelisted address","type":"string"},"chain":{"description":"Underlying network this address represents","type":"string"},"created_at":{"description":"Timestamp (RFC3339) of account creation.","format":"date-time","type":"string"},"id":{"description":"Unique ID for whitelisted address","type":"string"},"status":{"description":"Status of whitelisted address which is either APPROVED or PENDING. Whitelisted addresses will be subjected to a 24 waiting period. After the waiting period is over the status will become APPROVED.","enum":["APPROVED","PENDING"],"type":"string"}},"type":"object"},"bic":{"description":"Business Identifier Code (BIC/SWIFT).","example":"IRVTUS3NXXX","maxLength":11,"minLength":11,"pattern":"^[A-Z0-9]{11}$","type":"string"},"bond_status":{"description":"Status of the bond.","enum":["outstanding","matured","pre_issuance"],"type":"string"},"calendar_day":{"description":"A calendar day.","properties":{"core_end":{"description":"The end time of the core market session.","example":"2025-01-02T16:00:00-05:00","format":"date-time","type":"string"},"core_start":{"description":"The start time of the core market session.","example":"2025-01-02T09:30:00-05:00","format":"date-time","type":"string"},"date":{"description":"The date of the calendar day.","example":"2025-01-02","format":"date","type":"string"},"lunch_end":{"description":"The end time of the lunch session.","format":"date-time","type":"string"},"lunch_start":{"description":"The start time of the lunch session.","format":"date-time","type":"string"},"post_end":{"description":"The end time of the after-hours session.","example":"2025-01-02T20:00:00-05:00","format":"date-time","type":"string"},"post_start":{"description":"The start time of the after-hours session.","example":"2025-01-02T16:00:00-05:00","format":"date-time","type":"string"},"pre_end":{"description":"The end time of the pre-market session.","example":"2025-01-02T09:30:00-05:00","format":"date-time","type":"string"},"pre_start":{"description":"The start time of the pre-market session.","example":"2025-01-02T04:00:00-05:00","format":"date-time","type":"string"},"settlement_date":{"description":"The settlement date.","example":"2025-01-03","format":"date","type":"string"}},"required":["date","core_start","core_end"],"type":"object"},"call_type":{"description":"The type of call on the bond refers to one of a variety of circumstances under which a callable bond may be called.","enum":["ordinary","make_whole","regulatory","special"],"type":"string"},"clock":{"properties":{"is_market_day":{"description":"Whether the clock is on a market day.","type":"boolean"},"market":{"$ref":"#/components/schemas/public_market"},"next_market_close":{"description":"Next market close timestamp","format":"date-time","type":"string"},"next_market_open":{"description":"Next market open timestamp","format":"date-time","type":"string"},"phase":{"$ref":"#/components/schemas/phase"},"phase_until":{"description":"The end of the current phase.","format":"date-time","type":"string"},"timestamp":{"description":"The time on the clock.","format":"date-time","type":"string"}},"required":["market","timestamp","is_market_day","next_market_open","next_market_close","phase","phase_until"],"type":"object"},"clock_resp":{"description":"Clock response.","properties":{"clocks":{"items":{"$ref":"#/components/schemas/clock"},"type":"array"}},"required":["clocks"],"type":"object","x-go-name":"ClockResp"},"coupon_frequency":{"description":"How often the coupon is paid","enum":["annual","semi_annual","quarterly","monthly","zero"],"type":"string"},"coupon_type":{"description":"The type of the coupon rate","enum":["fixed","floating","zero"],"type":"string"},"day_count":{"description":"The day count convention used to calculate accrued interest.\n\n- `A/360`: calculates the daily interest using a 360-day year and then multiplies that by the actual number of days in each time period.\n- `A/365`: calculates the daily interest using a 365-day year and then multiplies that by the actual number of days in each time period.\n- `30/360`: calculates the daily interest using a 360-day year and then multiplies that by 30 (standardized month).\n- `30/365`: calculates the daily interest using a 365-day year and then multiplies that by 30 (standardized month).\n- `A/A`: calculates the daily interest using the actual number of days in the year and then multiplies that by the actual number of days in each time period.\n- `30E/360`: number of days equals to the actual number of days (for February). If the start date or the end date of the period is the 31st of a month, that date is set to the 30th. The number of days in a year is 360.\n- `B/252`: calculates the daily interest using a 252-business-day year and then multiplies that by the actual number of days in each time period.\n- `A/364`: calculates the daily interest using a 364-day year and then multiplies that by the actual number of days in each time period.\n","enum":["A/360","A/365","30/360","30/365","A/A","30E/360","B/252","A/364"],"type":"string"},"legacy_calendar_day":{"description":"A calendar day.","properties":{"close":{"description":"The time the market closes at on this date in HH:MM format.","example":"16:00","type":"string"},"date":{"description":"Date string in YYYY-MM-DD format.","example":"2025-01-02","format":"date","type":"string"},"open":{"description":"The time the market opens at on this date in HH:MM format.","example":"09:30","type":"string"},"session_close":{"description":"The time the session closes at on this date in HHMM format.","example":"2000","type":"string"},"session_open":{"description":"The time the session opens at on this date in HHMM format.","example":"0400","type":"string"},"settlement_date":{"description":"Date string in YYYY-MM-DD format. Representing the settlement date for the trade date.","example":"2025-01-03","format":"date","type":"string"}},"required":["date","open","close","session_open","session_close","settlement_date"],"type":"object"},"legacy_clock":{"example":{"is_open":true,"next_close":"2025-06-24T16:00:00-04:00","next_open":"2025-06-25T09:30:00-04:00","timestamp":"2025-06-24T14:15:22-04:00"},"properties":{"is_open":{"description":"Whether or not the market is open.","type":"boolean"},"next_close":{"description":"Next market close timestamp.","format":"date-time","type":"string"},"next_open":{"description":"Next market open timestamp.","format":"date-time","type":"string"},"timestamp":{"description":"Current timestamp.","format":"date-time","type":"string"}},"required":["timestamp","is_open","next_open","next_close"],"title":"Clock","type":"object"},"legacy_public_calendar_resp":{"items":{"$ref":"#/components/schemas/legacy_calendar_day"},"type":"array"},"market":{"description":"The market identifier (MIC, BIC, or acronym).","enum":["BMO","BNYM","BOATS","CEUX","CHIX","HKEX","IEX","IEXG","ISE","LSE","MTA","MTAA","NASDAQ","NYSE","OCEA","OPRA","OTC","OTCM","SIFMA","TADAWUL","XAMS","XBRU","XDUB","XETR","XETRA","XHKG","XLIS","XLON","XNAS","XNYS","XPAR","XSAU"],"type":"string"},"market_acronym":{"description":"The acronym of the market.","example":"NYSE","type":"string"},"market_name":{"description":"The full name of the market.","example":"New York Stock Exchange","type":"string"},"market_timezone":{"description":"The timezone of the market.","example":"America/New_York","type":"string"},"mic":{"description":"Market identifier code (ISO 10383).","example":"XNYS","maxLength":4,"minLength":4,"pattern":"^[A-Z0-9]{4}$","type":"string"},"phase":{"enum":["closed","pre","core","lunch","post"],"type":"string"},"public_calendar_resp":{"description":"Calendar response.","properties":{"calendar":{"description":"The market calendar.","items":{"$ref":"#/components/schemas/calendar_day"},"type":"array"},"market":{"$ref":"#/components/schemas/public_market"}},"required":["market","calendar"],"type":"object","x-go-name":"CalendarResp"},"public_market":{"description":"A market.","properties":{"acronym":{"$ref":"#/components/schemas/market_acronym"},"bic":{"$ref":"#/components/schemas/bic"},"mic":{"$ref":"#/components/schemas/mic"},"name":{"$ref":"#/components/schemas/market_name"},"timezone":{"$ref":"#/components/schemas/market_timezone"}},"required":["acronym","name","timezone"],"type":"object"},"sp_outlook":{"description":"A Standard & Poor's rating outlook indicates S&P's view regarding the potential direction of a long-term credit rating over the intermediate term (2 years for investment grade, 1 year for speculative grade)","enum":["positive","negative","developing","stable","not_rated","not_meaningful"],"type":"string"},"treasury_subtype":{"description":"The subtype of the treasury.","enum":["bond","bill","note","strips","tips","floating"],"type":"string"},"us_corporate":{"description":"A US corporate","properties":{"accrued_interest":{"description":"The interest that has accumulated on a bond in dollars per bond between the last interest payment and the present date that has not yet been paid to the bondholder","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"bond_status":{"$ref":"#/components/schemas/bond_status"},"call_type":{"$ref":"#/components/schemas/call_type"},"callable":{"description":"Whether the bond is callable, meaning the issuer has the right, but not the obligation to redeem the bond - in other words, pay out the bondholder - before its maturity date at a set price (the call price)","type":"boolean"},"close_price":{"description":"The price of the last transaction of a security before the market closes for normal trading, shown as a percentage of par value","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"close_price_date":{"description":"The date of the close price","format":"date","type":"string"},"close_yield_to_maturity":{"description":"Yield to maturity of the treasury after the last close","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"close_yield_to_worst":{"description":"Yield to worst of the treasury after the last close","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"convertible":{"description":"A flag indicating whether the bond is convertible","type":"boolean"},"country_domicile":{"description":"The country where the corporate is domiciled in the 2-alpha country code format (e.g., US, CA)","type":"string"},"coupon":{"description":"The annual interest rate paid on the bond as a percentage of par value","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"coupon_frequency":{"$ref":"#/components/schemas/coupon_frequency"},"coupon_type":{"$ref":"#/components/schemas/coupon_type"},"cusip":{"description":"CUSIP is a nine-character alphanumeric code that uniquely identifies the security","maxLength":12,"minLength":12,"pattern":"^[A-Z0-9]{9}$","type":"string"},"dated_date":{"description":"The dated date marks the beginning of the period for which interest starts accruing on the bond","format":"date","type":"string"},"day_count":{"$ref":"#/components/schemas/day_count"},"description":{"description":"Description of the corporate bond","type":"string"},"description_short":{"description":"Short description of the corporate bond","type":"string"},"first_coupon_date":{"description":"The date of the first coupon payment","format":"date","type":"string"},"isin":{"description":"International Securities Identification Number","maxLength":12,"minLength":12,"pattern":"^[A-Z]{2}[A-Z0-9]{9}[0-9]$","type":"string"},"issue_date":{"description":"The date on which the bond was issued","format":"date","type":"string"},"issue_minimum_denomination":{"description":"The smallest unit of the bond that can be purchased at its initial offering","type":"number"},"issue_price":{"description":"The price at which the bond was originally issued as a percentage of par value","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"issue_size":{"description":"The total size amount of the bond issue in the issuing currency","type":"number"},"issuer":{"description":"The name of the issuer of the corporate bond","type":"string"},"last_coupon_date":{"description":"The date of the last coupon payment","format":"date","type":"string"},"liquidity_institutional_aggregate":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to buy or sell (no minimum trading sizes)","type":"number"},"liquidity_institutional_buy":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to buy (no minimum trading sizes)","type":"number"},"liquidity_institutional_sell":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to sell (no minimum trading sizes)","type":"number"},"liquidity_micro_aggregate":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to buy or sell with minimum trading sizes less than or equal to $1,000.00","type":"number"},"liquidity_micro_buy":{"description":"Score (from 1-5 if the bond is priced, or null if the bond is not tradable) reflecting the historical depth of executable liquidity to buy with minimum trading sizes less than or equal to $1,000.00","type":"number"},"liquidity_micro_sell":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to sell with minimum trading sizes less than or equal to $1,000.00","type":"number"},"liquidity_retail_aggregate":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to buy or sell with minimum trading sizes less than or equal to 10,000","type":"number"},"liquidity_retail_buy":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to buy with minimum trading sizes less than or equal to $10,000.00","type":"number"},"liquidity_retail_sell":{"description":"Score (from 1-5 or null if the bond is not priced/tradable) reflecting the historical depth of executable liquidity to sell with minimum trading sizes less than or equal to 10,000","type":"number"},"marginable":{"description":"Whether the corporate is marginable","type":"boolean"},"maturity_date":{"description":"The date on which the bond matures","format":"date","type":"string"},"next_call_date":{"description":"The date of the next possible call on the bond.","format":"date","type":"string"},"next_call_price":{"description":"The price at which a callable bond can be redeemed by the issuer on the next call date, as a percentage of par.","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"next_coupon_date":{"description":"The date of the next coupon payment","format":"date","type":"string"},"par_value":{"description":"The amount that the issuer of the bond will pay back to the bondholder upon maturity","type":"number"},"perpetual":{"description":"A flag representing whether a bond is perpetual","type":"boolean"},"puttable":{"description":"Whether the bond is puttable, meaning the bondholder has the right, but not the obligation to sell the bond back to the issuer at a set price (the put price) on specified dates before maturity","type":"boolean"},"reg_s":{"description":"Indicates whether the security falls under Regulation S, a rule that provides an exemption from the registration requirements for securities offerings made outside the United States","type":"boolean"},"reissue_date":{"description":"The date on which the corporate was reissued","format":"date","type":"string"},"reissue_price":{"description":"The price at which the corporate was reissued as a percentage of par value","format":"double","type":"number","x-go-type":"decimal.Decimal","x-go-type-import":{"name":"decimal","path":"github.com/alpacahq/alpacadecimal"}},"reissue_size":{"description":"The total size amount of the corporate reissue in the issuing currency","type":"number"},"sector":{"description":"The sector of the corporate bond","type":"string"},"seniority":{"description":"The seniority of the corporate bond","type":"string"},"sp_creditwatch":{"description":"S&P's CreditWatch highlights S&P's opinion regarding the potential direction of a short-term or long-term rating","type":"string"},"sp_creditwatch_date":{"description":"The date of the most recent Standard & Poor's CreditWatch for the bond in YYYY-MM-DD format","format":"date","type":"string"},"sp_outlook":{"$ref":"#/components/schemas/sp_outlook"},"sp_outlook_date":{"description":"The date of the most recent Standard & Poor's outlook for the bond in YYYY-MM-DD format","format":"date","type":"string"},"sp_rating":{"description":"Standard & Poor's rating for the bond in the standard AAA - D format","type":"string"},"sp_rating_date":{"description":"The date in the timezone of the issuing country of the most recent Standard & Poor's rating for the bond in YYYY-MM-DD format","format":"date","type":"string"},"ticker":{"description":"The ticker symbol of the corporate","type":"string"},"tradable":{"description":"Whether the treasury is tradable","type":"boolean"}},"required":["isin","cusip","bond_status","tradable","marginable","issue_date","country_domicile","ticker","seniority","issuer","sector","description","description_short","coupon","coupon_type","coupon_frequency","perpetual","day_count","dated_date","issue_size","issue_price","issue_minimum_denomination","par_value","callable","puttable","convertible","reg_s"],"type":"object"},"us_corporates_resp":{"properties":{"us_corporates":{"items":{"$ref":"#/components/schemas/us_corporate"},"type":"array"}},"required":["us_corporates"],"type":"object"},"us_treasuries_resp":{"properties":{"us_treasuries":{"items":{"$ref":"#/components/schemas/us_treasury"},"type":"array"}},"required":["us_treasuries"],"type":"object"},"us_treasury":{"description":"A US treasury","properties":{"bond_status":{"$ref":"#/components/schemas/bond_status"},"close_price":{"description":"The price of the last transaction of a security before the market closes for normal trading, shown as a percentage of par value","format":"double","type":"number"},"close_price_date":{"description":"The date of the close price","format":"date","type":"string"},"close_yield_to_maturity":{"description":"Yield to maturity of the treasury after the last close","format":"double","type":"number"},"close_yield_to_worst":{"description":"Yield to worst of the treasury after the last close","format":"double","type":"number"},"coupon":{"description":"The annual interest rate paid on the bond as a percentage of par value","format":"double","type":"number"},"coupon_frequency":{"$ref":"#/components/schemas/coupon_frequency"},"coupon_type":{"$ref":"#/components/schemas/coupon_type"},"cusip":{"description":"CUSIP is a nine-character alphanumeric code that uniquely identifies the security","maxLength":12,"minLength":12,"pattern":"^[A-Z0-9]{9}$","type":"string"},"description":{"description":"Description of the treasury","type":"string"},"description_short":{"description":"Short description of the treasury","type":"string"},"first_coupon_date":{"description":"The date of the first coupon payment","format":"date","type":"string"},"isin":{"description":"International Securities Identification Number","maxLength":12,"minLength":12,"pattern":"^[A-Z]{2}[A-Z0-9]{9}[0-9]$","type":"string"},"issue_date":{"description":"The date on which the bond was issued","format":"date","type":"string"},"last_coupon_date":{"description":"The date of the last coupon payment","format":"date","type":"string"},"maturity_date":{"description":"The date on which the bond matures","format":"date","type":"string"},"next_coupon_date":{"description":"The date of the next coupon payment","format":"date","type":"string"},"subtype":{"$ref":"#/components/schemas/treasury_subtype"},"tradable":{"description":"Whether the treasury is tradable","type":"boolean"}},"required":["cusip","isin","bond_status","tradable","subtype","issue_date","maturity_date","description","description_short","coupon","coupon_type","coupon_frequency"],"type":"object"}},"securitySchemes":{"API_Key":{"description":"","in":"header","name":"APCA-API-KEY-ID","type":"apiKey"},"API_Secret":{"description":"","in":"header","name":"APCA-API-SECRET-KEY","type":"apiKey"}}},"info":{"contact":{"email":"support@alpaca.markets","name":"Alpaca Support","url":"https://alpaca.markets/support"},"description":"Alpaca's Trading API is a modern platform for algorithmic trading.","termsOfService":"https://s3.amazonaws.com/files.alpaca.markets/disclosures/library/TermsAndConditions.pdf","title":"Trading API","version":"2.0.1"},"openapi":"3.0.0","paths":{"/v1/locates":{"get":{"description":"Returns locates filtered by status, symbol, or date range. Results are sorted by `created_at` descending, with `id` descending as the tie-breaker.","operationId":"listLocates","parameters":[{"$ref":"#/components/parameters/PageToken"},{"description":"Maximum number of results to return.","in":"query","name":"limit","required":false,"schema":{"default":1000,"maximum":10000,"minimum":1,"type":"integer"}},{"description":"Filter by locate status.","example":"active","in":"query","name":"status","required":false,"schema":{"$ref":"#/components/schemas/LocateStatus"}},{"description":"Filter by stock symbol.","example":"TSLA","in":"query","name":"symbol","required":false,"schema":{"type":"string"}},{"description":"Filter locates with locate trading date on or after this date. Format: YYYY-MM-DD. The locate trading date uses America/New_York and rolls at 8pm ET.","in":"query","name":"start","required":false,"schema":{"format":"date","type":"string"}},{"description":"Filter locates with locate trading date before this date (exclusive). Format: YYYY-MM-DD. The locate trading date uses America/New_York and rolls at 8pm ET.","in":"query","name":"end","required":false,"schema":{"format":"date","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLocatesResponse"}}},"description":"Returns a list of locates for the account, or an empty list if no locates are found."},"400":{"content":{"application/json":{"examples":{"invalid_input":{"value":{"code":"invalid_input","message":"invalid input"}}},"schema":{"$ref":"#/components/schemas/LocateError"}}},"description":"Invalid locate request."},"401":{"content":{"application/json":{"example":{"message":"Unauthorized"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key."},"403":{"content":{"application/json":{"example":{"message":"Forbidden"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"User has no access to a resource."},"500":{"content":{"application/json":{"example":{"message":"Internal Server Error"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum."}},"summary":"List Locates","tags":["Locates"]},"post":{"description":"Creates a locate request for a short sale.","operationId":"createLocates","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLocateRequest"}}},"description":"Locate request details.","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Locate"}}},"description":"Created"},"400":{"content":{"application/json":{"examples":{"invalid_input":{"value":{"code":"invalid_input","message":"invalid input: quantity must be in round lots of 100"}},"invalid_limit_price":{"value":{"code":"invalid_limit_price","message":"invalid limit_price"}},"invalid_request_body":{"value":{"code":"invalid_request_body","message":"invalid request body"}}},"schema":{"$ref":"#/components/schemas/LocateError"}}},"description":"Invalid locate request."},"401":{"content":{"application/json":{"example":{"message":"Unauthorized"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key."},"403":{"content":{"application/json":{"example":{"message":"Forbidden"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"User has no access to a resource."},"422":{"content":{"application/json":{"examples":{"easy_to_borrow":{"value":{"code":"easy_to_borrow","message":"security is easy-to-borrow and does not require a locate"}},"insufficient_buying_power":{"value":{"code":"insufficient_buying_power","message":"insufficient buying power to cover locate fee"}},"symbol_not_found":{"value":{"code":"symbol_not_found","message":"symbol not found"}},"threshold_security":{"value":{"code":"threshold_security","message":"security is on the threshold list and cannot be located"}}},"schema":{"$ref":"#/components/schemas/LocateError"}}},"description":"Cannot complete locate request."},"500":{"content":{"application/json":{"example":{"message":"Internal Server Error"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum."}},"summary":"Create Locate","tags":["Locates"]}},"/v1/locates/{locate_id}":{"get":{"description":"Returns a locate by ID.","operationId":"getLocate","parameters":[{"description":"The locate ID.","example":"550e8400-e29b-41d4-a716-446655440000","in":"path","name":"locate_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Locate"}}},"description":"Returns the requested locate."},"400":{"content":{"application/json":{"examples":{"invalid_input":{"value":{"code":"invalid_input","message":"invalid input"}}},"schema":{"$ref":"#/components/schemas/LocateError"}}},"description":"Invalid locate request."},"401":{"content":{"application/json":{"example":{"message":"Unauthorized"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key."},"403":{"content":{"application/json":{"example":{"message":"Forbidden"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"User has no access to a resource."},"404":{"content":{"application/json":{"example":{"message":"locate not found"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"example":{"message":"Internal Server Error"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum."}},"summary":"Get Locate","tags":["Locates"]}},"/v1/locates/quotes":{"get":{"description":"Returns locate availability and pricing for one or more symbols.","operationId":"listLocateQuotes","parameters":[{"description":"Comma-separated list of stock symbols. Maximum 100 unique symbols.","example":"TSLA,AAPL","in":"query","name":"symbols","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLocateQuotesResponse"}}},"description":"Returns locate quotes for the requested symbols."},"400":{"content":{"application/json":{"examples":{"invalid_symbols":{"value":{"code":"invalid_symbols","message":"symbols must contain at most 100 unique symbols"}}},"schema":{"$ref":"#/components/schemas/LocateError"}}},"description":"Invalid locate quote request."},"401":{"content":{"application/json":{"example":{"message":"Unauthorized"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Authentication headers are missing or invalid. Make sure you authenticate your request with a valid API key."},"403":{"content":{"application/json":{"example":{"message":"Forbidden"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"User has no access to a resource."},"500":{"content":{"application/json":{"example":{"message":"Internal Server Error"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Internal server error. We recommend retrying these later. If the issue persists, please contact us on Slack or on the Community Forum."}},"summary":"Get Locate Quotes","tags":["Locates"]}},"/v2beta1/events/activities":{"get":{"description":"The Events API sends the real-time events and provides historical queries with SSE (Server Sent Events).\n\nThis endpoint streams events on account activities.\n\nHistorical events are streamed immediately if queried, and updates are pushed as events occur.\n\nQuery parameter rules:\n- If `until` is specified, `since` is required.\n- If `until_id` is specified, `since_id` is required.\n- You cannot use `since` and `since_id` together.\nBehavior:\n- If `since` or `since_id` is not specified, this will not return any historic data.\n- If `until` or `until_id` is specified, stream will end at the specified point with status 200.\n\n---\n\nWarning: Currently, OAS-3 does not fully support responses from an SSE API.\n\nIn case the client code is generated from this OAS spec, please do not specify `since` and `until`, as the generated client may hang forever waiting for the response to end.\n\nIf you require the streaming capabilities, we recommend not using the generated clients for this specific endpoint until the OAS-3 standards define how to represent this behavior.\n\n---\n\n###  Comment messages\nAccording to the SSE specification, any line that starts with a colon is a comment which does not contain data.  It is typically a free text that does not follow any data schema. A few examples mentioned below for comment messages.\n\n#####  Slow client\n\nThe server sends a comment when the client is not consuming messages fast enough. Example: `: you are reading too slowly, dropped 10000 messages`\n\n##### Internal server error\n\nAn error message is sent as a comment when the server closes the connection on an internal server error (only sent by the v2 and v2beta1 endpoints). Example: `: internal server error`\n\n---","operationId":"subscribeToActivitiesSSE","parameters":[{"description":"Format: RFC3339 or YYYY-MM-DD","in":"query","name":"since","schema":{"format":"date-time","type":"string"}},{"description":"Format: RFC3339 or YYYY-MM-DD","in":"query","name":"until","schema":{"format":"date-time","type":"string"}},{"in":"query","name":"since_id","schema":{"format":"ulid","type":"string"}},{"in":"query","name":"until_id","schema":{"format":"ulid","type":"string"}}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"items":{"$ref":"#/components/schemas/ActivityEventV2"},"type":"array"}}},"description":"Connected. Events will now start streaming as long as you keep the connection open."}},"summary":"Subscribe to Activity Events (SSE)","tags":["Events"]}},"/v2/account":{"get":{"description":"Returns your account details.","operationId":"getAccount","responses":{"200":{"content":{"application/json":{"example":{"account_blocked":false,"account_number":"PALPACA_123","accrued_fees":"0","admin_configurations":{},"balance_asof":"2023-09-27","buying_power":"245432.61","cash":"122086.5","created_at":"2023-01-01T18:20:20.272275Z","crypto_status":"ACTIVE","crypto_tier":1,"currency":"USD","effective_buying_power":"245432.61","equity":"123346.11","id":"1d9eed04-be39-4e01-9b84-a48ac5bbafcf","initial_margin":"629.8","intraday_adjustments":"0","last_equity":"122011.09751111286868","last_maintenance_margin":"480.73","long_market_value":"1259.61","maintenance_margin":"377.88","multiplier":"2","non_marginable_buying_power":"122086.5","options_buying_power":"122716.305","options_trading_level":2,"pending_reg_taf_fees":"0","pending_transfer_in":"0","portfolio_value":"123346.11","position_market_value":"1259.61","regt_buying_power":"245432.61","short_market_value":"0","shorting_enabled":true,"sma":"123369.74","status":"ACTIVE","trade_suspended_by_user":false,"trading_blocked":false,"transfers_blocked":false,"user_configurations":null},"schema":{"$ref":"#/components/schemas/Account"}}},"description":"OK"}},"summary":"Get Account","tags":["Accounts"]}},"/v2/account/activities":{"get":{"description":"Returns a list of activities\n\nNotes:\n* Pagination is handled using the `page_token` and `page_size` parameters.\n* `page_token` represents the ID of the last item on your current page of results.\n   For example, if the ID of the last activity in your first response is `20220203000000000::045b3b8d-c566-4bef-b741-2bf598dd6ae7`, you would pass that value as `page_token` to retrieve the next page of results.","operationId":"getAccountActivities","parameters":[{"description":"A comma-separated list of activity types used to filter the results.","explode":false,"in":"query","name":"activity_types","schema":{"items":{"$ref":"#/components/schemas/ActivityType"},"type":"array"},"style":"form"},{"description":"The activity category. Cannot be used with \"activity_types\" parameter.","in":"query","name":"category","schema":{"enum":["trade_activity","non_trade_activity"],"type":"string"}},{"description":"Filter activities by their creation date (created_at), not the activity's settlement date. For non-trade activities such as fees, the creation date is typically the day after the trade date (in UTC). Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported.","in":"query","name":"date","schema":{"format":"date-time","type":"string"}},{"description":"Get activities created before this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported.","in":"query","name":"until","schema":{"format":"date-time","type":"string"}},{"description":"Get activities created after this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported.","in":"query","name":"after","schema":{"format":"date-time","type":"string"}},{"description":"The chronological order of response based on the activity datetime.","in":"query","name":"direction","schema":{"default":"desc","enum":["asc","desc"],"example":"desc","type":"string"}},{"description":"The maximum number of entries to return in the response.","in":"query","name":"page_size","schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results.","in":"query","name":"page_token","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"anyOf":[{"$ref":"#/components/schemas/TradingActivities"},{"$ref":"#/components/schemas/NonTradeActivities"}],"description":"Will be a mix of TradingActivity or NonTradeActivity objects based on what is passed in the activity_types parameter"},"type":"array"}}},"description":"returns an array of Account activities"}},"summary":"Retrieve Account Activities","tags":["Account Activities"]}},"/v2/account/activities/{activity_type}":{"get":{"description":"Returns account activity entries for a specific type of activity.","operationId":"getAccountActivitiesByActivityType","parameters":[{"description":"Filter activities by their creation date (created_at), not the activity's settlement date. For non-trade activities such as fees, the creation date is typically the day after the trade date (in UTC). Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported.","in":"query","name":"date","schema":{"format":"date-time","type":"string"}},{"description":"Get activities created before this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported.","in":"query","name":"until","schema":{"format":"date-time","type":"string"}},{"description":"Get activities created after this date. Both formats YYYY-MM-DD and YYYY-MM-DDTHH:MM:SSZ are supported.","in":"query","name":"after","schema":{"format":"date-time","type":"string"}},{"description":"The chronological order of response based on the activity datetime.","in":"query","name":"direction","schema":{"default":"desc","enum":["asc","desc"],"example":"desc","type":"string"}},{"description":"The maximum number of entries to return in the response.","in":"query","name":"page_size","schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Token used for pagination. Provide the ID of the last activity from the last page to retrieve the next set of results.","in":"query","name":"page_token","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"description":"Will be one of a TradingActivity or NonTradeActivity based on activity_type used in path","oneOf":[{"$ref":"#/components/schemas/TradingActivities"},{"$ref":"#/components/schemas/NonTradeActivities"}]},"type":"array"}}},"description":"returns an array of Account activities"}},"summary":"Retrieve Account Activities of Specific Type","tags":["Account Activities"]},"parameters":[{"description":"The activity type you want to view entries for. A list of valid activity types can be found at the bottom of this page.","in":"path","name":"activity_type","required":true,"schema":{"type":"string"}}]},"/v2/account/configurations":{"get":{"description":"gets the current account configuration values","operationId":"getAccountConfig","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}},"description":"Successful response"}},"summary":"Get Account Configurations","tags":["Account Configurations"]},"patch":{"description":"Updates and returns the current account configuration values","operationId":"patchAccountConfig","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountConfigurations"}}},"description":"Successful response"}},"summary":"Account Configurations","tags":["Account Configurations"]}},"/v2/account/portfolio/history":{"get":{"description":"Returns timeseries data about equity and profit/loss (P/L) of the account in requested timespan.","operationId":"getAccountPortfolioHistory","parameters":[{"description":"The duration of the data in `number` + `unit` format, such as 1D, where `unit` can be D for day, W for week, M for month and A for year. Defaults to 1M.\n\nOnly two of `start`, `end` and `period` can be specified at the same time.\n\nFor intraday timeframes (\\<1D) only 30 days or less can be queried, for 1D resolutions there is no such limit, data is available since the\ncreation of the account.\n","in":"query","name":"period","schema":{"type":"string"}},{"description":"The resolution of time window. 1Min, 5Min, 15Min, 1H, or 1D. If omitted, 1Min for less than 7 days period,\n15Min for less than 30 days, or otherwise 1D.\n\nFor queries with longer than 30 days of `period`, the system only accepts 1D as `timeframe`.\n","in":"query","name":"timeframe","schema":{"type":"string"}},{"description":"For intraday resolutions (<1D) this specifies which timestamps to return data points for:\n\nAllowed values are:\n- **market_hours**\n\n  Only timestamps for the core equity trading hours are returned (usually 9:30am to 4:00pm, trading days only)\n\n- **extended_hours**\n\n  Returns timestamps for the whole session including extended hours (usually 4:00am to 8:00pm, trading days only)\n\n- **continuous**\n\n  Returns price data points 24/7 (for off-session times too). To calculate the equity values we are using the following prices:\n\n  Between 4:00am and 10:00pm on trading days the valuation will be calculated based on the last trade (extended hours and normal hours respectively).\n\n  After 10:00pm, until the next session open the equities will be valued at their official closing price on the primary exchange.\n","in":"query","name":"intraday_reporting","schema":{"default":"market_hours","enum":["market_hours","extended_hours","continuous"],"type":"string"}},{"description":"The timestamp the data is returned starting from in RFC3339 format (including timezone specification). Defaults to `end` minus `period`\n\nIf provided, the `start` value is always normalized to the `America/New_York` timezone and adjusted to the nearest `timeframe` interval, e.g. seconds are always truncated and the time is rounded backwards to the nearest interval of `1Min`, `5Min`, `15Min`, or `1H`.\n\nIf `timeframe=1D` and `start` is not a valid trading date, find the next available trading date. For example, if `start` occurs on Saturday or Sunday after converting to the America/New_York timezone, `start` is adjusted to the first weekday that is not a market holiday (e.g. Monday).\n\nIf `timeframe` is less than `1D` and `intraday_reporting` is not `continuous`, `start` always reflects the beginning of a market session. If `start` is between midnight and the end (inclusive) of an active trading day, `start` is set to the beginning of the session on the specified day. Otherwise, if `start` occurs outside of the market session, the next available market date is used.\n\nFor example, when `intraday_reporting=market_hours` and `start=2023-10-19T23:59:59-04:00`, the provided `start` date occurs outside of the regular market session. The effective `start` timestamp is adjusted to the beginning of the next session: `2023-10-20T09:30:00-04:00`\n\n`start` may be be combined with one of `end` or `period`.\n\nProviding all of `start`, `end`, and `period` is invalid.\n","in":"query","name":"start","schema":{"example":"2021-03-16T18:38:01Z","format":"date-time","type":"string"}},{"description":"`pnl_reset` defines how we are calculating the baseline values for Profit And Loss (pnl) for queries with `timeframe` less than 1D (intraday queries).\n\nThe default behavior for intraday queries is that we reset the pnl value to the previous day's closing equity for each **trading** day.\n\nIn case of crypto (given its continuous nature), this might not be desired: specifying \"no_reset\" disables this behavior and all pnl values\nreturned will be relative to the closing equity of the previous trading day.\n\nFor 1D resolution all PnL values are calculated relative to the `base_value`, we are not resetting the base value.\n","in":"query","name":"pnl_reset","schema":{"default":"per_day","enum":["no_reset","per_day"],"type":"string"}},{"description":"The timestamp the data is returned up to in RFC3339 format (including timezone specification). Defaults to the current time.\n\nIf provided, the `end` value is always normalized to the `America/New_York` timezone and adjusted to the nearest `timeframe` interval, e.g. seconds are always truncated and the time is rounded backwards to the nearest interval of `1Min`, `5Min`, `15Min`, or `1H`.\n\nWhen `intraday_reporting` is either `market_hours` or `extended_hours`, the `end` value is adjusted to not occur after session close on the specified day. For example if the `intraday_reporting` is `extended_hours`, and the timestamp specified is `2023-10-19T21:33:00-04:00`, `end` is adjusted to `2023-10-19T20:00:00-04:00`.\n\n`end` may be combined with `start` or `period`.\n\nProviding all of `start`, `end`, and `period` is invalid.\n","in":"query","name":"end","schema":{"example":"2021-03-16T18:38:01Z","format":"date-time","type":"string"}},{"description":"**deprecated**: Users are strongly advised to **rely on the `intraday_reporting` query parameter** for better control\nof the reporting range.\n\nIf true, include extended hours in the result. This is effective only for timeframe less than 1D.\n","in":"query","name":"extended_hours","schema":{"type":"string"}},{"description":"The cashflow activities to include in the report. One of 'ALL', 'NONE', or a comma-separated list of activity types.","examples":{"all":{"value":"ALL"},"cash_transfers":{"summary":"Include cash deposits, withdraws, and transaction fees","value":"CSD,CSW,FEE"},"none":{"value":"NONE"}},"in":"query","name":"cashflow_types","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioHistory"}}},"description":"Successful response"}},"summary":"Get Account Portfolio History","tags":["Portfolio History"]}},"/v2/assets":{"get":{"description":"The assets API serves as the master list of assets available for trade and data consumption from Alpaca. Assets are sorted by asset class, exchange and symbol.","operationId":"get-v2-assets","parameters":[{"description":"e.g. \"active\". By default, all statuses are included.","in":"query","name":"status","schema":{"type":"string"}},{"description":"Defaults to us_equity.","in":"query","name":"asset_class","schema":{"type":"string"}},{"description":"Optional AMEX, ARCA, BATS, NYSE, NASDAQ, NYSEARCA, OTC or CRYPTO","in":"query","name":"exchange","schema":{"type":"string"}},{"description":"Comma separated values to query for more than one attribute. Assets which have any of the given attributes will be included.\n\nSupported values:\n- `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default.\n- `ptp_with_exception`: Users can open positions in these PTPs without general restrictions.\n- `ipo`: Accepting limit orders only before the stock begins trading on the secondary market.\n- `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up.\n- `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET.\n- `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled).\n- `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform.\n- `overnight_halted`: Asset is eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.","explode":false,"in":"query","name":"attributes","schema":{"default":[],"example":["ptp_no_exception","ipo"],"items":{"$ref":"#/components/schemas/AssetAttribute"},"type":"array"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Assets"},"type":"array"}}},"description":"An array of asset objects"}},"summary":"Get Assets","tags":["Assets"]}},"/v2/assets/{symbol_or_asset_id}":{"get":{"description":"Get the asset model for a given symbol or asset_id. The symbol or asset_id should be passed in as a path parameter.\n\n**Note**: For crypto, the symbol has to follow old symbology, e.g. BTCUSD.\n\n**Note**: For coin pairs, the symbol should be separated by a slash (/), e.g. BTC/USDT. Since the slash is a special character in HTTP, use the URL encoded version instead, e.g. /v2/assets/BTC%2FUSDT","operationId":"get-v2-assets-symbol_or_asset_id","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assets"}}},"description":"An Asset object"},"404":{"description":"Not Found"}},"summary":"Get an Asset by ID or Symbol","tags":["Assets"]},"parameters":[{"description":"symbol or assetId. CUSIP is also accepted for US equities.","in":"path","name":"symbol_or_asset_id","required":true,"schema":{"type":"string"}}]},"/v2/assets/fixed_income/us_corporates":{"get":{"description":"Serves the list of US corporates available at Alpaca. The response is sorted by ISIN.","operationId":"UsCorporates","parameters":[{"in":"query","name":"bond_status","schema":{"$ref":"#/components/schemas/bond_status"}},{"description":"A comma-separated list of ISINs with a limit of 1000.","example":"US912810UG12,US912797PM34","in":"query","name":"isins","schema":{"type":"string"}},{"description":"A comma-separated list of CUSIPs with a limit of 1000.","example":"912810UG1,912797PM3","in":"query","name":"cusips","schema":{"type":"string"}},{"description":"A comma-separated list of tickers with a limit of 1000.","example":"BAC,MSFT","in":"query","name":"tickers","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/us_corporates_resp"}}},"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"summary":"Get US corporates","tags":["Assets"]}},"/v2/assets/fixed_income/us_treasuries":{"get":{"description":"Serves the list of US treasuries available at Alpaca. The response is sorted by ISIN.","operationId":"UsTreasuries","parameters":[{"in":"query","name":"subtype","schema":{"$ref":"#/components/schemas/treasury_subtype"}},{"in":"query","name":"bond_status","schema":{"$ref":"#/components/schemas/bond_status"}},{"description":"A comma-separated list of CUSIPs with a limit of 1000.","example":"912810UG1,912797PM3","in":"query","name":"cusips","schema":{"type":"string"}},{"description":"A comma-separated list of ISINs with a limit of 1000.","example":"US912810UG12,US912797PM34","in":"query","name":"isins","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/us_treasuries_resp"}}},"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"summary":"Get US treasuries","tags":["Assets"]}},"/v2/calendar":{"get":{"description":"The calendar API serves the full list of market days from 1970 to 2029. It can also be queried by specifying a start and/or end time to narrow down the results. In addition to the dates, the response also contains the specific open and close times for the market days, taking into account early closures.\n","operationId":"LegacyCalendar","parameters":[{"$ref":"#/components/parameters/legacy_start"},{"$ref":"#/components/parameters/legacy_end"},{"$ref":"#/components/parameters/legacy_date_type"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/legacy_public_calendar_resp"}}},"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"400":{"$ref":"#/components/responses/400"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"summary":"Get US Market Calendar","tags":["Calendar"]}},"/v2/clock":{"get":{"description":"The clock API serves the current market timestamp, whether or not the market is currently open, as well as the times of the next market open and close.\n","operationId":"LegacyClock","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/legacy_clock"}}},"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"summary":"Get US Market Clock","tags":["Clock"]}},"/v2/corporate_actions/announcements":{"get":{"deprecated":true,"description":"This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead.","operationId":"get-v2-corporate_actions-announcements","parameters":[{"description":"A comma-delimited list of Dividend, Merger, Spinoff, or Split.","in":"query","name":"ca_types","required":true,"schema":{"type":"string"}},{"description":"The start (inclusive) of the date range when searching corporate action announcements. This should follow the YYYY-MM-DD format. The date range is limited to 90 days.","in":"query","name":"since","required":true,"schema":{"type":"string"}},{"description":"The end (inclusive) of the date range when searching corporate action announcements. This should follow the YYYY-MM-DD format. The date range is limited to 90 days.","in":"query","name":"until","required":true,"schema":{"type":"string"}},{"description":"The symbol of the company initiating the announcement.","in":"query","name":"symbol","schema":{"type":"string"}},{"description":"The CUSIP of the company initiating the announcement.","in":"query","name":"cusip","schema":{"type":"string"}},{"description":"declaration_date, ex_date, record_date, or payable_date","in":"query","name":"date_type","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"properties":{"ca_sub_type":{"type":"string"},"ca_type":{"type":"string"},"cash":{"type":"string"},"corporate_action_id":{"type":"string"},"corporate_actions_id":{"type":"string"},"declaration_date":{"type":"string"},"ex_date":{"type":"string"},"expiration_date":{"type":"string"},"id":{"type":"string"},"initiating_original_cusip":{"type":"string"},"initiating_symbol":{"type":"string"},"new_rate":{"type":"string"},"old_rate":{"type":"string"},"payable_date":{"type":"string"},"record_date":{"type":"string"},"target_original_cusip":{"type":"string"},"target_symbol":{"type":"string"}},"type":"object"},"type":"array","x-examples":{"Example 1":[{"ca_sub_type":"DIV","ca_type":"Dividend","cash":"0.018","corporate_actions_id":"F58684224_XY37","declaration_date":"2021-01-05","expiration_date":"2021-01-12","id":"be3c368a-4c7c-4384-808e-f02c9f5a8afe","initiating_original_cusip":5.5275e+105,"initiating_symbol":"MLLAX","new_rate":"1","old_rate":"1","payable_date":"2021-01-14","record_date":"2021-01-13","target_original_cusip":5.5275e+105,"target_symbol":"MLLAX"},{"ca_sub_type":"cash","ca_type":"Dividend","cash":"0.145","corporate_action_id":"48251W104_AD21","declaration_date":"2021-11-01","ex_date":"2021-11-12","initiating_original_cusip":"G52830109","initiating_symbol":"KKR","new_rate":"1","old_rate":"1","payable_date":"2021-11-30","record_date":"2021-11-15","target_original_cusip":"G52830109","target_symbol":"KKR"}]}}}},"description":"OK"}},"summary":"Retrieve Announcements","tags":["Corporate Actions"]}},"/v2/corporate_actions/announcements/{id}":{"get":{"deprecated":true,"description":"This endpoint is deprecated, please use [the new corporate actions endpoint](https://docs.alpaca.markets/reference/corporateactions-1) instead.","operationId":"get-v2-corporate_actions-announcements-id","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"ca_sub_type":{"type":"string"},"ca_type":{"description":"A comma-delimited list of Dividend, Merger, Spinoff, or Split.","type":"string"},"cash":{"type":"string"},"corporate_actions_id":{"type":"string"},"declaration_date":{"type":"string"},"expiration_date":{"type":"string"},"id":{"type":"string"},"initiating_original_cusip":{"type":"string"},"initiating_symbol":{"type":"string"},"new_rate":{"type":"string"},"old_rate":{"type":"string"},"payable_date":{"type":"string"},"record_date":{"type":"string"},"target_original_cusip":{"type":"string"},"target_symbol":{"type":"string"}},"type":"object","x-examples":{"Example 1":{"ca_sub_type":"DIV","ca_type":"Dividend","cash":"0.018","corporate_actions_id":"F58684224_XY37","declaration_date":"2021-01-05","expiration_date":"2021-01-12","id":"be3c368a-4c7c-4384-808e-f02c9f5a8afe","initiating_original_cusip":5.5275e+105,"initiating_symbol":"MLLAX","new_rate":"1","old_rate":"1","payable_date":"2021-01-14","record_date":"2021-01-13","target_original_cusip":5.5275e+105,"target_symbol":"MLLAX"}}}}},"description":"OK"}},"summary":"Retrieve a Specific Announcement","tags":["Corporate Actions"]},"parameters":[{"description":"The corporate announcement's id","in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"/v2/options/contracts":{"get":{"description":"This endpoint allows you to retrieve a list of option contracts based on various filtering criteria.\nBy default only active contracts that expire before the upcoming weekend are returned.\n","operationId":"get-options-contracts","parameters":[{"description":"Filter contracts by one or more underlying symbols.","example":"AAPL,SPY","in":"query","name":"underlying_symbols","schema":{"type":"string"}},{"description":"Include deliverables array in the response.","example":true,"in":"query","name":"show_deliverables","schema":{"type":"boolean"}},{"description":"Filter contracts by status (active/inactive). By default only active contracts are returned.","example":"active","in":"query","name":"status","schema":{"enum":["active","inactive"],"type":"string"}},{"description":"Filter contracts by the exact expiration date (format: YYYY-MM-DD).","example":"2025-06-20","in":"query","name":"expiration_date","schema":{"format":"date","type":"string"}},{"description":"Filter contracts with expiration date greater than or equal to the specified date.","example":"2025-06-20","in":"query","name":"expiration_date_gte","schema":{"format":"date","type":"string"}},{"description":"Filter contracts with expiration date less than or equal to the specified date. By default this is set to the next weekend.","example":"2025-06-20","in":"query","name":"expiration_date_lte","schema":{"format":"date","type":"string"}},{"description":"Filter contracts by the root symbol.","example":"AAPL","in":"query","name":"root_symbol","schema":{"type":"string"}},{"description":"Filter contracts by the type (call/put).","example":"call","in":"query","name":"type","schema":{"$ref":"#/components/schemas/OptionContractType"}},{"description":"Filter contracts by the style (american/european).","example":"american","in":"query","name":"style","schema":{"$ref":"#/components/schemas/OptionContractStyle"}},{"description":"Filter contracts with strike price greater than or equal to the specified value.","example":50,"in":"query","name":"strike_price_gte","schema":{"type":"number"}},{"description":"Filter contracts with strike price less than or equal to the specified value.","example":100,"in":"query","name":"strike_price_lte","schema":{"type":"number"}},{"$ref":"#/components/parameters/PageToken"},{"description":"The number of contracts to limit per page (default=100, max=10000).","example":100,"in":"query","name":"limit","schema":{"type":"integer"}},{"description":"The ppind(Penny Program Indicator) field indicates whether an option contract is eligible for penny price increments,\nwith `true` meaning it is part of the Penny Program and `false` meaning it is not.","example":true,"in":"query","name":"ppind","schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"next_page_token":{"$ref":"#/components/schemas/NextPageToken"},"option_contracts":{"items":{"$ref":"#/components/schemas/OptionContract"},"type":"array"}},"required":["option_contracts"],"type":"object"}}},"description":"Successful Response."}},"summary":"Get Option Contracts","tags":["Assets"]}},"/v2/options/contracts/{symbol_or_id}":{"get":{"description":"Get an option contract by symbol or contract ID. The symbol or id should be passed in as a path parameter.","operationId":"get-option-contract-symbol_or_id","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionContract"}}},"description":"An option contract"},"404":{"content":{"application/json":{"examples":{"Contract Not Found":{"value":{"code":40410000,"message":"option contract TSLA231110C00021000 not found"}}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"}},"summary":"Get an option contract by ID or Symbol","tags":["Assets"]},"parameters":[{"description":"symbol or contract ID","in":"path","name":"symbol_or_id","required":true,"schema":{"type":"string"}}]},"/v2/orders":{"delete":{"description":"Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request.","operationId":"deleteAllOrders","responses":{"207":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CanceledOrderResponse"},"type":"array"}}},"description":"Multi-Status with body.\n\nan array of objects that include the order id and http status code for each status request."},"500":{"description":"Failed to cancel order."}},"summary":"Delete All Orders","tags":["Orders"]},"get":{"description":"Retrieves a list of orders for the account, filtered by the supplied query parameters.","operationId":"getAllOrders","parameters":[{"description":"Order status to be queried. open, closed or all. Defaults to open.","in":"query","name":"status","schema":{"enum":["open","closed","all"],"example":"open","type":"string"}},{"description":"The maximum number of orders in response. Defaults to 50 and max is 500.","in":"query","name":"limit","schema":{"type":"integer"}},{"description":"The response will include only ones submitted after this timestamp (exclusive.)","in":"query","name":"after","schema":{"type":"string"}},{"description":"The response will include only ones submitted until this timestamp (exclusive.)","in":"query","name":"until","schema":{"type":"string"}},{"description":"The chronological order of response based on the submission time. asc or desc. Defaults to desc.","in":"query","name":"direction","schema":{"enum":["asc","desc"],"type":"string"}},{"description":"If true, the result will roll up multi-leg orders under the legs field of primary order.","in":"query","name":"nested","schema":{"type":"boolean"}},{"description":"A comma-separated list of symbols to filter by (ex. \"AAPL,TSLA,MSFT\"). A currency pair is required for crypto orders (ex. \"BTCUSD,BCHUSD,LTCUSD,ETCUSD\").","in":"query","name":"symbols","schema":{"type":"string"}},{"description":"Filters down to orders that have a matching side field set.","in":"query","name":"side","schema":{"type":"string"}},{"description":"A comma-separated list of asset classes, the response will include only orders in the specified asset classes. By specifying `us_option` as the class, you can query option orders by underlying symbol using the symbols parameter.","in":"query","name":"asset_class","schema":{"items":{"enum":["us_equity","us_option","crypto","crypto_perp","treasury","corporate","global_equity","us_index","us_equity_chain","ipo","all"],"type":"string"},"type":"array"}},{"description":"Return orders submitted before the order with this ID (exclusive).\nMutually exclusive with `after_order_id`. Do not combine with `after`/`until`.\n","in":"query","name":"before_order_id","schema":{"type":"string"}},{"description":"Return orders submitted after the order with this ID (exclusive).\nMutually exclusive with `before_order_id`. Do not combine with `after`/`until`.\n","in":"query","name":"after_order_id","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"Crypto":{"$ref":"#/components/examples/CryptoOrderResponse"},"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"IPO":{"$ref":"#/components/examples/IPOOrderResponse"},"MultilegOptions":{"$ref":"#/components/examples/MultilegOptionsOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"}},"schema":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"}}},"description":"Successful response\n\nAn array of Order objects"}},"summary":"Get All Orders","tags":["Orders"]},"post":{"description":"Places a new order for the given account. An order request may be rejected if the account is not authorized for trading, or if the tradable balance is insufficient to fill the order.","operationId":"postOrder","requestBody":{"content":{"application/json":{"examples":{"Crypto":{"summary":"Buy a crypto coin","value":{"limit_price":"2100","qty":"0.02","side":"buy","symbol":"ETH/USD","time_in_force":"gtc","type":"limit"}},"Equity":{"summary":"Buy an equity stock","value":{"limit_price":"150","qty":"2","side":"buy","symbol":"AAPL","time_in_force":"gtc","type":"limit"}},"IPO":{"summary":"Submit an IPO indication of interest","value":{"notional":"500","side":"buy","symbol":"FI111225","time_in_force":"gtc","type":"market"}},"MultilegOptions":{"summary":"Option Call spread","value":{"legs":[{"position_intent":"buy_to_open","ratio_qty":"3","side":"buy","symbol":"AAPL241213C00250000"},{"position_intent":"sell_to_open","ratio_qty":"1","side":"sell","symbol":"AAPL241213C00260000"}],"limit_price":"10","order_class":"mleg","qty":"3","time_in_force":"day","type":"limit"}},"Options":{"summary":"Buy an option contract","value":{"limit_price":"10","qty":"2","side":"buy","symbol":"AAPL250620C00100000","time_in_force":"day","type":"limit"}}},"schema":{"properties":{"advanced_instructions":{"$ref":"#/components/schemas/AdvancedInstructions"},"client_order_id":{"description":"A unique identifier for the order. Automatically generated if not sent. (<= 128 characters)","maxLength":128,"type":"string"},"extended_hours":{"description":"(default) false. If true, order will be eligible for execution in the pre-market, after-hours, and overnight sessions. Only works with type `limit` and time_in_force set to either `day` or `gtc`","type":"boolean"},"legs":{"description":"list of order legs (<= 4)","items":{"$ref":"#/components/schemas/MLegOrderLeg"},"maxItems":4,"type":"array"},"limit_price":{"description":"Required if type is `limit` or `stop_limit`.\nIn case of `mleg`, the limit_price parameter is expressed with the following notation:\n- A positive value indicates a debit, representing a cost or payment to be made.\n- A negative value signifies a credit, reflecting an amount to be received.","type":"string"},"notional":{"description":"dollar amount to trade. Cannot work with `qty`. Can only work for market order types and day for time in force.","type":"string"},"order_class":{"$ref":"#/components/schemas/OrderClass"},"position_intent":{"$ref":"#/components/schemas/PositionIntent"},"qty":{"description":"number of shares to trade. Can be fractionable for only market and day order types. Required for `mleg` order class, represents the number of units to trade of this strategy.","type":"string"},"side":{"$ref":"#/components/schemas/OrderSide"},"stop_loss":{"description":"Takes in string/number values for stop_price and limit_price","properties":{"limit_price":{"example":"3.14","format":"decimal","type":"string"},"stop_price":{"example":"3.14","format":"decimal","type":"string"}},"type":"object"},"stop_price":{"description":"required if type is `stop` or `stop_limit`","type":"string"},"symbol":{"description":"symbol, asset ID, or currency pair to identify the asset to trade, required for all order classes except for `mleg`.","type":"string"},"take_profit":{"description":"Takes in a string/number value for limit_price","properties":{"limit_price":{"example":"3.14","format":"decimal","type":"string"}},"type":"object"},"time_in_force":{"$ref":"#/components/schemas/TimeInForce"},"trail_percent":{"description":"this or `trail_price` is required if type is `trailing_stop`","type":"string"},"trail_price":{"description":"this or `trail_percent` is required if type is `trailing_stop`","type":"string"},"type":{"$ref":"#/components/schemas/OrderType"}},"required":["type","time_in_force"],"type":"object"}}},"description":"","required":true},"responses":{"200":{"content":{"application/json":{"examples":{"Crypto":{"$ref":"#/components/examples/CryptoOrderResponse"},"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"IPO":{"$ref":"#/components/examples/IPOOrderResponse"},"MultilegOptions":{"$ref":"#/components/examples/MultilegOptionsOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"}},"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Successful response"},"403":{"description":"Forbidden\n\nBuying power or shares is not sufficient."},"422":{"description":"Unprocessable\n\nInput parameters are not recognized."}},"summary":"Create an Order","tags":["Orders"]}},"/v2/orders/{order_id}":{"delete":{"description":"Attempts to cancel an Open Order. If the order is no longer cancelable, the request will be rejected with status 422; otherwise accepted with return status 204.","operationId":"deleteOrderByOrderID","responses":{"204":{"description":"No Content"},"422":{"description":"The order status is not cancelable."}},"summary":"Delete Order by ID","tags":["Orders"]},"get":{"description":"Retrieves a single order for the given order_id.","operationId":"getOrderByOrderID","parameters":[{"description":"If true, the result will roll up multi-leg orders under the legs field of primary order.","in":"query","name":"nested","schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"examples":{"Crypto":{"$ref":"#/components/examples/CryptoOrderResponse"},"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"IPO":{"$ref":"#/components/examples/IPOOrderResponse"},"MultilegOptions":{"$ref":"#/components/examples/MultilegOptionsOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"}},"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Successful response"}},"summary":"Get Order by ID","tags":["Orders"]},"parameters":[{"description":"order id","in":"path","name":"order_id","required":true,"schema":{"format":"uuid","type":"string"}}],"patch":{"description":"Replaces a single order with updated parameters. Each parameter overrides the corresponding attribute of the existing order. The other attributes remain the same as the existing order.\n\nA success return code from a replaced order does NOT guarantee the existing open order has been replaced. If the existing open order is filled before the replacing (new) order reaches the execution venue, the replacing (new) order is rejected, and these events are sent in the trade_updates stream channel.\n\nWhile an order is being replaced, buying power is reduced by the larger of the two orders that have been placed (the old order being replaced, and the newly placed order to replace it). If you are replacing a buy entry order with a higher limit price than the original order, the buying power is calculated based on the newly placed order. If you are replacing it with a lower limit price, the buying power is calculated based on the old order.\n\nNote: Order cannot be replaced when the status is `accepted`, `pending_new`, `pending_cancel` or `pending_replace`.\n\nNote: Notional orders for non-IPO asset classes cannot be replaced. Any attempt to modify a non-IPO notional order via this endpoint will be rejected; cancel it and submit a new one instead.\n\nNote: IPO indications of interest (`asset_class: \"ipo\"`) **are** notional and **can** be replaced via this endpoint by providing a new `notional` value. `qty` and `notional` are mutually exclusive on a single replace request.\n","operationId":"patchOrderByOrderId","requestBody":{"content":{"application/json":{"examples":{"Equity":{"summary":"Increase qty and limit price on an equity order","value":{"limit_price":"155","qty":"4","time_in_force":"gtc"}},"IPO":{"summary":"Update notional on an IPO indication of interest","value":{"notional":"750"}},"Options":{"summary":"Adjust an option order's limit price","value":{"limit_price":"11.25","time_in_force":"day"}}},"schema":{"$ref":"#/components/schemas/PatchOrderRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"examples":{"Equity":{"$ref":"#/components/examples/EquityOrderResponse"},"IPO":{"$ref":"#/components/examples/IPOOrderResponse"},"Options":{"$ref":"#/components/examples/OptionOrderResponse"}},"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Successful response\n\nThe new Order object with the new order ID."}},"summary":"Replace Order by ID","tags":["Orders"]}},"/v2/orders:by_client_order_id":{"get":{"description":"Retrieves a single order specified by the client order ID.","operationId":"getOrderByClientOrderId","parameters":[{"description":"The client-assigned order ID.","in":"query","name":"client_order_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Successfully retrieved the order matching the client_order_id."}},"summary":"Get Order by Client Order ID","tags":["Orders"]}},"/v2/perpetuals/account_vitals":{"get":{"description":"Fetches key financial metrics for the crypto perpetuals account, providing a snapshot of its current status by detailing the relationship between the user's positions and their collateral. The response includes maintenance margin (USDT), collateral balance (USDT), total collateral (USDT), and profit/loss (USDT)","operationId":"getCryptoPerpAccountVitals","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"collateral_balance":{"description":"CollateralBalance (USDT) is the sum of the unrealized PnL on each position plus TotalCollateral","type":"integer"},"maintenance_margin":{"description":"MaintenanceMargin (USDT) is the sum of each position's individual maintenance margin","type":"number"},"profit_loss":{"description":"ProfitAndLoss (USDT) is the net of realized and unrealized PnL across all positions","type":"integer"},"total_collateral":{"description":"TotalCollateral (USDT) across all collateral assets","type":"integer"}},"type":"object"}}},"description":"OK"}},"summary":"Retrieve Account Vitals","tags":["Crypto Perpetuals Account Vitals (Beta)"]}},"/v2/perpetuals/leverage":{"get":{"description":"Retrieves the current leverage setting for the crypto perpetuals account, specific to a given underlying asset. To use this endpoint, provide the 'symbol' of the asset as a query parameter. The system will return the asset's symbol and the integer value representing the current leverage applied to it within the account","operationId":"getCryptoPerpAccountLeverage","parameters":[{"description":"Symbol of underlying asset","in":"query","name":"symbol","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"leverage":{"type":"integer"},"symbol":{"description":"Symbol of underlying asset","type":"string"}},"type":"object"}}},"description":"OK"}},"summary":"Get Account Leverage for an Asset","tags":["Crypto Perpetuals Leverage (Beta)"]},"post":{"description":"Updates the leverage for the crypto perpetuals account for a specific underlying asset. Provide the 'symbol' of the asset and the desired 'leverage' (as an integer) using query parameters. The system will return the asset's symbol and the newly set leverage value upon successful update","operationId":"setCryptoPerpAccountLeverage","parameters":[{"description":"Symbol of underlying asset","in":"query","name":"symbol","schema":{"type":"string"}},{"description":"Leverage for the underlying asset","in":"query","name":"leverage","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"leverage":{"type":"integer"},"symbol":{"description":"Symbol of underlying asset","type":"string"}},"type":"object"}}},"description":"OK"}},"summary":"Set Account Leverage for an Asset","tags":["Crypto Perpetuals Leverage (Beta)"]}},"/v2/perpetuals/wallets":{"get":{"description":"Lists wallets for the account given in the path parameter. If an asset is specified and no wallet for the account and asset pair exists one will be created. If no asset is specified only existing wallets will be listed for the account. An account may have at most one wallet per asset","operationId":"listCryptoPerpFundingWallets","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoWallet"}}},"description":"A single wallet object if an asset is specified or an array of wallet objects if no asset is specified"}},"summary":"Retrieve Crypto Funding Wallets","tags":["Crypto Perpetuals Funding (Beta)"]},"parameters":[{"in":"query","name":"asset","schema":{"type":"string"}}]},"/v2/perpetuals/wallets/fees/estimate":{"get":{"description":"Returns the estimated on-chain network (gas) fee for a proposed withdrawal from a perpetuals wallet at current chain conditions. Pass the `asset`, `from_address`, `to_address`, and `amount` you intend to send; the response reports the network fee that would be charged for the corresponding transaction.","operationId":"getCryptoPerpTransferEstimate","parameters":[{"description":"The asset for the proposed transaction","in":"query","name":"asset","schema":{"type":"string"}},{"description":"The originating address of the proposed transaction","in":"query","name":"from_address","schema":{"type":"string"}},{"description":"The destination address of the proposed transaction","in":"query","name":"to_address","schema":{"type":"string"}},{"description":"The amount, denoted in the specified asset, of the proposed transaction","in":"query","name":"amount","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"fee":{"type":"string"}},"type":"object"}}},"description":"OK"}},"summary":"Returns the estimated gas fee for a proposed transaction","tags":["Crypto Perpetuals Funding (Beta)"]}},"/v2/perpetuals/wallets/transfers":{"get":{"description":"Returns an array of all transfers associated with the given account across all wallets","operationId":"listCryptoPerpFundingTransfers","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}},"description":"An array of transfer objects"}},"summary":"Retrieve Crypto Funding Transfers","tags":["Crypto Perpetuals Funding (Beta)"]},"post":{"description":"Creates a withdrawal request. Note that outgoing withdrawals must be sent to a whitelisted address and you must whitelist addresses at least 24 hours in advance. If you attempt to withdraw funds to a non-whitelisted address then the transfer will be rejected","operationId":"createCryptoPerpTransferForAccount","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCryptoTransferRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}},"description":"Successfully requested a transfer."}},"summary":"Request a New Withdrawal","tags":["Crypto Perpetuals Funding (Beta)"]}},"/v2/perpetuals/wallets/transfers/{transfer_id}":{"get":{"description":"Returns a specific wallet transfer by passing into the query the transfer_id","operationId":"getCryptoPerpFundingTransfer","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}},"description":"A single crypto transfer object"}},"summary":"Retrieve a Crypto Funding Transfer","tags":["Crypto Perpetuals Funding (Beta)"]},"parameters":[{"description":"The crypto transfer to retrieve","in":"path","name":"transfer_id","required":true,"schema":{"type":"string"}}]},"/v2/perpetuals/wallets/whitelists":{"get":{"description":"Returns the list of whitelisted withdrawal addresses for your perpetuals wallets.","operationId":"listWhitelistedPerpAddress","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}},"description":"An array of whitelisted objects"}},"summary":"An array of whitelisted addresses","tags":["Crypto Perpetuals Funding (Beta)"]},"post":{"description":"Submits a new whitelisted withdrawal address for your perpetuals wallets. The chain is derived from the supplied asset symbol and address, and the same address cannot be whitelisted twice on the same chain.\n\nWhere travel rule reporting applies to your account, address details are validated against the travel rule provider before being persisted.\n\nNote that whitelisted addresses must wait at least 24 hours before they can be used as a withdrawal destination.","operationId":"createWhitelistedPerpAddress","requestBody":{"content":{"application/json":{"schema":{"properties":{"address":{"description":"The address to be whitelisted","type":"string"},"asset":{"description":"Symbol of underlying asset for the whitelisted address","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}},"description":"Successfully requested a whitelisted address"}},"summary":"Request a new whitelisted address","tags":["Crypto Perpetuals Funding (Beta)"]}},"/v2/perpetuals/wallets/whitelists/{whitelisted_address_id}":{"delete":{"description":"Deletes a whitelisted withdrawal address from your perpetuals wallets by ID. Subsequent withdrawals targeting the deleted address will be rejected.","operationId":"deleteWhitelistedPerpAddress","responses":{"200":{"description":"Successfully deleted a whitelisted address"}},"summary":"Delete a whitelisted address","tags":["Crypto Perpetuals Funding (Beta)"]},"parameters":[{"description":"The whitelisted address to delete","in":"path","name":"whitelisted_address_id","required":true,"schema":{"type":"string"}}]},"/v2/positions":{"delete":{"description":"Closes (liquidates) all of the account's open long and short positions. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will respond with status 500 and reject the request.","operationId":"deleteAllOpenPositions","parameters":[{"description":"If true is specified, cancel all open orders before liquidating all positions.","in":"query","name":"cancel_orders","schema":{"type":"boolean"}}],"responses":{"207":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PositionClosedReponse"},"type":"array"}}},"description":"Multi-Status with body.\n\nan array of PositionClosed responses"},"500":{"description":"Failed to liquidate"}},"summary":"Close All Positions","tags":["Positions"]},"get":{"description":"The positions API provides information about an account's current open positions. The response will include information such as cost basis, shares traded, and market value, which will be updated live as price information is updated. Once a position is closed, it will no longer be queryable through this API\n\nRetrieves a list of the account's open positions","operationId":"getAllOpenPositions","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Position"},"type":"array"}}},"description":"Successful response"}},"summary":"All Open Positions","tags":["Positions"]}},"/v2/positions/{symbol_or_asset_id}":{"delete":{"description":"Closes (liquidates) the account's open position for the given symbol. Works for both long and short positions.","operationId":"deleteOpenPosition","parameters":[{"description":"the number of shares to liquidate. Can accept up to 9 decimal points. Cannot work with percentage","in":"query","name":"qty","schema":{"type":"number"}},{"description":"percentage of position to liquidate. Must be between 0 and 100. Would only sell fractional if position is originally fractional. Can accept up to 9 decimal points. Cannot work with qty","in":"query","name":"percentage","schema":{"type":"number"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Successful response\n\nReturns the order created to close out this position"}},"summary":"Close a Position","tags":["Positions"]},"get":{"description":"Retrieves the account's open position for the given symbol or assetId.","operationId":"getOpenPosition","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Position"}}},"description":"Successful response"}},"summary":"Get an Open Position","tags":["Positions"]},"parameters":[{"description":"symbol or assetId","in":"path","name":"symbol_or_asset_id","required":true,"schema":{"type":"string"}}]},"/v2/positions/{symbol_or_contract_id}/do-not-exercise":{"post":{"description":"This endpoint enables users to submit a do-not-exercise (DNE) instruction for a held option contract, preventing automatic exercise at expiry.\nBy default, Alpaca will automatically exercise in-the-money (ITM) contracts at expiry. This endpoint allows users to override that behavior.\nTo override this behavior and submit an exercise instruction, please contact our support team.","operationId":"optionDoNotExercise","parameters":[{"description":"Option contract symbol or ID.","in":"path","name":"symbol_or_contract_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successful Response\n\nDo-not-exercise instruction successfully submitted."},"403":{"content":{"application/json":{"examples":{"No Available Position":{"value":{"code":40310000,"message":"no available position for the specified contract"}},"Short Position":{"value":{"code":40310001,"message":"cannot submit DNE for short position"}}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden\n\nAvailable position quantity is not sufficient or no position found."},"422":{"content":{"application/json":{"examples":{"Invalid Symbol":{"value":{"code":42210000,"message":"invalid symbol"}}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid Parameters.\n\nOne or more parameters provided are invalid."}},"summary":"Do Not Exercise an Options Position","tags":["Positions"]}},"/v2/positions/{symbol_or_contract_id}/exercise":{"post":{"description":"This endpoint enables users to exercise a held option contract, converting it into the underlying asset based on the specified terms.\nAll available held shares of this option contract will be exercised.\nBy default, Alpaca will automatically exercise in-the-money (ITM) contracts at expiry.\nExercise requests will be processed immediately once received. Exercise requests submitted between market close and midnight will be rejected to avoid any confusion about when the exercise will settle.\nTo cancel an exercise request or to submit a Do-not-exercise (DNE) instruction, you can use the do-not-exercise endpoint or contact our support team.","operationId":"optionExercise","parameters":[{"description":"Option contract symbol or ID.","in":"path","name":"symbol_or_contract_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successful Response\n\nExercise instruction successfully submitted."},"403":{"content":{"application/json":{"examples":{"No Available Position":{"value":{"code":40310000,"message":"no available position for the specified contract"}},"Short Position":{"value":{"code":40310001,"message":"cannot exercise short position"}}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden\n\nAvailable position quantity is not sufficient."},"422":{"content":{"application/json":{"examples":{"Invalid Symbol":{"value":{"code":42210000,"message":"invalid symbol"}}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid Parameters.\n\nOne or more parameters provided are invalid."}},"summary":"Exercise an Options Position","tags":["Positions"]}},"/v2/tokenization/mint":{"post":{"description":"This endpoint is used by an Authorized Participant to request the minting of a tokenized asset.","operationId":"postTokenizationMint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenizationMintRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenizationMintResponse"}}},"description":"Successfully requested minting of a tokenized asset."},"400":{"content":{"application/json":{"example":{"code":40010000,"message":"failed to decode request body"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request (e.g. malformed input, insufficient position, or account not authorized to mint)."},"401":{"content":{"application/json":{"example":{"code":40110000,"message":"unauthorized"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Authentication credentials are missing or invalid."},"403":{"content":{"application/json":{"example":{"code":40310000,"message":"forbidden"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Caller is not authorized to perform this operation."},"422":{"content":{"application/json":{"example":{"code":40010001,"message":"issuer is required, network is required"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"One or more request parameters are missing or invalid."}},"summary":"Mint a Tokenized Asset","tags":["Tokenization"]}},"/v2/tokenization/requests":{"get":{"description":"An Authorized Participant can use this endpoint to list the tokenization requests performed on the Instant Tokenization Network (ITN).","operationId":"getTokenizationRequests","parameters":[{"description":"Tokenization request type to be queried","example":"mint","in":"query","name":"type","schema":{"$ref":"#/components/schemas/TokenizationRequestType"}},{"description":"Tokenization request status to be queried","example":"pending","in":"query","name":"status","schema":{"$ref":"#/components/schemas/TokenizationRequestStatus"}},{"description":"Underlying symbol of the tokenization requests to be queried","in":"query","name":"underlying_symbol","schema":{"type":"string"}},{"description":"Issuer of the tokenization requests to be queried","in":"query","name":"issuer","schema":{"enum":["xstocks"],"example":"xstocks","type":"string"}},{"description":"Network of the tokenization requests to be queried","in":"query","name":"network","schema":{"$ref":"#/components/schemas/TokenizationNetwork"}},{"description":"The response will include only requests created after this timestamp (exclusive)","in":"query","name":"after","schema":{"example":"2025-09-30T18:38:01.942282Z","format":"date-time","type":"string"}},{"description":"The response will include only requests created before this timestamp (exclusive)","in":"query","name":"before","schema":{"example":"2025-09-30T18:38:01.942282Z","format":"date-time","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TokenizationRequest"},"type":"array"}}},"description":"Successful response\n\nA list of tokenization requests"},"401":{"content":{"application/json":{"example":{"code":40110000,"message":"unauthorized"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Authentication credentials are missing or invalid."},"403":{"content":{"application/json":{"example":{"code":40310000,"message":"forbidden"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Caller is not authorized to perform this operation."},"422":{"content":{"application/json":{"example":{"code":40010001,"message":"failed to parse after"},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"One or more request parameters are missing or invalid."}},"summary":"List Tokenization Requests","tags":["Tokenization"]}},"/v2/wallets":{"get":{"description":"Lists wallets for the account given in the path parameter. If an asset is specified and no wallet for the account and asset pair exists one will be created. If no asset is specified only existing wallets will be listed for the account. An account may have at most one wallet per asset.","operationId":"listCryptoFundingWallets","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoWallet"}}},"description":"A single wallet object if an asset is specified or an array of wallet objects if no asset is specified"}},"summary":"Retrieve Crypto Funding Wallets","tags":["Crypto Funding"]},"parameters":[{"description":"Filter by crypto asset symbol, e.g. BTC, ETH, USDT. If specified and no wallet exists, one will be created.","in":"query","name":"asset","schema":{"type":"string"}},{"description":"Optional chain identifier. Use to request wallets for a specific chain when asset is a multi-chain crypto asset. If not specified, network is considered.","in":"query","name":"chain","schema":{"$ref":"#/components/schemas/CryptoChain"}},{"description":"Deprecated. Use chain instead. Optional network identifier which is used to request wallets for a specific network when asset is a multi-chain crypto asset. When both 'chain' and 'network' are specified, 'chain' will take precedence and 'network' will be ignored. If 'chain' and 'network' are not specified, the default 'network' (ethereum) will be used.","in":"query","name":"network","schema":{"deprecated":true,"enum":["ethereum","solana"],"type":"string"}}]},"/v2/wallets/fees/estimate":{"get":{"description":"Returns the estimated on-chain network (gas) fee for a proposed crypto withdrawal at current chain conditions. Pass the `asset`, `from_address`, `to_address`, and `amount` you intend to send; the response reports the network fee that would be charged for the corresponding transaction.","operationId":"getCryptoTransferEstimate","parameters":[{"description":"The asset for the proposed transaction","in":"query","name":"asset","schema":{"type":"string"}},{"description":"The originating address of the proposed transaction","in":"query","name":"from_address","schema":{"type":"string"}},{"description":"The destination address of the proposed transaction","in":"query","name":"to_address","schema":{"type":"string"}},{"description":"The amount, denoted in the specified asset, of the proposed transaction","in":"query","name":"amount","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletFeeEstimateResponse"}}},"description":"OK"}},"summary":"Returns the estimated gas fee for a proposed transaction.","tags":["Crypto Funding"]}},"/v2/wallets/transfers":{"get":{"description":"Returns an array of all transfers associated with the given account across all wallets.","operationId":"listCryptoFundingTransfers","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}},"description":"An array of transfer objects"}},"summary":"Retrieve Crypto Funding Transfers","tags":["Crypto Funding"]},"post":{"description":"Creates a withdrawal request. Note that outgoing withdrawals must be sent to a whitelisted address and you must whitelist addresses at least 24 hours in advance. If you attempt to withdraw funds to a non-whitelisted address then the transfer will be rejected.","operationId":"createCryptoTransferForAccount","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCryptoTransferRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}},"description":"Successfully requested a transfer."}},"summary":"Request a New Withdrawal","tags":["Crypto Funding"]}},"/v2/wallets/transfers/{transfer_id}":{"get":{"description":"Returns a specific wallet transfer by passing into the query the transfer_id.","operationId":"getCryptoFundingTransfer","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoTransfer"}}},"description":"A single crypto transfer object"}},"summary":"Retrieve a Crypto Funding Transfer","tags":["Crypto Funding"]},"parameters":[{"description":"The crypto transfer to retrieve","in":"path","name":"transfer_id","required":true,"schema":{"type":"string"}}]},"/v2/wallets/whitelists":{"get":{"description":"Returns the list of whitelisted withdrawal addresses for your account.","operationId":"listWhitelistedAddress","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}},"description":"An array of whitelisted objects"}},"summary":"An array of whitelisted addresses","tags":["Crypto Funding"]},"post":{"description":"Submits a new whitelisted withdrawal address for your account. The chain is derived from the supplied asset symbol and address, and the same address cannot be whitelisted twice on the same chain.\n\nWhere travel rule reporting applies to your account, address details are validated against the travel rule provider before being persisted.\n\nNote that whitelisted addresses must wait at least 24 hours before they can be used as a withdrawal destination.","operationId":"createWhitelistedAddress","requestBody":{"content":{"application/json":{"schema":{"properties":{"address":{"description":"The address to be whitelisted","type":"string"},"asset":{"description":"Symbol of underlying asset for the whitelisted address","type":"string"},"chain":{"$ref":"#/components/schemas/CryptoChain"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}},"description":"Successfully requested a whitelisted address"}},"summary":"Request a new whitelisted address","tags":["Crypto Funding"]}},"/v2/wallets/whitelists/{whitelisted_address_id}":{"delete":{"description":"Deletes a whitelisted withdrawal address by ID. Subsequent withdrawals targeting the deleted address will be rejected.","operationId":"deleteWhitelistedAddress","responses":{"200":{"description":"Successfully deleted a whitelisted address"}},"summary":"Delete a whitelisted address","tags":["Crypto Funding"]},"parameters":[{"description":"The whitelisted address to delete","in":"path","name":"whitelisted_address_id","required":true,"schema":{"type":"string"}}]},"/v2/watchlists":{"get":{"description":"Returns the list of watchlists registered under the account.","operationId":"getWatchlists","responses":{"200":{"content":{"application/json":{"examples":{"example-1":{"value":[{"account_id":"abe25343-a7ba-4255-bdeb-f7e013e9ee5d","created_at":"2022-01-31T21:49:05.14628Z","id":"3174d6df-7726-44b4-a5bd-7fda5ae6e009","name":"Primary Watchlist","updated_at":"2022-01-31T21:49:05.14628Z"}]}},"schema":{"items":{"$ref":"#/components/schemas/WatchlistWithoutAsset"},"type":"array"}}},"description":"Successful response"}},"summary":"Get All Watchlists","tags":["Watchlists"]},"post":{"description":"Create a new watchlist with initial set of assets.","operationId":"postWatchlist","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWatchlistRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Create Watchlist","tags":["Watchlists"]}},"/v2/watchlists/{watchlist_id}":{"delete":{"description":"Delete a watchlist. This is a permanent deletion.","operationId":"deleteWatchlistById","responses":{"204":{"description":"No Content"},"404":{"description":"Watchlist not found"}},"summary":"Delete Watchlist By Id","tags":["Watchlists"]},"get":{"description":"Returns a watchlist identified by the ID.","operationId":"getWatchlistById","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Get Watchlist by ID","tags":["Watchlists"]},"parameters":[{"description":"watchlist id","in":"path","name":"watchlist_id","required":true,"schema":{"format":"uuid","type":"string"}}],"post":{"description":"Append an asset for the symbol to the end of watchlist asset list","operationId":"addAssetToWatchlist","requestBody":{"content":{"application/json":{"schema":{"properties":{"symbol":{"description":"the symbol name to add to the watchlist","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Add Asset to Watchlist","tags":["Watchlists"]},"put":{"description":"Update the name and/or content of watchlist","operationId":"updateWatchlistById","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWatchlistRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Update Watchlist By Id","tags":["Watchlists"]}},"/v2/watchlists/{watchlist_id}/{symbol}":{"delete":{"description":"Delete one entry for an asset by symbol name","operationId":"removeAssetFromWatchlist","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Returns the updated watchlist"}},"summary":"Delete Symbol from Watchlist","tags":["Watchlists"]},"parameters":[{"description":"Watchlist ID","in":"path","name":"watchlist_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"symbol name to remove from the watchlist content","in":"path","name":"symbol","required":true,"schema":{"type":"string"}}]},"/v2/watchlists:by_name":{"delete":{"description":"Delete a watchlist. This is a permanent deletion.","operationId":"deleteWatchlistByName","parameters":[{"description":"name of the watchlist","in":"query","name":"name","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"}},"summary":"Delete Watchlist By Name","tags":["Watchlists"]},"get":{"description":"You can also call GET, PUT, POST and DELETE with watchlist name with another endpoint /v2/watchlists:by_name and query parameter name=<watchlist_name>, instead of /v2/watchlists/{watchlist_id} endpoints\n\nReturns a watchlist by name","operationId":"getWatchlistByName","parameters":[{"description":"name of the watchlist","in":"query","name":"name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Get Watchlist by Name","tags":["Watchlists"]},"post":{"description":"Append an asset for the symbol to the end of watchlist asset list","operationId":"addAssetToWatchlistByName","parameters":[{"description":"name of the watchlist","in":"query","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"symbol":{"description":"the symbol name to add to the watchlist","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Add Asset to Watchlist By Name","tags":["Watchlists"]},"put":{"description":"Update the name and/or content of watchlist","operationId":"updateWatchlistByName","parameters":[{"description":"name of the watchlist","in":"query","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWatchlistRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchlist"}}},"description":"Successful response"}},"summary":"Update Watchlist By Name","tags":["Watchlists"]}},"/v3/calendar/{market}":{"get":{"description":"This endpoint returns the market calendar.","operationId":"Calendar","parameters":[{"$ref":"#/components/parameters/market"},{"$ref":"#/components/parameters/start"},{"$ref":"#/components/parameters/end"},{"$ref":"#/components/parameters/timezone"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/public_calendar_resp"}}},"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"400":{"$ref":"#/components/responses/400"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"summary":"Get Market Calendar","tags":["Calendar"]}},"/v3/clock":{"get":{"description":"This API serves information about multiple markets: the current time, if it's a market day, the current phase of the market, etc.\n","operationId":"Clock","parameters":[{"$ref":"#/components/parameters/markets"},{"$ref":"#/components/parameters/time"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/clock_resp"}}},"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/ratelimit_limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/ratelimit_remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/ratelimit_reset"}}},"400":{"$ref":"#/components/responses/400"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"summary":"Get Market Clock","tags":["Clock"]}}},"security":[{"API_Key":[],"API_Secret":[]}],"servers":[{"description":"Paper","url":"https://paper-api.alpaca.markets"},{"description":"Live","url":"https://api.alpaca.markets"}],"tags":[{"name":"Accounts"},{"name":"Assets"},{"name":"Corporate Actions"},{"name":"Orders"},{"name":"Positions"},{"name":"Portfolio History"},{"name":"Watchlists"},{"name":"Account Configurations"},{"name":"Account Activities"},{"name":"Calendar"},{"name":"Clock"},{"name":"Crypto Funding"},{"name":"Crypto Perpetuals Funding (Beta)"},{"name":"Crypto Perpetuals Account Vitals (Beta)"},{"name":"Crypto Perpetuals Leverage (Beta)"},{"description":"Request minting of tokenized assets and list tokenization requests on the Instant Tokenization Network (ITN).","name":"Tokenization"},{"description":"Endpoints for locate requests and quotes.","name":"Locates"},{"name":"Events"}],"x-readme":{"explorer-enabled":true,"proxy-enabled":false}}