{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/tradejournallab.com"
        }
    ],
    "info": {
        "name": "TradeJournal Lab API Documentation",
        "_postman_id": "7609e1b7-9b15-4276-a4ee-62b7d3365e3d",
        "description": "TradeJournal API \u2014 Programmatic access to your trade journal data, stats, and leaderboard.",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Public API",
            "description": "\nEndpoints for external integrations via API keys.\nAll endpoints require a valid API key in the `Authorization: Bearer {key}` header.",
            "item": [
                {
                    "name": "List trades",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/trades",
                            "query": [
                                {
                                    "key": "from",
                                    "value": "2025-01-01",
                                    "description": "Filter trades from this date (YYYY-MM-DD).",
                                    "disabled": false
                                },
                                {
                                    "key": "to",
                                    "value": "2025-12-31",
                                    "description": "Filter trades up to this date (YYYY-MM-DD).",
                                    "disabled": false
                                },
                                {
                                    "key": "instrument",
                                    "value": "BTCUSDT",
                                    "description": "Filter by instrument\/symbol.",
                                    "disabled": false
                                },
                                {
                                    "key": "side",
                                    "value": "long",
                                    "description": "Filter by trade side.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "25",
                                    "description": "Number of results per page (1-100).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/v1\/trades?from=2025-01-01&to=2025-12-31&instrument=BTCUSDT&side=long&per_page=25"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get a paginated list of your trades with optional filters."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"id\": 1,\n      \"instrument\": \"BTCUSDT\",\n      \"side\": \"long\",\n      \"quantity\": 0.5,\n      \"entry_time\": \"2025-03-15T10:30:00.000000Z\",\n      \"entry_price\": 65000.00,\n      \"exit_time\": \"2025-03-15T14:00:00.000000Z\",\n      \"exit_price\": 66500.00,\n      \"pnl\": 750.00,\n      \"net_pnl\": 748.50,\n      \"commission\": 1.50,\n      \"setup_type\": \"breakout\",\n      \"notes\": \"Strong momentum breakout\"\n    }\n  ],\n  \"current_page\": 1,\n  \"last_page\": 3,\n  \"per_page\": 25,\n  \"total\": 72\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"error\": \"Insufficient scope: trades:read required\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Create a trade",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/trades",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/trades"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"instrument\":\"BTCUSDT\",\"side\":\"long\",\"quantity\":0.5,\"entry_time\":\"2025-03-15T10:30:00Z\",\"entry_price\":65000,\"exit_time\":\"2025-03-15T14:00:00Z\",\"exit_price\":66500,\"stop_loss\":64000,\"take_profit\":68000,\"commission\":1.5,\"notes\":\"Strong momentum breakout\",\"setup_type\":\"breakout\"}"
                        },
                        "description": "Create a new trade in your journal."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"id\": 99,\n  \"instrument\": \"BTCUSDT\",\n  \"side\": \"long\",\n  \"entry_price\": 65000.00,\n  \"message\": \"Trade created\"\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"error\": \"Insufficient scope: trades:write required\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"error\": \"Validation failed\", \"details\": {\"instrument\": [\"The instrument field is required.\"]}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get account stats",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/stats",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/stats"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get aggregated performance statistics for your account."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"total_trades\": 150,\n  \"win_rate\": 62.5,\n  \"net_pnl\": 12450.75,\n  \"profit_factor\": 2.35,\n  \"gross_profit\": 25000.50,\n  \"gross_loss\": 10638.30,\n  \"avg_win\": 312.50,\n  \"avg_loss\": -189.25,\n  \"best_trade\": 1500.00,\n  \"worst_trade\": -650.00\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"error\": \"Insufficient scope: stats:read required\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get leaderboard",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/leaderboard",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/leaderboard"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get the top 25 traders ranked by net P&L over the last 30 days (minimum 5 trades)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "[\n  {\n    \"rank\": 1,\n    \"user\": \"TraderAce\",\n    \"trades\": 45,\n    \"pnl\": 8500.00\n  },\n  {\n    \"rank\": 2,\n    \"user\": \"SwingKing\",\n    \"trades\": 32,\n    \"pnl\": 6200.50\n  }\n]",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"error\": \"Insufficient scope: leaderboard:read required\"}",
                            "name": ""
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "Authorization",
                "type": "string"
            }
        ]
    }
}