{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"c7814f9e-994c-47a6-a8ef-85550cdc9d45","name":"BAPI Docs","description":"## Authentication\n\nAuthentication and Authorization are not part of public documentation and is provided only to explicit requests as private documentation.\n\n## 200 Response Wrapper\n\nAll successful 200 responses will be wrapped in simple model with 3 properties, where bool isSuccessful is soft indicator of successfuly processed request (our version of api response envelope pattern).\n\nBased on isSuccessful state **one of** result or unsuccessfulResult object is filled. This makes parsing of response easier even in languages that dont support features like generics or type unions, while keeping types strict in all endpoints.\n\nServer will still return classic status codes like 500 for possible internal server issues, 401 for auth issues, 400 for serious malformed request violations etc... However, in addition to those, business logic or minor mistakes like nonexisting PortfolioId requests might return 200 with isSuccessful true and unsuccessfulResult set to some more specific error (see section Failed Response for specific endpoint or global list or error codes for more details)\n\nAbove logic applies globally to all endpoints so to avoid excessive duplication assume following response structure unless explicitly stated otherwise:\n\n| Name | Type | Description |\n| --- | --- | --- |\n| isSuccessful | boolean | Indicates if 'result' or 'unsuccessfulResult' should be processed, or overall successful result if 'result' is null(able) |\n| result | object | present if isSuccessful is **true**. In some scenarios can be null, in most the type is described in **Successful Response** docs section |\n| unsuccessfulResult | object (mostly enum string) | present if isSuccessful is **false**. In most scenarios represented as enum string with details specified under section **Failed Response.** |\n\n## Optional/Nullable Properties\n\nSome properties will be marked as nullable/optional meaning that property can be null or undefined. Serialization is set to ignore null properties, so optional result properties will be absent from result model and optional request parameters might be ignored altogether (suggested) or send as null.\n\n## Empty response\n\nEmpty response means, that endpoint does not return anything for successful response, aka 'result' model is null (which is going to be ignored in serialization, aka end up undefined), most of POST endpoints that are pushing some data and not pulling are going to return such empty response as acknowledgment.\n\n## Integration Architecture Notes\n\n#### Quick business models overview:\n\n- User - single platform account aka email + password\n    \n    - defined by unique email\n        \n    - can have multiple Portfolios\n        \n    - login details shared with Cleo app + specific prop firm connection\n        \n- Portfolio - single trading account with balance\n    \n    - supports breach rules restrictions (set by Challenge)\n        \n    - contains Positions\n        \n    - ideally created from Challenge template, however settings can be passed explicitly\n        \n- Challenge - preprepared set of settings applied to Portfolio\n    \n    - optionally contains breach rules settings, which can fail portfolio internally\n        \n    - can include settings like initial balance, fees structure etc.\n        \n    - can contain info to be used for promotional screens in mobile app and elsewhere\n        \n- Position - single open order + multiple close orders having PnL, SLs, TPs\n    \n    - Position -> many Orders -> many (Order) Fills\n        \n    - abstraction containing the orders on single asset to simplify risk management\n        \n    - allows hedging\n        \n- Event - data mutation action on some of biz. models\n    \n    - positions updates - order modified, filled, closed, canceled...\n        \n    - portfolio updates - challenge rules breach, etc.\n        \n\n#### Simple model hierarchy:\n\nUser -> many Portfolios -> many Positions\n\nPosition -> many Orders -> many Fills\n\nChallenge -> many Portfolios\n\nPortfolio -> many Events\n\n#### Simple integration flows:\n\n- precreate all Challenge offerings\n    \n    - can use internally supported breach rules\n        \n    - include as many data as possible to unlock all features for users or Back Office\n        \n    - can use flow without any Challenges and specify settings explicitly to Portfolio, however this flow is suggested only for very specific prop firm models as it will result into many features being locked in Back Office or away from users\n        \n- create User\n    \n    - 1st flow option is without password specified, where user will receive unbranded email with redirection link to unbranded \"set password\" screen, after confirmation user will be redirected to prop firms cleo subdomain page (can be custom changed)\n        \n        - alternative in this flow is that the redirect can be server by client directly, skipping the email\n            \n    - 2nd flow option is sending explicit password (can be generated by client, or requested on clients FE to be chosen by user), no verification or email confirmation required\n        \n        - supports bulk action to create several user accounts at once\n            \n- create Portfolio for the User\n    \n    - main flow requires specifying the preprepared Challenge (by self chosen ID)\n        \n    - skip any Challenge settings by specifying them explicitly now (use only in special cases)\n        \n- monitor Events\n    \n    - either via rest polling or ws\n        \n    - follow up events with fetching of specific information you need\n        \n- show user trading data on your own FE\n    \n    - route your users request via your BE to bAPI to gather or transform various data\n        \n    - can request custom endpoint/data shapes that might help decrease the amount of bAPI call required","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"31950797","collectionId":"c7814f9e-994c-47a6-a8ef-85550cdc9d45","publishedId":"2sB2izEZ27","public":true,"publicUrl":"https://docs-bapi.cleo.finance","privateUrl":"https://go.postman.co/documentation/31950797-c7814f9e-994c-47a6-a8ef-85550cdc9d45","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"dark","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.11.6","publishDate":"2025-11-05T16:17:17.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"Production","id":"13866e53-56c7-463f-a455-d6b2232b675a","owner":"46657555","values":[{"key":"baseUrl","value":"https://app.cleo.finance","enabled":true,"type":"default"},{"key":"apiKey","value":"","enabled":true,"type":"default"},{"key":"bapiWsToken","value":"","enabled":true,"type":"default"},{"key":"apiKey2","value":"","enabled":true,"type":"default"},{"key":"apiKey-temp","value":"","enabled":true,"type":"default"},{"key":"bapiWsUrl","value":"wss://app.cleo.finance/bapi/ws","enabled":true,"type":"default"},{"key":"noLegacy","value":"","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/2f342ed9fa74106685d7a6c74aaa9545e100c6011f5e7c105188fa6032ed2ac2","favicon":"https://cleo.finance/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Production","value":"46657555-13866e53-56c7-463f-a455-d6b2232b675a"}],"canonicalUrl":"https://docs-bapi.cleo.finance/view/metadata/2sB2izEZ27"}