# CPlugin WebAPI > CPlugin WebAPI is a hosted REST JSON and SignalR (WebSocket) API over the MetaTrader 4 (MT4) and MetaTrader 5 (MT5) Manager API. A broker's application manages accounts, trades, groups and symbols on its MT4 and MT5 servers from any language that speaks HTTP, and receives quotes, margin and trade events in realtime. - Publisher: CPlugin (CPlugin Labs LP), https://cplugin.com — contact: info@cplugin.com - Website: https://mywebapi.com - Platforms: MetaTrader 4 and MetaTrader 5 trade servers. WebAPI connects to the trade server with a regular manager account, the same way the MetaTrader Manager terminal does; no server plugin is required. The server and the manager credentials are registered once in Toolbox. - Authentication: OAuth 2.0 client credentials. Exchange the client id and secret at https://auth.cplugin.net/connect/token (grant_type=client_credentials, scope=webapi) for a bearer token and send it as `Authorization: Bearer `. Realtime connections pass the same token in the `signalr_token` query parameter. The SDKs obtain, cache and refresh the token themselves. - Production: REST base URL https://cloud.mywebapi.com, token server https://auth.cplugin.net, management portal https://toolbox.cplugin.com. Multi-region cloud. - Sandbox: REST base URL https://pre.mywebapi.com, token server https://pre.auth.cplugin.net, management portal https://pre.toolbox.cplugin.com. Same API surface and OAuth flow as Production; free, no SLA, may be reset without notice — for integration testing. - API v1 (stable): 101 operations — General 4, MT4 42, MT5 55. Paths `/api/MT4/…, /api/MT5/…`. - API v2 (beta): 159 operations — MT4 147, MT5 12. Paths `/api/v2/…`. - Versions run side by side on the same hosts with the same token, so an integration can move from v1 to v2 one call at a time. v1 is what most integrations run on today; the SDKs are built on v2. - Realtime: SignalR hubs /hubs/mt4/v1, /hubs/mt5/v1, /hubs/mt4/v2 and /hubs/mt5/v2 — ticks, margins and trade events. SignalR uses WebSockets and falls back to Server-Sent Events or long polling. - Deadlines and retries: every trade-platform request has a deadline, adjustable per request with the `X-Request-Timeout` header (1 to 300 seconds). A read that timed out changed nothing and is safe to repeat. A trade that timed out may still be completed by the platform: the answer is `OutcomeUnknown`, and repeating it with the same `Idempotency-Key` returns its real result without executing it twice. - Pricing: the Sandbox is free. Production is billed by usage; the customer's current rates are shown on the pricing page in Toolbox: https://toolbox.cplugin.com/webapi/pricing - Deployment: a hosted cloud service. On-premises deployment is offered only on request, for large clients under an individual contract. ## API reference - [HTML API reference](https://mywebapi.com/reference/): every operation by platform and tag, with parameters, schemas and curl examples; plain HTML, no JavaScript needed - [API v1 reference (stable)](https://mywebapi.com/reference/v1/): 101 operations — General 4, MT4 42, MT5 55 - [API v2 reference (beta)](https://mywebapi.com/reference/v2/): 159 operations — MT4 147, MT5 12 - [OpenAPI v1 specification (JSON)](https://cloud.mywebapi.com/swagger/v1/swagger.json): OpenAPI 3.0, 101 operations - [OpenAPI v2 specification (JSON)](https://cloud.mywebapi.com/swagger/v2/swagger.json): OpenAPI 3.0, 159 operations - [Complete operation list](https://mywebapi.com/llms-full.txt): every operation of both versions in one Markdown file ## SDKs Open source; each handles the OAuth token for you and works against Production or the Sandbox. - [TypeScript / JavaScript — npm `@mywebapi.com/sdk`](https://www.npmjs.com/package/@mywebapi.com/sdk): `npm i @mywebapi.com/sdk` - [Python — PyPI `mywebapi-sdk`](https://pypi.org/project/mywebapi-sdk/): `pip install mywebapi-sdk` - [.NET — NuGet `MyWebApi.Sdk`](https://www.nuget.org/packages/MyWebApi.Sdk): `dotnet add package MyWebApi.Sdk` - [PowerShell — PowerShell Gallery `MyWebApi`](https://www.powershellgallery.com/packages/MyWebApi): `Install-Module MyWebApi` ## Docs - [Guides](https://cplugin.com/docs/webapi): authentication, timeouts, idempotency, realtime - [Changelog](https://cloud.mywebapi.com/History): new endpoints and changes, newest first - [Interactive API v1 reference (Redoc)](https://cloud.mywebapi.com/redoc_v1/index.html): the same specification, rendered in the browser - [Interactive API v2 reference (Redoc)](https://cloud.mywebapi.com/redoc_v2/index.html): the same specification, rendered in the browser ## Optional - [Organizations (API v1)](https://mywebapi.com/reference/v1/organizations/): 1 operation - [TradePlatforms (API v1)](https://mywebapi.com/reference/v1/trade-platforms/): 3 operations - [MT4 :: Common (API v1)](https://mywebapi.com/reference/v1/mt4-common/): 4 operations - [MT4 :: Groups (API v1)](https://mywebapi.com/reference/v1/mt4-groups/): 5 operations - [MT4 :: Prices (API v1)](https://mywebapi.com/reference/v1/mt4-prices/): 6 operations - [MT4 :: Symbols (API v1)](https://mywebapi.com/reference/v1/mt4-symbols/): 7 operations - [MT4 :: Trades (API v1)](https://mywebapi.com/reference/v1/mt4-trades/): 8 operations - [MT4 :: Users (API v1)](https://mywebapi.com/reference/v1/mt4-users/): 12 operations - [MT5 :: Clients (API v1)](https://mywebapi.com/reference/v1/mt5-clients/): 5 operations - [MT5 :: Configuration Databases :: Groups (API v1)](https://mywebapi.com/reference/v1/mt5-configuration-databases-groups/): 3 operations - [MT5 :: Configuration Databases :: Managers (API v1)](https://mywebapi.com/reference/v1/mt5-configuration-databases-managers/): 1 operation - [MT5 :: Configuration Databases :: Symbols (API v1)](https://mywebapi.com/reference/v1/mt5-configuration-databases-symbols/): 3 operations - [MT5 :: Configuration Databases :: Time (API v1)](https://mywebapi.com/reference/v1/mt5-configuration-databases-time/): 2 operations - [MT5 :: History Data (API v1)](https://mywebapi.com/reference/v1/mt5-history-data/): 1 operation - [MT5 :: Trade Activity :: Dealing (API v1)](https://mywebapi.com/reference/v1/mt5-trade-activity-dealing/): 3 operations - [MT5 :: Trade Databases :: Deals (API v1)](https://mywebapi.com/reference/v1/mt5-trade-databases-deals/): 9 operations - [MT5 :: Trade Databases :: Orders (API v1)](https://mywebapi.com/reference/v1/mt5-trade-databases-orders/): 12 operations - [MT5 :: Trade Databases :: Positions (API v1)](https://mywebapi.com/reference/v1/mt5-trade-databases-positions/): 6 operations - [MT5 :: Users (API v1)](https://mywebapi.com/reference/v1/mt5-users/): 10 operations - [MT4 v2 :: Authentication (API v2)](https://mywebapi.com/reference/v2/mt4-authentication/): 2 operations - [MT4 v2 :: Backup (API v2)](https://mywebapi.com/reference/v2/mt4-backup/): 4 operations - [MT4 v2 :: Backup (destructive) (API v2)](https://mywebapi.com/reference/v2/mt4-backup-destructive/): 2 operations - [MT4 v2 :: Common (API v2)](https://mywebapi.com/reference/v2/mt4-common/): 3 operations - [MT4 v2 :: Config (API v2)](https://mywebapi.com/reference/v2/mt4-config/): 51 operations - [MT4 v2 :: Groups (API v2)](https://mywebapi.com/reference/v2/mt4-groups/): 8 operations - [MT4 v2 :: History (API v2)](https://mywebapi.com/reference/v2/mt4-history/): 1 operation - [MT4 v2 :: Mail (API v2)](https://mywebapi.com/reference/v2/mt4-mail/): 1 operation - [MT4 v2 :: Margins (API v2)](https://mywebapi.com/reference/v2/mt4-margins/): 3 operations - [MT4 v2 :: News (API v2)](https://mywebapi.com/reference/v2/mt4-news/): 5 operations - [MT4 v2 :: Online (API v2)](https://mywebapi.com/reference/v2/mt4-online/): 2 operations - [MT4 v2 :: Plugins (API v2)](https://mywebapi.com/reference/v2/mt4-plugins/): 1 operation - [MT4 v2 :: Prices (API v2)](https://mywebapi.com/reference/v2/mt4-prices/): 8 operations - [MT4 v2 :: Reports (API v2)](https://mywebapi.com/reference/v2/mt4-reports/): 6 operations - [MT4 v2 :: Server Admin (API v2)](https://mywebapi.com/reference/v2/mt4-server-admin/): 4 operations - [MT4 v2 :: Server Admin (destructive) (API v2)](https://mywebapi.com/reference/v2/mt4-server-admin-destructive/): 4 operations - [MT4 v2 :: Symbols (API v2)](https://mywebapi.com/reference/v2/mt4-symbols/): 13 operations - [MT4 v2 :: Trades (API v2)](https://mywebapi.com/reference/v2/mt4-trades/): 16 operations - [MT4 v2 :: Users (API v2)](https://mywebapi.com/reference/v2/mt4-users/): 13 operations - [MT5 v2 :: Common (API v2)](https://mywebapi.com/reference/v2/mt5-common/): 2 operations - [MT5 v2 :: Groups (API v2)](https://mywebapi.com/reference/v2/mt5-groups/): 2 operations - [MT5 v2 :: Managers (API v2)](https://mywebapi.com/reference/v2/mt5-managers/): 1 operation - [MT5 v2 :: Symbols (API v2)](https://mywebapi.com/reference/v2/mt5-symbols/): 2 operations - [MT5 v2 :: Trades (API v2)](https://mywebapi.com/reference/v2/mt5-trades/): 3 operations - [MT5 v2 :: Users (API v2)](https://mywebapi.com/reference/v2/mt5-users/): 2 operations MetaTrader, MT4, MT5 and MetaQuotes are trademarks or registered trademarks of MetaQuotes Ltd. CPlugin is not affiliated with, endorsed by, or sponsored by MetaQuotes Ltd.