openapi: 3.1.0

info:
  title: AlphaInsider
  version: '1.0'
  description: The official API and websocket documentation for [AlphaInsider.com](https://alphainsider.com/)

servers:
  - url: 'https://alphainsider.com/api'

tags:
  - name: Introduction
  - name: Authentication
  - name: Users
  - name: Strategies
  - name: Subscriptions
  - name: Payments
  - name: Withdrawals
  - name: Timelines
  - name: Stocks
  - name: Trades
  - name: Webhooks
  - name: Bots
  - name: Websockets
paths:
  #DONE: AUTHENTICATION
  /verifyToken:
    get:
      operationId: verifyToken
      summary: verifyToken
      description: Verify that an API token is valid using the `Authorization` header.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Authentication
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      token_id:
                        type: string
                        description: "Identifier for the verified API token."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      holder:
                        type: string
                        description: "User or entity that holds the token."
                      type:
                        type: string
                        enum: [ 'refresh', 'api' ]
                        description: "Type or category for this object."
                      name:
                        type: string
                        description: "Display name."
                      scope:
                        type: array
                        description: "Permissions granted to the token."
                        items:
                          type: string
              examples:
                '200':
                  value: {"success":true,"response":{"token_id":"okUfjYeZfp2sG4-SGuGjP","user_id":"user_1","holder":"user_1","type":"api","name":"test","scope":["getUserInfo"]}}
        '400':
          $ref: '#/components/responses/400'

  #DONE: USERS
  /getUsers:
    get:
      operationId: getUsers
      summary: getUsers
      description: Get public user information.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Users
      parameters:
        - name: user_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of user IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/user_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        info:
                          type: object
                          description: "Profile information object."
                          properties:
                            bio:
                              type: string
                              description: "User profile biography."
                            x:
                              type: string
                              description: "X/Twitter profile URL."
                            website:
                              type: string
                              description: "Website URL."
                            youtube:
                              type: string
                              description: "YouTube profile URL."
                            telegram:
                              type: string
                              description: "Telegram profile URL."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        post_count:
                          type: string
                          description: "Number of public posts."
                        like_count:
                          type: string
                          description: "Number of likes."
                        subscriber_count:
                          type: string
                          description: "Number of subscribers."
                        strategy_count:
                          type: string
                          description: "Number of strategies."
              examples:
                '200':
                  value: {"success":true,"response":[{"user_id":"user_1","info":{"bio":"","x":"","website":"","youtube":"","telegram":""},"updated_at":"2024-10-15T19:34:54.549Z","created_at":"2024-08-30T13:40:27.343Z","post_count":"1","like_count":"0","subscriber_count":"0","strategy_count":"5"}]}
        '400':
          $ref: '#/components/responses/400'
  /getUserInfo:
    get:
      operationId: getUserInfo
      summary: getUserInfo
      description: Get private user information.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      email:
                        type: string
                        description: "User email address."
                      info:
                        type: object
                        description: "Profile information object."
                        properties:
                          bio:
                            type: string
                            description: "User profile biography."
                          x:
                            type: string
                            description: "X/Twitter profile URL."
                          website:
                            type: string
                            description: "Website URL."
                          youtube:
                            type: string
                            description: "YouTube profile URL."
                          telegram:
                            type: string
                            description: "Telegram profile URL."
                      commission:
                        type: integer
                        description: "User commission percentage or amount as returned by AlphaInsider."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'subscription', 'like', 'subscription_email', 'new_features_email', 'payment_complete_email' ]
                      payments_enabled:
                        type: boolean
                        description: "Whether payments are enabled for the user."
                      verified:
                        type: boolean
                        description: "Whether the user is verified."
                      ref_id:
                        type: string
                        description: "Referral identifier."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"user_id":"user_1","email":"test@email.com","info":{"bio":"","x":"","website":"","youtube":"","telegram":""},"commission":70,"notifications":["subscription","like","subscription_email","new_features_email"],"payments_enabled":true,"verified":true,"ref_id":"u7OFKFKKR4ItSdgfzYP3I","updated_at":"2024-10-15T19:34:54.549Z","created_at":"2024-08-30T13:40:27.343Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateUserInfo:
    post:
      operationId: updateUserInfo
      summary: updateUserInfo
      description: Update user profile information.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                bio:
                  type: string
                  description: Bio description.
                youtube:
                  type: string
                  format: url
                  description: Youtube link.
                x:
                  type: string
                  format: url
                  description: X link.
                telegram:
                  type: string
                  format: url
                  description: Telegram link.
                website:
                  type: string
                  format: url
                  description: Website link.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      email:
                        type: string
                        description: "User email address."
                      info:
                        type: object
                        description: "Profile information object."
                        properties:
                          bio:
                            type: string
                            description: "User profile biography."
                          x:
                            type: string
                            description: "X/Twitter profile URL."
                          website:
                            type: string
                            description: "Website URL."
                          youtube:
                            type: string
                            description: "YouTube profile URL."
                          telegram:
                            type: string
                            description: "Telegram profile URL."
                      commission:
                        type: integer
                        description: "User commission percentage or amount as returned by AlphaInsider."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'subscription', 'like', 'subscription_email', 'new_features_email', 'payment_complete_email' ]
                      payments_enabled:
                        type: boolean
                        description: "Whether payments are enabled for the user."
                      verified:
                        type: boolean
                        description: "Whether the user is verified."
                      ref_id:
                        type: string
                        description: "Referral identifier."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"user_id":"user_1","email":"test@email.com","info":{"bio":"Test Bio","x":"","website":"","youtube":"","telegram":""},"commission":70,"notifications":["subscription","like","subscription_email","new_features_email"],"payments_enabled":true,"verified":true,"ref_id":"u7OFKFKKR4ItSdgfzYP3I","updated_at":"2024-10-22T20:30:44.688Z","created_at":"2024-08-30T13:40:27.343Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateUserNotifications:
    post:
      operationId: updateUserNotifications
      summary: updateUserNotifications
      description: Update user notification settings.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Users
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - notifications
              properties:
                notifications:
                  type: array
                  description: Array of notification settings.
                  items:
                    type: string
                    enum: ['subscription', 'like', 'subscription_email', 'new_features_email', 'payment_complete_email']
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      email:
                        type: string
                        description: "User email address."
                      info:
                        type: object
                        description: "Profile information object."
                        properties:
                          bio:
                            type: string
                            description: "User profile biography."
                          x:
                            type: string
                            description: "X/Twitter profile URL."
                          website:
                            type: string
                            description: "Website URL."
                          youtube:
                            type: string
                            description: "YouTube profile URL."
                          telegram:
                            type: string
                            description: "Telegram profile URL."
                      commission:
                        type: integer
                        description: "User commission percentage or amount as returned by AlphaInsider."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'subscription', 'like', 'subscription_email', 'new_features_email', 'payment_complete_email' ]
                      payments_enabled:
                        type: boolean
                        description: "Whether payments are enabled for the user."
                      verified:
                        type: boolean
                        description: "Whether the user is verified."
                      ref_id:
                        type: string
                        description: "Referral identifier."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"user_id":"user_1","email":"test@email.com","info":{"bio":"Test Bio","x":"","website":"","youtube":"","telegram":""},"commission":70,"notifications":["like","subscription_email","new_features_email"],"payments_enabled":true,"verified":true,"ref_id":"u7OFKFKKR4ItSdgfzYP3I","updated_at":"2024-10-22T20:30:44.688Z","created_at":"2024-08-30T13:40:27.343Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: STRATEGIES
  /getStrategies:
    get:
      operationId: getStrategies
      summary: getStrategies
      description: Get strategy information.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of strategy IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/strategy_id'
        - name: timeframe
          in: query
          schema:
            $ref: '#/components/schemas/timeframe'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        type:
                          type: string
                          enum: [ 'stock', 'cryptocurrency' ]
                          description: "Type or category for this object."
                        private:
                          type: boolean
                          description: "Whether the strategy is private."
                        name:
                          type: string
                          description: "Display name."
                        description:
                          type: string
                          description: "Human-readable description."
                        categories:
                          type: array
                          description: "Strategy category labels."
                          items:
                            type: string
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
                        subscriber_count:
                          type: string
                          description: "Number of subscribers."
                        timeframes:
                          type: array
                          description: "Per-timeframe ranking and historical value data."
                          items:
                            type: object
                            properties:
                              timeframe:
                                $ref: '#/components/schemas/timeframe'
                              rank_performance:
                                type: string
                                description: "Performance rank for the timeframe."
                              rank_popular:
                                type: string
                                description: "Popularity rank for the timeframe."
                              rank_trending:
                                type: string
                                description: "Trending rank for the timeframe."
                              rank_top:
                                type: string
                                description: "Overall top rank for the timeframe."
                              max_drawdown:
                                type: string
                                description: "Maximum drawdown for the timeframe."
                              past_value:
                                type: string
                                description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"YdNf91nP-Q-YB39RwtlHQ","product_id":"yvtLPHMNML3th6csjO_bV","user_id":"user_1","type":"cryptocurrency","private":false,"name":"vdsvdsvds","description":"","categories":["other"],"updated_at":"2024-10-07T15:05:09.124Z","created_at":"2024-10-07T15:05:09.124Z","price":0,"subscriber_count":"0","timeframes":[{"timeframe":"week","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"year","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"day","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"month","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"five_year","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"}]}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getStrategyValues:
    get:
      operationId: getStrategyValues
      summary: getStrategyValues
      description: Get current strategy value.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of strategy IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        strategy_value:
                          type: string
                          description: "Normalized strategy value. Convert before displaying user-facing USD values."
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"PKw1UvPIoGMARkXTXzYk6","strategy_value":"1.00000000000000000"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getUserStrategies:
    get:
      operationId: getUserStrategies
      summary: getUserStrategies
      description: Get user strategies.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: user_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/user_id'
        - name: timeframe
          in: query
          schema:
            $ref: '#/components/schemas/timeframe'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        type:
                          type: string
                          enum: [ 'stock', 'cryptocurrency' ]
                          description: "Type or category for this object."
                        private:
                          type: boolean
                          description: "Whether the strategy is private."
                        name:
                          type: string
                          description: "Display name."
                        description:
                          type: string
                          description: "Human-readable description."
                        categories:
                          type: array
                          description: "Strategy category labels."
                          items:
                            type: string
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
                        subscriber_count:
                          type: string
                          description: "Number of subscribers."
                        timeframes:
                          type: array
                          description: "Per-timeframe ranking and historical value data."
                          items:
                            type: object
                            properties:
                              timeframe:
                                $ref: '#/components/schemas/timeframe'
                              rank_performance:
                                type: string
                                description: "Performance rank for the timeframe."
                              rank_popular:
                                type: string
                                description: "Popularity rank for the timeframe."
                              rank_trending:
                                type: string
                                description: "Trending rank for the timeframe."
                              rank_top:
                                type: string
                                description: "Overall top rank for the timeframe."
                              max_drawdown:
                                type: string
                                description: "Maximum drawdown for the timeframe."
                              past_value:
                                type: string
                                description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"YdNf91nP-Q-YB39RwtlHQ","product_id":"yvtLPHMNML3th6csjO_bV","user_id":"user_1","type":"cryptocurrency","private":false,"name":"vdsvdsvds","description":"","categories":["other"],"updated_at":"2024-10-07T15:05:09.124Z","created_at":"2024-10-07T15:05:09.124Z","price":0,"subscriber_count":"0","timeframes":[{"timeframe":"week","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"year","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"day","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"month","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"five_year","rank_performance":"4","rank_popular":"4","rank_trending":"5","rank_top":"5","max_drawdown":"0.000000000000000","past_value":"1.000000000000000"}]}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getStrategyPerformance:
    get:
      operationId: getStrategyPerformance
      summary: getStrategyPerformance
      description: Get strategy performance data.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/strategy_id'
        - name: frequency
          in: query
          schema:
            $ref: '#/components/schemas/frequency'
        - name: interval
          in: query
          schema:
            $ref: '#/components/schemas/interval'
        - name: start_date
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        strategy_value:
                          type: string
                          description: "Normalized strategy value. Convert before displaying user-facing USD values."
                        activity:
                          type: string
                          description: "Trade activity label for a performance interval."
                        trade_count:
                          type: string
                          description: "Number of trades in the interval."
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"YdNf91nP-Q-YB39RwtlHQ","created_at":"2024-10-07T00:00:00.000Z","strategy_value":"1.000000000000000","activity": "","trade_count":"0"},{"strategy_id":"YdNf91nP-Q-YB39RwtlHQ","created_at":"2024-10-08T00:00:00.000Z","strategy_value":"1.000000000000000","activity": "buy","trade_count":"1"},{"strategy_id":"YdNf91nP-Q-YB39RwtlHQ","created_at":"2024-10-11T00:00:00.000Z","strategy_value":"1.000000000000000","activity": "sell","trade_count":"1"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getRecommendedStrategies:
    get:
      operationId: getRecommendedStrategies
      summary: getRecommendedStrategies
      description: Get recommended strategies.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of strategy IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/strategy_id'
        - name: timeframe
          in: query
          schema:
            $ref: '#/components/schemas/timeframe'
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        type:
                          type: string
                          enum: [ 'stock', 'cryptocurrency' ]
                          description: "Type or category for this object."
                        private:
                          type: boolean
                          description: "Whether the strategy is private."
                        name:
                          type: string
                          description: "Display name."
                        description:
                          type: string
                          description: "Human-readable description."
                        categories:
                          type: array
                          description: "Strategy category labels."
                          items:
                            type: string
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
                        subscriber_count:
                          type: string
                          description: "Number of subscribers."
                        timeframes:
                          type: array
                          description: "Per-timeframe ranking and historical value data."
                          items:
                            type: object
                            properties:
                              timeframe:
                                $ref: '#/components/schemas/timeframe'
                              rank_performance:
                                type: string
                                description: "Performance rank for the timeframe."
                              rank_popular:
                                type: string
                                description: "Popularity rank for the timeframe."
                              rank_trending:
                                type: string
                                description: "Trending rank for the timeframe."
                              rank_top:
                                type: string
                                description: "Overall top rank for the timeframe."
                              max_drawdown:
                                type: string
                                description: "Maximum drawdown for the timeframe."
                              past_value:
                                type: string
                                description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"SBVZIDvZUIKbjNEgst136","product_id":"ejH4ubCDd4ZE1-c_HbZ97","user_id":"TradingViewTracker","type":"cryptocurrency","private":false,"name":"Stochastic Pop and Drop by Jake Bernstein v1 [Bitduke]   Strategy by Bitduke","description":"I found a simple strategy by Jake Bernstein, modified it a little and created a strategy with Risk Management System (SL+TP); After that I test it on the different cryptocurrency pairs.\n\nAbout the Indicator\n\nBasically it's the strategy of 2 indicators: Stochastic Oscillator to define the bias and Average Directional Index to confirm it.\n\nOne again, It uses Stochastic Oscillator to define the trading bias. In particular, the trading bias was deemed bullish when the weekly 14-period Stochastic  \n\nTrading View Link: https://www.tradingview.com/script/kWhNGFXX-Stochastic-Pop-and-Drop-by-Jake-Bernstein-v1-Bitduke/\n(If you're the owner of this script and would like to delete it. Please contact me: miami_coder@protonmail.com)","categories":["other"],"updated_at":"2024-10-15T20:42:57.868Z","created_at":"2023-01-09T20:06:20.135Z","price":0,"subscriber_count":"6","timeframes":[{"timeframe":"month","rank_performance":"2","rank_popular":"81","rank_trending":"3","rank_top":"2","max_drawdown":"0.006328815588562","past_value":"1.433831509646664"},{"timeframe":"day","rank_performance":"23","rank_popular":"81","rank_trending":"24","rank_top":"23","max_drawdown":"0.006067663028796","past_value":"1.723784987032618"},{"timeframe":"year","rank_performance":"47","rank_popular":"81","rank_trending":"50","rank_top":"47","max_drawdown":"0.047444028894143","past_value":"0.976968351294703"},{"timeframe":"week","rank_performance":"8","rank_popular":"81","rank_trending":"9","rank_top":"9","max_drawdown":"0.007024010674107","past_value":"1.654229932055940"},{"timeframe":"five_year","rank_performance":"112","rank_popular":"81","rank_trending":"117","rank_top":"112","max_drawdown":"0.047258723825134","past_value":"1.000000000000000"}]}]}
        '400':
          $ref: '#/components/responses/400'
  /searchStrategies:
    post:
      operationId: searchStrategies
      summary: searchStrategies
      description: Search strategies.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                search:
                  type: string
                  description: Term to search for.
                type:
                  type: object
                  description: Filter by strategy security type.
                  properties:
                    includes:
                      type: array
                      description: Must ***include*** these types.
                      items:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                    excludes:
                      type: array
                      description: Must ***exclude*** these types.
                      items:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                categories:
                  type: object
                  description: Filter by category.
                  properties:
                    includes:
                      type: array
                      description: Must ***include*** these categories.
                      items:
                        type: string
                    excludes:
                      type: array
                      description: Must ***exclude*** these categories.
                      items:
                        type: string
                max_drawdown:
                  type: number
                  description: Filter by max drawdown.
                positions:
                  type: object
                  description: Filter by current stock positions.
                  properties:
                    includes:
                      type: array
                      description: Must ***include*** these stock positions. `["stock:exchange"]` or `["stock_id"]`
                      maxItems: 100
                      items:
                        type: string
                    excludes:
                      type: array
                      description: Must ***exclude*** these stock positions. `["stock:exchange"]` or `["stock_id"]`
                      maxItems: 100
                      items:
                        type: string
                sectors:
                  type: object
                  description: Filter by sector.
                  properties:
                    includes:
                      type: array
                      description: Must ***include*** these sectors.
                      items:
                        type: string
                    excludes:
                      type: array
                      description: Must ***exclude*** these sectors.
                      items:
                        type: string
                trade_count_min:
                  type: number
                  description: Filter by minimum trade count.
                trade_count_max:
                  type: number
                  description: Filter by maximum trade count.
                price_min:
                  type: number
                  description: Filter by minimum price.
                price_max:
                  type: number
                  description: Filter by maximum price.
                created_min:
                  type: string
                  format: date-time
                  description: Filter by minimum strategy created date.
                created_max:
                  type: string
                  format: date-time
                  description: Filter by maximum strategy created date.<br/> Must be greater than or equal to created_min.
                timeframe:
                  $ref: '#/components/schemas/timeframe'
                sort:
                  $ref: '#/components/schemas/sort'
                limit:
                  $ref: '#/components/schemas/limit'
                offset_id:
                  $ref: '#/components/schemas/offset_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        type:
                          type: string
                          enum: [ 'stock', 'cryptocurrency' ]
                          description: "Type or category for this object."
                        private:
                          type: boolean
                          description: "Whether the strategy is private."
                        name:
                          type: string
                          description: "Display name."
                        description:
                          type: string
                          description: "Human-readable description."
                        categories:
                          type: array
                          description: "Strategy category labels."
                          items:
                            type: string
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
                        subscriber_count:
                          type: string
                          description: "Number of subscribers."
                        timeframes:
                          type: array
                          description: "Per-timeframe ranking and historical value data."
                          items:
                            type: object
                            properties:
                              timeframe:
                                $ref: '#/components/schemas/timeframe'
                              rank_performance:
                                type: string
                                description: "Performance rank for the timeframe."
                              rank_popular:
                                type: string
                                description: "Popularity rank for the timeframe."
                              rank_trending:
                                type: string
                                description: "Trending rank for the timeframe."
                              rank_top:
                                type: string
                                description: "Overall top rank for the timeframe."
                              max_drawdown:
                                type: string
                                description: "Maximum drawdown for the timeframe."
                              past_value:
                                type: string
                                description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"RXKyIAbn7iUy0IPdPg18T","product_id":"vAXJP6VnKsEJeUgs36ao0","user_id":"TradingViewTracker","type":"cryptocurrency","private":false,"name":"Voss Strategy (Filter + Trend Indicator) [Bitduke] by Bitduke","description":"Created strategy based on Voss Predictive Filter, implemented by TradingView user e2e4mfck. \n\nVoss Predictive Filter \n\nThis is a relatively new filter from John F. Ehlers  article,  A Peek Into The Future .  Ehlers describes the calculation of a new filter that could help signal cyclical turning points in markets. \n\nBut filter has a negative group delay and while an indicator based on it cannot actually see into the future, it may provide the trader with signals in advance of other indicators.  \n\nTrading View Link: https://www.tradingview.com/script/CymW3DRi-Voss-Strategy-Filter-Trend-Indicator-Bitduke/\n(If you're the owner of this script and would like to delete it. Please contact me: miami_coder@protonmail.com)","categories":["other"],"updated_at":"2024-10-15T20:42:57.868Z","created_at":"2023-01-09T19:31:05.177Z","price":0,"subscriber_count":"200","timeframes":[{"timeframe":"week","rank_performance":"25","rank_popular":"6","rank_trending":"2","rank_top":"5","max_drawdown":"0.008102630749388","past_value":"17.121975147643069"},{"timeframe":"year","rank_performance":"1","rank_popular":"6","rank_trending":"1","rank_top":"1","max_drawdown":"0.051727391692518","past_value":"2.258474326291726"},{"timeframe":"month","rank_performance":"720","rank_popular":"6","rank_trending":"2","rank_top":"74","max_drawdown":"0.007996851899074","past_value":"18.950175146020312"},{"timeframe":"day","rank_performance":"748","rank_popular":"6","rank_trending":"748","rank_top":"748","max_drawdown":"0.004051215253596","past_value":"18.122730158452871"},{"timeframe":"five_year","rank_performance":"1","rank_popular":"6","rank_trending":"2","rank_top":"1","max_drawdown":"0.050710664377589","past_value":"1.000000000000000"}]}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newStrategy:
    post:
      operationId: newStrategy
      summary: newStrategy
      description: Create new strategy.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - name
                - input_value
              properties:
                type:
                  type: string
                  description: Strategy security type.
                  enum: ['stock', 'cryptocurrency']
                private:
                  type: boolean
                  description: Whether strategy is public or private.
                name:
                  type: string
                  description: Strategy name.
                description:
                  type: string
                  description: Strategy description.
                input_value:
                  $ref: '#/components/schemas/input_value'
                price:
                  type: number
                  description: Monthly subscription price.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      type:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                        description: "Type or category for this object."
                      private:
                        type: boolean
                        description: "Whether the strategy is private."
                      name:
                        type: string
                        description: "Display name."
                      description:
                        type: string
                        description: "Human-readable description."
                      categories:
                        type: array
                        description: "Strategy category labels."
                        items:
                          type: string
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      price:
                        type: integer
                        description: "Price or execution price, depending on context."
                      subscriber_count:
                        type: string
                        description: "Number of subscribers."
                      timeframes:
                        type: array
                        description: "Per-timeframe ranking and historical value data."
                        items:
                          type: object
                          properties:
                            timeframe:
                              $ref: '#/components/schemas/timeframe'
                            rank_performance:
                              type: [integer, "null"]
                              description: "Performance rank for the timeframe."
                            rank_popular:
                              type: [integer, "null"]
                              description: "Popularity rank for the timeframe."
                            rank_trending:
                              type: [integer, "null"]
                              description: "Trending rank for the timeframe."
                            rank_top:
                              type: [integer, "null"]
                              description: "Overall top rank for the timeframe."
                            max_drawdown:
                              type: string
                              description: "Maximum drawdown for the timeframe."
                            past_value:
                              type: string
                              description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"WuRnay0CF3P1oPRSdogj5","product_id":"1bRPI9xQHhE23KpAXViKW","user_id":"user_1","type":"stock","private":false,"name":"Test strategy","description":"","categories":[],"updated_at":"2024-10-22T20:44:42.391Z","created_at":"2024-10-22T20:44:42.391Z","price":0,"subscriber_count":"0","timeframes":[{"timeframe":"day","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"week","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"month","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"year","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"five_year","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"}]}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateStrategy:
    post:
      operationId: updateStrategy
      summary: updateStrategy
      description: Update existing strategy.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - name
                - input_value
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                name:
                  type: string
                  description: Strategy name.
                description:
                  type: string
                  description: Strategy description.
                input_value:
                  $ref: '#/components/schemas/input_value'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      type:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                        description: "Type or category for this object."
                      private:
                        type: boolean
                        description: "Whether the strategy is private."
                      name:
                        type: string
                        description: "Display name."
                      description:
                        type: string
                        description: "Human-readable description."
                      categories:
                        type: array
                        description: "Strategy category labels."
                        items:
                          type: string
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      price:
                        type: integer
                        description: "Price or execution price, depending on context."
                      subscriber_count:
                        type: string
                        description: "Number of subscribers."
                      timeframes:
                        type: array
                        description: "Per-timeframe ranking and historical value data."
                        items:
                          type: object
                          properties:
                            timeframe:
                              $ref: '#/components/schemas/timeframe'
                            rank_performance:
                              type: [integer, "null"]
                              description: "Performance rank for the timeframe."
                            rank_popular:
                              type: [integer, "null"]
                              description: "Popularity rank for the timeframe."
                            rank_trending:
                              type: [integer, "null"]
                              description: "Trending rank for the timeframe."
                            rank_top:
                              type: [integer, "null"]
                              description: "Overall top rank for the timeframe."
                            max_drawdown:
                              type: string
                              description: "Maximum drawdown for the timeframe."
                            past_value:
                              type: string
                              description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"WuRnay0CF3P1oPRSdogj5","product_id":"1bRPI9xQHhE23KpAXViKW","user_id":"user_1","type":"stock","private":false,"name":"Test strategy","description":"test","categories":["other"],"updated_at":"2024-10-22T20:45:13.848Z","created_at":"2024-10-22T20:44:42.391Z","price":0,"subscriber_count":"0","timeframes":[{"timeframe":"day","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"week","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"month","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"year","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"five_year","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"}]}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateStrategyPrice:
    post:
      operationId: updateStrategyPrice
      summary: updateStrategyPrice
      description: Update existing strategy price.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - price
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                price:
                  type: number
                  description: Monthly subscription price.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      type:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                        description: "Type or category for this object."
                      private:
                        type: boolean
                        description: "Whether the strategy is private."
                      name:
                        type: string
                        description: "Display name."
                      description:
                        type: string
                        description: "Human-readable description."
                      categories:
                        type: array
                        description: "Strategy category labels."
                        items:
                          type: string
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      price:
                        type: integer
                        description: "Price or execution price, depending on context."
                      subscriber_count:
                        type: string
                        description: "Number of subscribers."
                      timeframes:
                        type: array
                        description: "Per-timeframe ranking and historical value data."
                        items:
                          type: object
                          properties:
                            timeframe:
                              $ref: '#/components/schemas/timeframe'
                            rank_performance:
                              type: [integer, "null"]
                              description: "Performance rank for the timeframe."
                            rank_popular:
                              type: [integer, "null"]
                              description: "Popularity rank for the timeframe."
                            rank_trending:
                              type: [integer, "null"]
                              description: "Trending rank for the timeframe."
                            rank_top:
                              type: [integer, "null"]
                              description: "Overall top rank for the timeframe."
                            max_drawdown:
                              type: string
                              description: "Maximum drawdown for the timeframe."
                            past_value:
                              type: string
                              description: "Strategy value at the start of the timeframe."
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"WuRnay0CF3P1oPRSdogj5","product_id":"1bRPI9xQHhE23KpAXViKW","user_id":"user_1","type":"stock","private":false,"name":"Test strategy","description":"test","categories":["other"],"updated_at":"2024-10-22T20:45:49.100Z","created_at":"2024-10-22T20:44:42.391Z","price":1500,"subscriber_count":"0","timeframes":[{"timeframe":"day","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"week","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"month","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"year","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"},{"timeframe":"five_year","rank_performance":null,"rank_popular":null,"rank_trending":null,"rank_top":null,"max_drawdown":"0.000000000000000","past_value":"1.000000000000000"}]}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /deleteStrategy:
    post:
      operationId: deleteStrategy
      summary: deleteStrategy
      description: Delete strategy.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Strategies
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Strategy deleted."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: SUBSCRIPTIONS
  /getStrategySubscriptions:
    get:
      operationId: getStrategySubscriptions
      summary: getStrategySubscriptions
      description: Get strategy subscriptions.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: strategy_id[]
          in: query
          schema:
            type: array
            description: Array of strategy IDs. Leave empty to get all user subscriptions.
            maxItems: 100
            items:
              $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        strategy_owner:
                          type: string
                          description: "User ID of the strategy owner."
                        type:
                          type: string
                          enum: [ 'stock', 'cryptocurrency' ]
                          description: "Type or category for this object."
                        private:
                          type: boolean
                          description: "Whether the strategy is private."
                        strategy_value:
                          type: string
                          description: "Normalized strategy value. Convert before displaying user-facing USD values."
                        invoice_id:
                          $ref: '#/components/schemas/nullable_invoice_id'
                        end_date:
                          $ref: '#/components/schemas/nullable_end_date'
                        subscription_id:
                          type: string
                          description: "Strategy subscription identifier."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        input_value:
                          type: string
                          description: "User-provided starting value for relative strategy calculations."
                        input_date:
                          $ref: '#/components/schemas/input_date'
                        input_multiplier:
                          type: string
                          description: "Multiplier for converting normalized strategy units to user-facing USD values."
                        notifications:
                          type: array
                          description: "Enabled notification types."
                          items:
                            type: string
                            enum: [ 'trade', 'post', 'stock_event' ]
                        renew:
                          type: boolean
                          description: "Whether the subscription renews."
                        status:
                          type: string
                          enum: [ 'pending', 'active', 'deleted' ]
                          description: "Current status."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"strategy_id":"o2woZvX7SijbOaTiA2Zqf","strategy_owner":"user_1","type":"cryptocurrency","private":false,"strategy_value":"1.000000000000000","invoice_id":null,"end_date":null,"subscription_id":"HmVbkJVyD71MwQfLa3v8y","user_id":"user_1","product_id":"kfzEMLnwiR5u6LEgkLGkA","input_value":"100000.000000000000000","input_date":"2024-10-11T18:22:41.090Z","input_multiplier":"100000.000000000000000","notifications":[],"renew":true,"status":"active","updated_at":"2024-10-14T17:05:16.431Z","created_at":"2024-10-11T18:22:41.090Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newStrategySubscription:
    post:
      operationId: newStrategySubscription
      summary: newStrategySubscription
      description: New strategy subscription.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      strategy_owner:
                        type: string
                        description: "User ID of the strategy owner."
                      type:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                        description: "Type or category for this object."
                      private:
                        type: boolean
                        description: "Whether the strategy is private."
                      strategy_value:
                        type: [string, "null"]
                        description: "Normalized strategy value. Convert before displaying user-facing USD values."
                      invoice_id:
                        $ref: '#/components/schemas/nullable_invoice_id'
                      end_date:
                        $ref: '#/components/schemas/nullable_end_date'
                      subscription_id:
                        type: string
                        description: "Strategy subscription identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      input_value:
                        type: [string, "null"]
                        description: "User-provided starting value for relative strategy calculations."
                      input_date:
                        $ref: '#/components/schemas/nullable_input_date'
                      input_multiplier:
                        type: [string, "null"]
                        description: "Multiplier for converting normalized strategy units to user-facing USD values."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'trade', 'post', 'stock_event' ]
                      renew:
                        type: boolean
                        description: "Whether the subscription renews."
                      status:
                        type: string
                        enum: [ 'pending', 'active', 'deleted' ]
                        description: "Current status."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"YbKCgktxu0ugmQ1QKCfA3","strategy_owner":"user_2","type":"cryptocurrency","private":false,"strategy_value":null,"invoice_id":null,"end_date":null,"subscription_id":"420FVMWUaUTJPoHGj9vA3","user_id":"user_1","product_id":"v2GpKx_DDAJva_Josn0bx","input_value":null,"input_date":null,"input_multiplier":null,"notifications":[],"renew":true,"status":"active","updated_at":"2024-10-22T20:46:49.855Z","created_at":"2024-10-22T20:46:49.855Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /deleteStrategySubscription:
    post:
      operationId: deleteStrategySubscription
      summary: deleteStrategySubscription
      description: Unsubscribe from strategy.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Subscription deleted."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateStrategySubscriptionNotifications:
    post:
      operationId: updateStrategySubscriptionNotifications
      summary: updateStrategySubscriptionNotifications
      description: Set which notifications to receive from a strategy.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - notifications
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                notifications:
                  type: array
                  description: Which notification types to receive.
                  items:
                    type: string
                    enum: [ 'trade', 'post', 'stock_event' ]
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      strategy_owner:
                        type: string
                        description: "User ID of the strategy owner."
                      type:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                        description: "Type or category for this object."
                      private:
                        type: boolean
                        description: "Whether the strategy is private."
                      strategy_value:
                        type: string
                        description: "Normalized strategy value. Convert before displaying user-facing USD values."
                      invoice_id:
                        $ref: '#/components/schemas/nullable_invoice_id'
                      end_date:
                        $ref: '#/components/schemas/nullable_end_date'
                      subscription_id:
                        type: string
                        description: "Strategy subscription identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      input_value:
                        type: string
                        description: "User-provided starting value for relative strategy calculations."
                      input_date:
                        $ref: '#/components/schemas/input_date'
                      input_multiplier:
                        type: string
                        description: "Multiplier for converting normalized strategy units to user-facing USD values."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'trade', 'post', 'stock_event' ]
                      renew:
                        type: boolean
                        description: "Whether the subscription renews."
                      status:
                        type: string
                        enum: [ 'pending', 'active', 'deleted' ]
                        description: "Current status."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"WuRnay0CF3P1oPRSdogj5","strategy_owner":"user_1","type":"cryptocurrency","private":false,"strategy_value":"1.000000000000000","invoice_id":null,"end_date":null,"subscription_id":"jdfrmobP81IkbIZybXijj","user_id":"user_1","product_id":"1bRPI9xQHhE23KpAXViKW","input_value":"100000.000000000000000","input_date":"2024-10-22T20:44:42.391Z","input_multiplier":"100000.000000000000000","notifications":["trade","post","stock_event"],"renew":true,"status":"active","updated_at":"2024-10-23T14:44:03.221Z","created_at":"2024-10-22T20:44:42.391Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getStrategyCalculation:
    get:
      operationId: getStrategyCalculation
      summary: getStrategyCalculation
      description: Get relative strategy calculations.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/strategy_id'
        - name: input_value
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/input_value'
        - name: input_date
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/input_date'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      input_value:
                        type: string
                        description: "User-provided starting value for relative strategy calculations."
                      input_date:
                        $ref: '#/components/schemas/input_date'
                      input_multiplier:
                        type: string
                        description: "Multiplier for converting normalized strategy units to user-facing USD values."
                      strategy_value:
                        type: string
                        description: "Normalized strategy value. Convert before displaying user-facing USD values."
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"WuRnay0CF3P1oPRSdogj5","input_value":"1000","input_date":"2024-10-22T20:00:00.000Z","input_multiplier":"791.8845673752002230152021846231710643022824143395101219420357492","strategy_value":"1.262810315036981"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateStrategyCalculation:
    post:
      operationId: updateStrategyCalculation
      summary: updateStrategyCalculation
      description: Update relative strategy calculations.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - input_value
                - input_date
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                input_value:
                  $ref: '#/components/schemas/input_value'
                input_date:
                  $ref: '#/components/schemas/input_date'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      strategy_owner:
                        type: string
                        description: "User ID of the strategy owner."
                      type:
                        type: string
                        enum: [ 'stock', 'cryptocurrency' ]
                        description: "Type or category for this object."
                      private:
                        type: boolean
                        description: "Whether the strategy is private."
                      strategy_value:
                        type: string
                        description: "Normalized strategy value. Convert before displaying user-facing USD values."
                      invoice_id:
                        $ref: '#/components/schemas/nullable_invoice_id'
                      end_date:
                        $ref: '#/components/schemas/nullable_end_date'
                      subscription_id:
                        type: string
                        description: "Strategy subscription identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      input_value:
                        type: string
                        description: "User-provided starting value for relative strategy calculations."
                      input_date:
                        $ref: '#/components/schemas/input_date'
                      input_multiplier:
                        type: string
                        description: "Multiplier for converting normalized strategy units to user-facing USD values."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'trade', 'post', 'stock_event' ]
                      renew:
                        type: boolean
                        description: "Whether the subscription renews."
                      status:
                        type: string
                        enum: [ 'pending', 'active', 'deleted' ]
                        description: "Current status."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"WuRnay0CF3P1oPRSdogj5","strategy_owner":"user_1","type":"cryptocurrency","private":false,"strategy_value":"1.262810315036981","invoice_id":null,"end_date":null,"subscription_id":"AHjZ3_-QwEyO--eLt-P6r","user_id":"user_2","product_id":"1bRPI9xQHhE23KpAXViKW","input_value":"1000.000000000000000","input_date":"2024-10-22T20:00:00.000Z","input_multiplier":"791.884567375200223","notifications":[],"renew":true,"status":"active","updated_at":"2024-10-22T20:50:54.838Z","created_at":"2024-09-18T13:33:59.750Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /deleteStrategyCalculation:
    post:
      operationId: deleteStrategyCalculation
      summary: deleteStrategyCalculation
      description: Delete relative strategy calculation.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Calculation deleted."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getAccountTiers:
    get:
      operationId: getAccountTiers
      summary: getAccountTiers
      description: Get all account subscription tiers.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        type:
                          type: string
                          description: "Type or category for this object."
                        timeframe:
                          $ref: '#/components/schemas/timeframe'
                        level:
                          type: integer
                          description: "Subscription tier level."
                        name:
                          type: string
                          description: "Display name."
                        apiTokenExpire:
                          type: integer
                          description: "API token expiration period in milliseconds."
                        limits:
                          type: object
                          description: "Account or tier operational limits."
                          properties:
                            new_order:
                              type: integer
                              description: "Maximum successful `/newOrder` requests per day per strategy."
                            max_strategies:
                              type: integer
                              description: "Maximum number of strategies the account can create."
                            max_subscriptions:
                              type: integer
                              description: "Maximum number of strategy subscriptions."
                            max_bots:
                              type: integer
                              description: "Maximum number of bots."
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
              examples:
                '200':
                  value: {"success":true,"response":[{"product_id":"7wswTAd1xbDAEQkPhbBn6","type":"standard","timeframe":"month","level":0,"name":"Standard Account Subscription","apiTokenExpire":31536000000,"limits":{"new_order":50,"max_strategies":5,"max_subscriptions":10,"max_bots":0},"price":0},{"product_id":"qkV9qPfpxr4wWMaZKprdI","type":"pro","timeframe":"month","level":1,"name":"Pro Account Monthly Subscription","apiTokenExpire":31536000000,"limits":{"new_order":500,"max_strategies":50,"max_subscriptions":100,"max_bots":2},"price":5000},{"product_id":"tlEuVShrHFFJtceRjEYxm","type":"pro","timeframe":"year","level":2,"name":"Pro Account Yearly Subscription","apiTokenExpire":31536000000,"limits":{"new_order":500,"max_strategies":50,"max_subscriptions":100,"max_bots":2},"price":52800},{"product_id":"x70U0yrF8y1FcalgGutQe","type":"premium","timeframe":"month","level":3,"name":"Premium Account Monthly Subscription","apiTokenExpire":31536000000,"limits":{"new_order":5000,"max_strategies":500,"max_subscriptions":1000,"max_bots":4},"price":10000},{"product_id":"7fhHPXozPsaIVnXLeuTrD","type":"premium","timeframe":"year","level":4,"name":"Premium Account Yearly Subscription","apiTokenExpire":31536000000,"limits":{"new_order":5000,"max_strategies":500,"max_subscriptions":1000,"max_bots":4},"price":105600}]}
        '400':
          $ref: '#/components/responses/400'
  /getAccountSubscription:
    get:
      operationId: getAccountSubscription
      summary: getAccountSubscription
      description: Get account subscription.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      account_subscription_id:
                        type: string
                        description: "Account subscription identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      status:
                        type: string
                        enum: [ 'pending', 'active' ]
                        description: "Current status."
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      type:
                        type: string
                        description: "Type or category for this object."
                      timeframe:
                        $ref: '#/components/schemas/billing_timeframe'
                      level:
                        type: integer
                        description: "Subscription tier level."
                      name:
                        type: string
                        description: "Display name."
                      next_product_id:
                        type: string
                        description: "Next billing product identifier after a pending change."
                      next_type:
                        type: string
                        description: "Next account subscription type after a pending change."
                      next_timeframe:
                        $ref: '#/components/schemas/billing_timeframe'
                      next_level:
                        type: integer
                        description: "Next subscription tier level after a pending change."
                      next_name:
                        type: string
                        description: "Next account subscription display name after a pending change."
                      invoice_id:
                        $ref: '#/components/schemas/nullable_invoice_id'
                      limits:
                        type: object
                        description: "Account or tier operational limits."
                        properties:
                          new_order:
                            type: integer
                            description: "Maximum successful `/newOrder` requests per day per strategy."
                          new_post:
                            type: integer
                            description: "Maximum successful `/newPost` requests per day per strategy."
                          like:
                            type: integer
                            description: "Maximum successful `/like` requests per day."
                          max_sessions:
                            type: integer
                            description: "Maximum number of active sessions."
                          max_api_tokens:
                            type: integer
                            description: "Maximum number of API tokens."
                          max_strategies:
                            type: integer
                            description: "Maximum number of strategies the account can create."
                          max_subscriptions:
                            type: integer
                            description: "Maximum number of strategy subscriptions."
                          max_open_orders:
                            type: integer
                            description: "Maximum number of open orders per strategy."
                          max_bots:
                            type: integer
                            description: "Maximum number of bots."
                      end_date:
                        $ref: '#/components/schemas/nullable_end_date'
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"account_subscription_id":"oPajv9WU3wtwtBYLQxm4z","user_id":"user_1","status":"active","product_id":"7wswTAd1xbDAEQkPhbBn6","type":"standard","timeframe":"month","level":0,"name":"Standard Account Subscription","next_product_id":"7wswTAd1xbDAEQkPhbBn6","next_type":"standard","next_timeframe":"month","next_level":0,"next_name":"Standard Account Subscription","invoice_id":null,"limits":{"new_order":50,"new_post":100,"like":100,"max_sessions":100,"max_api_tokens":50,"max_strategies":5,"max_subscriptions":10,"max_open_orders":100,"max_bots":0},"end_date":null,"updated_at":"2024-10-08T16:30:00.062Z","created_at":"2024-08-30T13:40:27.343Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateAccountSubscription:
    post:
      operationId: updateAccountSubscription
      summary: updateAccountSubscription
      description: Update account subscription.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Subscriptions
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - timeframe
              properties:
                type:
                  type: string
                  description: Account subscription tier.
                  enum: ['standard', 'pro', 'premium']
                timeframe:
                  type: string
                  description: Account subscription timeframe.
                  enum: ['month', 'year']
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      account_subscription_id:
                        type: string
                        description: "Account subscription identifier."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      status:
                        type: string
                        enum: [ 'pending', 'active' ]
                        description: "Current status."
                      product_id:
                        type: string
                        description: "Billing product identifier."
                      type:
                        type: string
                        description: "Type or category for this object."
                      timeframe:
                        $ref: '#/components/schemas/billing_timeframe'
                      level:
                        type: integer
                        description: "Subscription tier level."
                      name:
                        type: string
                        description: "Display name."
                      next_product_id:
                        type: string
                        description: "Next billing product identifier after a pending change."
                      next_type:
                        type: string
                        description: "Next account subscription type after a pending change."
                      next_timeframe:
                        $ref: '#/components/schemas/billing_timeframe'
                      next_level:
                        type: integer
                        description: "Next subscription tier level after a pending change."
                      next_name:
                        type: string
                        description: "Next account subscription display name after a pending change."
                      invoice_id:
                        $ref: '#/components/schemas/invoice_id'
                      limits:
                        type: object
                        description: "Account or tier operational limits."
                        properties:
                          new_order:
                            type: integer
                            description: "Maximum successful `/newOrder` requests per day per strategy."
                          new_post:
                            type: integer
                            description: "Maximum successful `/newPost` requests per day per strategy."
                          like:
                            type: integer
                            description: "Maximum successful `/like` requests per day."
                          max_sessions:
                            type: integer
                            description: "Maximum number of active sessions."
                          max_api_tokens:
                            type: integer
                            description: "Maximum number of API tokens."
                          max_strategies:
                            type: integer
                            description: "Maximum number of strategies the account can create."
                          max_subscriptions:
                            type: integer
                            description: "Maximum number of strategy subscriptions."
                          max_open_orders:
                            type: integer
                            description: "Maximum number of open orders per strategy."
                          max_bots:
                            type: integer
                            description: "Maximum number of bots."
                      end_date:
                        $ref: '#/components/schemas/nullable_end_date'
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"account_subscription_id":"oPajv9WU3wtwtBYLQxm4z","user_id":"user_1","status":"pending","product_id":"7wswTAd1xbDAEQkPhbBn6","type":"standard","timeframe":"month","level":0,"name":"Standard Account Subscription","next_product_id":"qkV9qPfpxr4wWMaZKprdI","next_type":"pro","next_timeframe":"month","next_level":1,"next_name":"Pro Account Monthly Subscription","invoice_id":"NJ9Fo2OSoM5MRy5ithwnw","limits":{"new_order":50,"new_post":100,"like":100,"max_sessions":100,"max_api_tokens":50,"max_strategies":5,"max_subscriptions":10,"max_open_orders":100,"max_bots":0},"end_date":null,"updated_at":"2024-10-08T16:30:00.062Z","created_at":"2024-08-30T13:40:27.343Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: PAYMENTS
  /getPaymentSources:
    get:
      operationId: getPaymentSources
      summary: getPaymentSources
      description: Get payment sources.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        source_id:
                          $ref: '#/components/schemas/source_id'
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        type:
                          type: string
                          enum: [ 'card' ]
                          description: "Type or category for this object."
                        direction:
                          type: string
                          enum: [ 'in', 'out' ]
                          description: "Direction."
                        primary:
                          type: boolean
                          description: "Primary."
                        description:
                          type: string
                          description: "Human-readable description."
                        name:
                          type: string
                          description: "Display name."
                        city:
                          type: string
                          description: "City."
                        country:
                          type: string
                          description: "Country."
                        line_one:
                          type: string
                          description: "Line one."
                        line_two:
                          type: string
                          description: "Line two."
                        district:
                          type: string
                          description: "District."
                        postal:
                          type: string
                          description: "Postal."
                        status:
                          type: string
                          enum: [ 'pending', 'active', 'deleted' ]
                          description: "Current status."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"source_id":"ta-fz_Z_fkHau1d5k3HUR","user_id":"user_1","type":"card","direction":"in","primary":true,"description":"Card (VISA ....4242)","name":"fds fds","city":"fds","country":"US","line_one":"fds","line_two":"fds","district":"fd","postal":"33132","status":"active","updated_at":"2024-10-21T17:51:08.576Z","created_at":"2024-08-30T13:41:24.478Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getUpcomingInvoice:
    get:
      operationId: getUpcomingInvoice
      summary: getUpcomingInvoice
      description: Get upcoming invoice.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      invoice_id:
                        $ref: '#/components/schemas/nullable_invoice_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      description:
                        type: string
                        description: "Human-readable description."
                      status:
                        type: string
                        enum: [ 'pending', 'paid', 'failed', 'chargeback' ]
                        description: "Current status."
                      updated_at:
                        type: [string, "null"]
                        format: date-time
                        description: "Last update timestamp."
                      created_at:
                        type: [string, "null"]
                        format: date-time
                        description: "Creation timestamp."
                      amount:
                        type: string
                        description: "Amount."
                      amount_refunded:
                        type: string
                        description: "Amount refunded."
                      source:
                        type: object
                        description: "Source."
                        properties:
                          source_id:
                            $ref: '#/components/schemas/source_id'
                          user_id:
                            $ref: '#/components/schemas/user_id'
                          type:
                            type: string
                            enum: [ 'card' ]
                            description: "Type or category for this object."
                          direction:
                            type: string
                            enum: [ 'in', 'out' ]
                            description: "Direction."
                          primary:
                            type: boolean
                            description: "Primary."
                          description:
                            type: string
                            description: "Human-readable description."
                          name:
                            type: string
                            description: "Display name."
                          city:
                            type: string
                            description: "City."
                          country:
                            type: string
                            description: "Country."
                          line_one:
                            type: string
                            description: "Line one."
                          line_two:
                            type: string
                            description: "Line two."
                          district:
                            type: string
                            description: "District."
                          postal:
                            type: string
                            description: "Postal."
                          status:
                            type: string
                            enum: [ 'pending', 'active', 'deleted' ]
                            description: "Current status."
                          updated_at:
                            $ref: '#/components/schemas/updated_at'
                          created_at:
                            $ref: '#/components/schemas/created_at'
                      retryable:
                        type: boolean
                        description: "Retryable."
              examples:
                '200':
                  value: {"success":true,"response":{"invoice_id":null,"user_id":"user_2","description":"October - November 2024 Invoices","status":"pending","updated_at":null,"created_at":null,"amount":"10000","amount_refunded":"0","source":{"source_id":"7mb8VEEjb4zCzbU4U-l1Z","user_id":"user_2","type":"card","direction":"in","primary":true,"description":"Card (VISA ....4242)","name":"John Doe","city":"New York","country":"US","line_one":"123 Sesame St","line_two":"","district":"NY","postal":"10001","status":"active","updated_at":"2024-10-22T14:18:35.209Z","created_at":"2024-06-10T14:57:33.313Z"},"retryable":false}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getInvoices:
    get:
      operationId: getInvoices
      summary: getInvoices
      description: Get invoices.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: invoice_id[]
          in: query
          schema:
            type: array
            description: Array of invoice IDs. Leave empty to get all invoices.
            maxItems: 100
            items:
              $ref: '#/components/schemas/invoice_id'
        - name: source_id
          in: query
          schema:
            $ref: '#/components/schemas/source_id'
        - name: status
          in: query
          schema:
            type: string
            description: Invoice status.
            enum: [ 'pending', 'paid', 'failed', 'chargeback' ]
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
            default: 10
        - name: offset_id
          in: query
          schema:
            $ref: '#/components/schemas/offset_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        invoice_id:
                          $ref: '#/components/schemas/invoice_id'
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        description:
                          type: string
                          description: "Human-readable description."
                        status:
                          type: string
                          enum: [ 'pending', 'paid', 'failed', 'chargeback' ]
                          description: "Current status."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        amount:
                          type: string
                          description: "Amount."
                        amount_refunded:
                          type: string
                          description: "Amount refunded."
                        source:
                          type: object
                          description: "Source."
                          properties:
                            source_id:
                              $ref: '#/components/schemas/source_id'
                            user_id:
                              $ref: '#/components/schemas/user_id'
                            type:
                              type: string
                              enum: [ 'card' ]
                              description: "Type or category for this object."
                            direction:
                              type: string
                              enum: [ 'in', 'out' ]
                              description: "Direction."
                            primary:
                              type: boolean
                              description: "Primary."
                            description:
                              type: string
                              description: "Human-readable description."
                            name:
                              type: string
                              description: "Display name."
                            city:
                              type: string
                              description: "City."
                            country:
                              type: string
                              description: "Country."
                            line_one:
                              type: string
                              description: "Line one."
                            line_two:
                              type: string
                              description: "Line two."
                            district:
                              type: string
                              description: "District."
                            postal:
                              type: string
                              description: "Postal."
                            status:
                              type: string
                              enum: [ 'pending', 'active', 'deleted' ]
                              description: "Current status."
                            updated_at:
                              $ref: '#/components/schemas/updated_at'
                            created_at:
                              $ref: '#/components/schemas/created_at'
                        retryable:
                          type: boolean
                          description: "Retryable."
              examples:
                '200':
                  value: {"success":true,"response":[{"invoice_id":"NJ9Fo2OSoM5MRy5ithwnw","user_id":"user_1","description":"Pro Account Monthly Subscription","status":"paid","updated_at":"2024-10-22T20:59:25.765Z","created_at":"2024-10-22T20:59:22.304Z","amount":"5000","amount_refunded":"0","source":{"source_id":"ta-fz_Z_fkHau1d5k3HUR","user_id":"user_1","type":"card","direction":"in","primary":true,"description":"Card (VISA ....4242)","name":"fds fds","city":"fds","country":"US","line_one":"fds","line_two":"fds","district":"fd","postal":"33132","status":"active","updated_at":"2024-10-21T17:51:08.576296+00:00","created_at":"2024-08-30T13:41:24.478454+00:00"},"retryable":false}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getInvoicePdf:
    get:
      operationId: getInvoicePdf
      summary: getInvoicePdf
      description: Get invoice PDF.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: invoice_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/invoice_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: "Invoice PDF file payload."
              examples:
                '200':
                  value: "<< PDF FILE >>"
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /retryInvoice:
    post:
      operationId: retryInvoice
      summary: retryInvoice
      description: Retry failed invoice.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - invoice_id
              properties:
                invoice_id:
                  $ref: '#/components/schemas/invoice_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        invoice_id:
                          $ref: '#/components/schemas/invoice_id'
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        description:
                          type: string
                          description: "Human-readable description."
                        status:
                          type: string
                          enum: [ 'pending', 'paid', 'failed', 'chargeback' ]
                          description: "Current status."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        amount:
                          type: string
                          description: "Amount."
                        amount_refunded:
                          type: string
                          description: "Amount refunded."
                        source:
                          type: object
                          description: "Source."
                          properties:
                            source_id:
                              $ref: '#/components/schemas/source_id'
                            user_id:
                              $ref: '#/components/schemas/user_id'
                            type:
                              type: string
                              enum: [ 'card' ]
                              description: "Type or category for this object."
                            direction:
                              type: string
                              enum: [ 'in', 'out' ]
                              description: "Direction."
                            primary:
                              type: boolean
                              description: "Primary."
                            description:
                              type: string
                              description: "Human-readable description."
                            name:
                              type: string
                              description: "Display name."
                            city:
                              type: string
                              description: "City."
                            country:
                              type: string
                              description: "Country."
                            line_one:
                              type: string
                              description: "Line one."
                            line_two:
                              type: string
                              description: "Line two."
                            district:
                              type: string
                              description: "District."
                            postal:
                              type: string
                              description: "Postal."
                            status:
                              type: string
                              enum: [ 'pending', 'active', 'deleted' ]
                              description: "Current status."
                            updated_at:
                              $ref: '#/components/schemas/updated_at'
                            created_at:
                              $ref: '#/components/schemas/created_at'
                        retryable:
                          type: boolean
                          description: "Retryable."
              examples:
                '200':
                  value: {"success":true,"response":[{"invoice_id":"NJ9Fo2OSoM5MRy5ithwnw","user_id":"user_1","description":"Pro Account Monthly Subscription","status":"paid","updated_at":"2024-10-22T20:59:25.765Z","created_at":"2024-10-22T20:59:22.304Z","amount":"5000","amount_refunded":"0","source":{"source_id":"ta-fz_Z_fkHau1d5k3HUR","user_id":"user_1","type":"card","direction":"in","primary":true,"description":"Card (VISA ....4242)","name":"fds fds","city":"fds","country":"US","line_one":"fds","line_two":"fds","district":"fd","postal":"33132","status":"active","updated_at":"2024-10-21T17:51:08.576296+00:00","created_at":"2024-08-30T13:41:24.478454+00:00"},"retryable":false}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getUpcomingInvoiceItems:
    get:
      operationId: getUpcomingInvoiceItems
      summary: getUpcomingInvoiceItems
      description: Get upcoming invoice items.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        item_id:
                          type: [string, "null"]
                          description: "Item id."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        invoice_id:
                          $ref: '#/components/schemas/nullable_invoice_id'
                        amount:
                          type: integer
                          description: "Amount."
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
                        start_date:
                          $ref: '#/components/schemas/start_date'
                        end_date:
                          $ref: '#/components/schemas/end_date'
                        updated_at:
                          type: [string, "null"]
                          format: date-time
                          description: "Last update timestamp."
                        created_at:
                          type: [string, "null"]
                          format: date-time
                          description: "Creation timestamp."
                        amount_refunded:
                          type: string
                          description: "Amount refunded."
                        name:
                          type: string
                          description: "Display name."
                        type:
                          type: string
                          enum: [ 'strategy', 'account' ]
                          description: "Type or category for this object."
              examples:
                '200':
                  value: {"success":true,"response":[{"item_id":null,"user_id":"user_2","product_id":"x70U0yrF8y1FcalgGutQe","invoice_id":null,"amount":10000,"price":10000,"start_date":"2024-11-01T00:00:00.000Z","end_date":"2024-12-01T00:00:00.000Z","updated_at":null,"created_at":null,"amount_refunded":"0","name":"Premium Account Monthly Subscription","type":"account"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getInvoiceItems:
    get:
      operationId: getInvoiceItems
      summary: getInvoiceItems
      description: Get invoice items.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Payments
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: invoice_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/invoice_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        item_id:
                          type: string
                          description: "Item id."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        product_id:
                          type: string
                          description: "Billing product identifier."
                        invoice_id:
                          $ref: '#/components/schemas/invoice_id'
                        amount:
                          type: string
                          description: "Amount."
                        price:
                          type: integer
                          description: "Price or execution price, depending on context."
                        start_date:
                          $ref: '#/components/schemas/start_date'
                        end_date:
                          $ref: '#/components/schemas/end_date'
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        amount_refunded:
                          type: string
                          description: "Amount refunded."
                        name:
                          type: string
                          description: "Display name."
                        type:
                          type: string
                          enum: [ 'strategy', 'account' ]
                          description: "Type or category for this object."
                        type_id:
                          type: [string, "null"]
                          description: "Type id."
              examples:
                '200':
                  value: {"success":true,"response":[{"item_id":"CIgS_MNX2BjggL2QIEJkb","user_id":"user_1","product_id":"qkV9qPfpxr4wWMaZKprdI","invoice_id":"NJ9Fo2OSoM5MRy5ithwnw","amount":"5000","price":5000,"start_date":"2024-10-22T20:59:22.304Z","end_date":"2024-11-22T20:59:22.309Z","updated_at":"2024-10-22T20:59:22.304Z","created_at":"2024-10-22T20:59:22.304Z","amount_refunded":"0","name":"Pro Account Monthly Subscription","type":"account","type_id":null}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: WITHDRAWALS
  /getUserBalance:
    get:
      operationId: getUserBalance
      summary: getUserBalance
      description: Get user balance.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Withdrawals
      parameters:
        - $ref: '#/components/parameters/api_token'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      balance:
                        type: string
                        description: "Available balance data."
                      amount_on_hold:
                        type: string
                        description: "Amount on hold."
                      amount_available:
                        type: string
                        description: "Amount available."
              examples:
                '200':
                  value: {"success":true,"response":{"balance":"1400","amount_on_hold":"0","amount_available":"1400"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getPayouts:
    get:
      operationId: getPayouts
      summary: getPayouts
      description: Get payouts.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Withdrawals
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
            default: 10
        - name: offset_id
          in: query
          schema:
            $ref: '#/components/schemas/offset_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        payout_id:
                          type: string
                          description: "Payout identifier."
                        provider:
                          type: string
                          enum: [ 'stripe', 'circle' ]
                          description: "External provider or data provider."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        type:
                          type: string
                          enum: [ 'eth', 'matic', 'bank', 'card' ]
                          description: "Type or category for this object."
                        amount:
                          type: string
                          description: "Amount."
                        fee:
                          type: string
                          description: "Fee value."
                        destination:
                          type: object
                          description: "Payout destination details."
                        status:
                          type: string
                          enum: [ 'pending', 'paid', 'failed' ]
                          description: "Current status."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"payout_id":"AdcY6qDIBCdnxPCDF1aE4","provider":"stripe","user_id":"user_1","type":"bank","amount":"972","fee":"28","destination":{"address":"6789"},"status":"paid","updated_at":"2024-02-05T15:59:39.906Z","created_at":"2024-02-05T15:59:36.765Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newPayout:
    post:
      operationId: newPayout
      summary: newPayout
      description: New payout.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Withdrawals
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
              properties:
                amount:
                  type: number
                  format: int
                  description: Amount to withdraw in cents. [See minimum amount](#section/Limits)
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      payout_id:
                        type: string
                        description: "Payout identifier."
                      provider:
                        type: string
                        enum: [ 'stripe', 'circle' ]
                        description: "External provider or data provider."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      type:
                        type: string
                        enum: [ 'eth', 'matic', 'bank', 'card' ]
                        description: "Type or category for this object."
                      amount:
                        type: string
                        description: "Amount."
                      fee:
                        type: string
                        description: "Fee value."
                      destination:
                        type: object
                        description: "Payout destination details."
                      status:
                        type: string
                        enum: [ 'pending', 'paid', 'failed' ]
                        description: "Current status."
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"payout_id":"JbHHi_5IK4bQvVcVDmXBa","provider":"stripe","user_id":"user_1","type":"bank","amount":"972","fee":"28","destination":{"address":"6789"},"status":"pending","updated_at":"2024-02-05T16:20:42.088Z","created_at":"2024-02-05T16:20:42.088Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getPayoutFees:
    get:
      operationId: getPayoutFees
      summary: getPayoutFees
      description: Get withdrawal payout fees.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Withdrawals
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: amount
          in: query
          required: true
          schema:
            type: number
            format: int
            description: Amount to withdraw in cents.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"250"}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getIncome:
    get:
      operationId: getIncome
      summary: getIncome
      description: Get income.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Withdrawals
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: interval
          in: query
          required: true
          schema:
            type: string
            description: Graph data intervals.
            enum: ['year', 'month', 'week', 'day']
        - name: start_date
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        referrer:
                          type: string
                          description: "Referrer."
                        strategy_owner:
                          type: string
                          description: "User ID of the strategy owner."
                        promotion:
                          type: string
                          description: "Promotion."
              examples:
                '200':
                  value: {"success":true,"response":[{"created_at":"2024-02-01T00:00:00.000Z","referrer":"0","strategy_owner":"700","promotion":"10000"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getStripeAccountLink:
    get:
      operationId: getStripeAccountLink
      summary: getStripeAccountLink
      description: Get stripe account link for managing withdrawal details.
      x-mint:
        mcp:
          enabled: false
      tags:
        - Withdrawals
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: country
          in: query
          schema:
            type: string
            description: Country of residence in ISO 3166-1 alpha-2 format.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"https://connect.stripe.com/setup/c/acct_1Mt0CORHFI4mz9Rw/TqckGNUHg2mG"}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: TIMELINES
  /getTimelines:
    get:
      operationId: getTimelines
      summary: getTimelines
      description: Get timeline events.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: timeline_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of timeline IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/timeline_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        timeline_id:
                          $ref: '#/components/schemas/timeline_id'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        name:
                          type: string
                          description: "Display name."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        likes:
                          type: string
                          description: "Like count."
                        liked:
                          type: boolean
                          description: "Whether the authenticated user liked the event."
                        type:
                          type: string
                          description: "Type or category for this object."
                        data:
                          type: object
                          description: "Timeline event-specific payload."
                          properties:
                            history_id:
                              type: string
                              description: "Trade history identifier."
                            action:
                              type: string
                              description: "Order or signal action."
                            price:
                              type: string
                              description: "Price or execution price, depending on context."
                            amount:
                              type: string
                              description: "Amount."
                            fee_total:
                              type: string
                              description: "Total fee for a trade event."
                            total:
                              type: string
                              description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                            new_holdings:
                              type: string
                              description: "Holdings after the trade event."
                            strategy_value:
                              type: string
                              description: "Normalized strategy value. Convert before displaying user-facing USD values."
                            stock_id:
                              $ref: '#/components/schemas/stock_id'
                            figi_composite:
                              type: [string, "null"]
                              description: "Composite FIGI identifier when available."
                            symbol:
                              type: string
                              description: "Ticker or asset symbol."
                            name:
                              type: string
                              description: "Display name."
                            sector:
                              type: string
                              description: "Sector or asset category."
                            security:
                              type: string
                              enum: [ 'cryptocurrency', 'stock' ]
                              description: "Security type, such as stock or cryptocurrency."
                            exchange:
                              type: string
                              description: "Exchange code."
                            stock:
                              type: string
                              description: "Stock symbol as stored by AlphaInsider."
                            peg:
                              type: string
                              description: "Peg or quote currency."
                            provider:
                              type: string
                              enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                              description: "External provider or data provider."
                            slippage:
                              type: string
                              description: "Slippage value or configured slippage fraction."
                            fee:
                              type: string
                              description: "Fee value."
                            links:
                              type: object
                              description: "External research and market-data links."
                            stock_status:
                              type: string
                              enum: [ 'active', 'deleted' ]
                              description: "Current stock status."
              examples:
                '200':
                  value: {"success":true,"response":[{"timeline_id":"1312821","created_at":"2024-10-04T12:32:12.975Z","strategy_id":"idminF5SDHUyiPCDMkYOm","name":"Ethereum = Moon","user_id":"crypto_user","likes":"0","liked":false,"type":"trade","data":{"history_id":"TYx0M5NquN1nap_h1g93S","action":"buy","price":"2395.421280000000000","amount":"0.001043657756935","fee_total": "0.000000000000000","total":"2.500000000000000","new_holdings":"0.005722668735953","strategy_value":"11.184990058888979","stock_id":"v3lhjrwEhNuAOxPT29oxO","figi_composite":null,"symbol":"ETH-USD","name":"Ethereum","sector":"Cryptocurrencies","security":"cryptocurrency","exchange":"COINBASE","stock":"ETH-USD","peg":"USD","provider":"coinbase","slippage":"0.000000000000000","fee":"0.002500000000000","links":{"trading_view":"https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE","yahoo_finance":"https://finance.yahoo.com/quote/ETH-USD","coin_marketcap":"https://coinmarketcap.com/currencies/ethereum/","google_finance":"https://www.google.com/finance/quote/ETH-USD"},"stock_status":"active"}},{"timeline_id":"1293758","created_at":"2024-08-08T13:21:41.413Z","strategy_id":"idminF5SDHUyiPCDMkYOm","name":"Ethereum = Moon","user_id":"crypto_user","likes":"0","liked":false,"type":"post","data":{"post_id":"fHa1j_eSiI9IITrxKjJv8","description":"I may have missed the timing for when to get into Ethereum but I have strong conviction that we will be seeing new all-time highs by end of this year or the next. Ethereum just hit the 200 weekly moving average and this usually means a bottom for the asset.","url":"https://www.tradingview.com/x/vtnvSnWk/","content":{"site":"www.tradingview.com","type":"summary","image":"https://alphainsider-images.s3.us-east-2.amazonaws.com/1X99HjM6MNfEnK8KM69Fy","title":"BITFINEX:ETHUSD Chart Image by CryptoHitchhiker","description":""}}}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getStrategyTimelines:
    get:
      operationId: getStrategyTimelines
      summary: getStrategyTimelines
      description: Get strategy timeline events.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of strategy IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/strategy_id'
        - name: type[]
          in: query
          schema:
            type: array
            description: Array of timeline types to filter by.
            items:
              type: string
              enum: [ 'trade', 'post', 'dividend', 'split' ]
        - name: is_notification
          in: query
          schema:
            type: boolean
            description: If true, only show timelines you receive notifications from.
        - name: start_date
          in: query
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
            default: 10
        - name: offset_id
          in: query
          schema:
            $ref: '#/components/schemas/offset_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        timeline_id:
                          $ref: '#/components/schemas/timeline_id'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        name:
                          type: string
                          description: "Display name."
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        likes:
                          type: string
                          description: "Like count."
                        liked:
                          type: boolean
                          description: "Whether the authenticated user liked the event."
                        type:
                          type: string
                          description: "Type or category for this object."
                        data:
                          type: object
                          description: "Timeline event-specific payload."
                          properties:
                            history_id:
                              type: string
                              description: "Trade history identifier."
                            action:
                              type: string
                              description: "Order or signal action."
                            price:
                              type: string
                              description: "Price or execution price, depending on context."
                            amount:
                              type: string
                              description: "Amount."
                            fee_total:
                              type: string
                              description: "Total fee for a trade event."
                            total:
                              type: string
                              description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                            new_holdings:
                              type: string
                              description: "Holdings after the trade event."
                            strategy_value:
                              type: string
                              description: "Normalized strategy value. Convert before displaying user-facing USD values."
                            stock_id:
                              $ref: '#/components/schemas/stock_id'
                            figi_composite:
                              type: [string, "null"]
                              description: "Composite FIGI identifier when available."
                            symbol:
                              type: string
                              description: "Ticker or asset symbol."
                            name:
                              type: string
                              description: "Display name."
                            sector:
                              type: string
                              description: "Sector or asset category."
                            security:
                              type: string
                              enum: [ 'cryptocurrency', 'stock' ]
                              description: "Security type, such as stock or cryptocurrency."
                            exchange:
                              type: string
                              description: "Exchange code."
                            stock:
                              type: string
                              description: "Stock symbol as stored by AlphaInsider."
                            peg:
                              type: string
                              description: "Peg or quote currency."
                            provider:
                              type: string
                              enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                              description: "External provider or data provider."
                            slippage:
                              type: string
                              description: "Slippage value or configured slippage fraction."
                            fee:
                              type: string
                              description: "Fee value."
                            links:
                              type: object
                              description: "External research and market-data links."
                            stock_status:
                              type: string
                              enum: [ 'active', 'deleted' ]
                              description: "Current stock status."
              examples:
                '200':
                  value: {"success":true,"response":[{"timeline_id":"1312821","created_at":"2024-10-04T12:32:12.975Z","strategy_id":"idminF5SDHUyiPCDMkYOm","name":"Ethereum = Moon","user_id":"crypto_user","likes":"0","liked":false,"type":"trade","data":{"history_id":"TYx0M5NquN1nap_h1g93S","action":"buy","price":"2395.421280000000000","amount":"0.001043657756935","fee_total": "0.000000000000000","total":"2.500000000000000","new_holdings":"0.005722668735953","strategy_value":"11.184990058888979","stock_id":"v3lhjrwEhNuAOxPT29oxO","figi_composite":null,"symbol":"ETH-USD","name":"Ethereum","sector":"Cryptocurrencies","security":"cryptocurrency","exchange":"COINBASE","stock":"ETH-USD","peg":"USD","provider":"coinbase","slippage":"0.000000000000000","fee":"0.002500000000000","links":{"trading_view":"https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE","yahoo_finance":"https://finance.yahoo.com/quote/ETH-USD","coin_marketcap":"https://coinmarketcap.com/currencies/ethereum/","google_finance":"https://www.google.com/finance/quote/ETH-USD"},"stock_status":"active"}},{"timeline_id":"1293758","created_at":"2024-08-08T13:21:41.413Z","strategy_id":"idminF5SDHUyiPCDMkYOm","name":"Ethereum = Moon","user_id":"crypto_user","likes":"0","liked":false,"type":"post","data":{"post_id":"fHa1j_eSiI9IITrxKjJv8","description":"I may have missed the timing for when to get into Ethereum but I have strong conviction that we will be seeing new all-time highs by end of this year or the next. Ethereum just hit the 200 weekly moving average and this usually means a bottom for the asset.","url":"https://www.tradingview.com/x/vtnvSnWk/","content":{"site":"www.tradingview.com","type":"summary","image":"https://alphainsider-images.s3.us-east-2.amazonaws.com/1X99HjM6MNfEnK8KM69Fy","title":"BITFINEX:ETHUSD Chart Image by CryptoHitchhiker","description":""}}}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newPost:
    post:
      operationId: newPost
      summary: newPost
      description: Create a new timeline post.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                description:
                  type: string
                  description: Post description.
                url:
                  type: string
                  format: url
                  description: Post url.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      timeline_id:
                        $ref: '#/components/schemas/timeline_id'
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      name:
                        type: string
                        description: "Display name."
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      likes:
                        type: string
                        description: "Like count."
                      liked:
                        type: boolean
                        description: "Whether the authenticated user liked the event."
                      type:
                        type: string
                        description: "Type or category for this object."
                      data:
                        type: object
                        description: "Timeline event-specific payload."
                        properties:
                          post_id:
                            type: string
                            description: "Post identifier."
                          description:
                            type: string
                            description: "Human-readable description."
                          url:
                            type: string
                            description: "Related URL."
                          content:
                            type: object
                            description: "Preview metadata for a linked URL."
                            properties:
                              site:
                                type: string
                                description: "Website host for preview content."
                              type:
                                type: string
                                description: "Type or category for this object."
                              image:
                                type: string
                                description: "Preview image URL."
                              title:
                                type: string
                                description: "Preview title."
                              description:
                                type: string
                                description: "Human-readable description."
              examples:
                '200':
                  value: {"success":true,"response":{"timeline_id":"3","created_at":"2024-10-22T21:38:10.891Z","strategy_id":"WuRnay0CF3P1oPRSdogj5","name":"Test strategy","user_id":"user_1","likes":"0","liked":false,"type":"post","data":{"post_id":"min-8IC-fuFTxG-2npQfD","description":"Test","url":"https://www.coindesk.com/markets/2024/10/22/paul-tudor-jones-all-roads-lead-to-inflation-hes-long-bitcoin-and-gold/","content":{"site":"www.coindesk.com","type":"summary","image":"https://alphainsider-images.s3.us-east-2.amazonaws.com/67FTg2zhFXcxai20T_w44","title":"Paul Tudor Jones: 'All Roads Lead to Inflation;' He's Long Bitcoi...","description":"The U.S. government's debt and deficit issues aren't going anywhere no matter who wins the presidency next month, said Jones."}}}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /previewPost:
    post:
      operationId: previewPost
      summary: previewPost
      description: Preview a new timeline post.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                description:
                  type: string
                  description: Post description.
                url:
                  type: string
                  format: url
                  description: Post url.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      likes:
                        type: string
                        description: "Like count."
                      liked:
                        type: boolean
                        description: "Whether the authenticated user liked the event."
                      type:
                        type: string
                        description: "Type or category for this object."
                      data:
                        type: object
                        description: "Timeline event-specific payload."
                        properties:
                          description:
                            type: string
                            description: "Human-readable description."
                          url:
                            type: string
                            description: "Related URL."
                          content:
                            type: object
                            description: "Preview metadata for a linked URL."
                            properties:
                              site:
                                type: string
                                description: "Website host for preview content."
                              type:
                                type: string
                                description: "Type or category for this object."
                              title:
                                type: string
                                description: "Preview title."
                              description:
                                type: string
                                description: "Human-readable description."
                              image:
                                type: string
                                description: "Preview image URL."
              examples:
                '200':
                  value: {"success":true,"response":{"created_at":"2024-10-22T21:37:32.493Z","strategy_id":"WuRnay0CF3P1oPRSdogj5","user_id":"user_1","likes":"0","liked":false,"type":"post","data":{"description":"Test","url":"https://www.coindesk.com/markets/2024/10/22/paul-tudor-jones-all-roads-lead-to-inflation-hes-long-bitcoin-and-gold/","content":{"site":"www.coindesk.com","type":"summary","title":"Paul Tudor Jones: 'All Roads Lead to Inflation;' He's Long Bitcoi...","description":"The U.S. government's debt and deficit issues aren't going anywhere no matter who wins the presidency next month, said Jones.","image":"https://alphainsider-temp-images.s3.us-east-2.amazonaws.com/nz2JxmthgYBqYYfDI6Mrn"}}}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /deletePost:
    post:
      operationId: deletePost
      summary: deletePost
      description: Delete timeline post.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - timeline_id
              properties:
                timeline_id:
                  $ref: '#/components/schemas/timeline_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Post deleted."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /like:
    post:
      operationId: like
      summary: like
      description: Like timeline event.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - timeline_id
              properties:
                timeline_id:
                  $ref: '#/components/schemas/timeline_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Timeline liked."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /unlike:
    post:
      operationId: unlike
      summary: unlike
      description: Unlike timeline event.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Timelines
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - timeline_id
              properties:
                timeline_id:
                  $ref: '#/components/schemas/timeline_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Timeline unliked."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: STOCKS
  /getStocks:
    get:
      operationId: getStocks
      summary: getStocks
      description: Get stock information.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Stocks
      parameters:
        - name: stock_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of stock IDs. `["stock:exchange"]` or `["stock_id"]`
            maxItems: 100
            items:
              $ref: '#/components/schemas/stock_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: string
                          description: "Composite FIGI identifier when available."
                        symbol:
                          type: string
                          description: "Ticker or asset symbol."
                        name:
                          type: string
                          description: "Display name."
                        sector:
                          type: string
                          description: "Sector or asset category."
                        security:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Security type, such as stock or cryptocurrency."
                        exchange:
                          type: string
                          description: "Exchange code."
                        stock:
                          type: string
                          description: "Stock symbol as stored by AlphaInsider."
                        peg:
                          type: string
                          description: "Peg or quote currency."
                        provider:
                          type: string
                          enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                          description: "External provider or data provider."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        fee:
                          type: string
                          description: "Fee value."
                        links:
                          type: object
                          description: "External research and market-data links."
                        stock_status:
                          type: string
                          enum: [ 'active', 'deleted' ]
                          description: "Current stock status."
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
              examples:
                '200':
                  value: {"success":true,"response":[{"stock_id":"9ot8fZX7romhU2Q8kV97r","figi_composite":"BBG000N9MNX3","symbol":"TSLA","name":"Tesla, Inc. Common Stock","sector":"Manufacturing","security":"stock","exchange":"XNAS","stock":"TSLA","peg":"USD","provider":"polygon","slippage":"0.000000000000000","fee":"0.000000000000000","links":{"finviz":"https://www.finviz.com/quote.ashx?t=TSLA","trading_view":"https://www.tradingview.com/symbols/NASDAQ-TSLA/","yahoo_finance":"https://finance.yahoo.com/quote/TSLA","google_finance":"https://www.google.com/finance/quote/TSLA:NASDAQ"},"stock_status":"active","bid":"217.88","ask":"217.96","last":"217.96"}]}
        '400':
          $ref: '#/components/responses/400'
  /getAllStocks:
    get:
      operationId: getAllStocks
      summary: getAllStocks
      description: Get all stock information.<br/>*Limited to 20 requests per hour.*
      x-mint:
        mcp:
          enabled: true
      tags:
        - Stocks
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: string
                          description: "Composite FIGI identifier when available."
                        symbol:
                          type: string
                          description: "Ticker or asset symbol."
                        name:
                          type: string
                          description: "Display name."
                        sector:
                          type: string
                          description: "Sector or asset category."
                        security:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Security type, such as stock or cryptocurrency."
                        exchange:
                          type: string
                          description: "Exchange code."
                        stock:
                          type: string
                          description: "Stock symbol as stored by AlphaInsider."
                        peg:
                          type: string
                          description: "Peg or quote currency."
                        provider:
                          type: string
                          enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                          description: "External provider or data provider."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        fee:
                          type: string
                          description: "Fee value."
                        links:
                          type: object
                          description: "External research and market-data links."
                        stock_status:
                          type: string
                          enum: [ 'active', 'deleted' ]
                          description: "Current stock status."
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
              examples:
                '200':
                  value: {"success":true,"response":[{"stock_id":"9ot8fZX7romhU2Q8kV97r","figi_composite":"BBG000N9MNX3","symbol":"TSLA","name":"Tesla, Inc. Common Stock","sector":"Manufacturing","security":"stock","exchange":"XNAS","stock":"TSLA","peg":"USD","provider":"polygon","slippage":"0.000000000000000","fee":"0.000000000000000","links":{"finviz":"https://www.finviz.com/quote.ashx?t=TSLA","trading_view":"https://www.tradingview.com/symbols/NASDAQ-TSLA/","yahoo_finance":"https://finance.yahoo.com/quote/TSLA","google_finance":"https://www.google.com/finance/quote/TSLA:NASDAQ"},"stock_status":"active","bid":"217.88","ask":"217.96","last":"217.96"}]}
        '400':
          $ref: '#/components/responses/400'
  /getStockPriceHistory:
    get:
      operationId: getStockPriceHistory
      summary: getStockPriceHistory
      description: Get stock price history.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Stocks
      parameters:
        - name: stock_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/stock_id'
        - name: start_date
          in: query
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        stock_price_id:
                          type: string
                          description: "Stock price id."
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"stock_price_id":"SnNPDVnCo_yrwLTtagsx4","stock_id":"v3lhjrwEhNuAOxPT29oxO","bid":"406.010000000000000","ask":"406.010000000000000","last":"406.010000000000000","created_at":"2020-08-24T14:00:00.000Z"},{"stock_price_id":"ztdNu8H_Eyjmn3eIb_Deo","stock_id":"v3lhjrwEhNuAOxPT29oxO","bid":"402.660000000000000","ask":"402.660000000000000","last":"402.660000000000000","created_at":"2020-08-24T15:00:00.000Z"}]}
        '400':
          $ref: '#/components/responses/400'
  /searchStocks:
    post:
      operationId: searchStocks
      summary: searchStocks
      description: Search stocks.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Stocks
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - search
              properties:
                search:
                  type: string
                  description: Term to search for.
                type:
                  type: string
                  enum: [ 'stock', 'cryptocurrency' ]
                limit:
                  $ref: '#/components/schemas/limit'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: string
                          description: "Composite FIGI identifier when available."
                        symbol:
                          type: string
                          description: "Ticker or asset symbol."
                        name:
                          type: string
                          description: "Display name."
                        sector:
                          type: string
                          description: "Sector or asset category."
                        security:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Security type, such as stock or cryptocurrency."
                        exchange:
                          type: string
                          description: "Exchange code."
                        stock:
                          type: string
                          description: "Stock symbol as stored by AlphaInsider."
                        peg:
                          type: string
                          description: "Peg or quote currency."
                        provider:
                          type: string
                          enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                          description: "External provider or data provider."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        fee:
                          type: string
                          description: "Fee value."
                        links:
                          type: object
                          description: "External research and market-data links."
                        stock_status:
                          type: string
                          enum: [ 'active', 'deleted' ]
                          description: "Current stock status."
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
              examples:
                '200':
                  value: {"success":true,"response":[{"stock_id":"9ot8fZX7romhU2Q8kV97r","figi_composite":"BBG000N9MNX3","symbol":"TSLA","name":"Tesla, Inc. Common Stock","sector":"Manufacturing","security":"stock","exchange":"XNAS","stock":"TSLA","peg":"USD","provider":"polygon","slippage":"0.000000000000000","fee":"0.000000000000000","links":{"finviz":"https://www.finviz.com/quote.ashx?t=TSLA","trading_view":"https://www.tradingview.com/symbols/NASDAQ-TSLA/","yahoo_finance":"https://finance.yahoo.com/quote/TSLA","google_finance":"https://www.google.com/finance/quote/TSLA:NASDAQ"},"stock_status":"active","bid":"217.88","ask":"217.96","last":"217.96"}]}
        '400':
          $ref: '#/components/responses/400'
  /getExchangeStatus:
    get:
      operationId: getExchangeStatus
      summary: getExchangeStatus
      description: Get exchange status.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Stocks
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      stock:
                        type: string
                        description: "Stock symbol as stored by AlphaInsider."
                      cryptocurrency:
                        type: string
                        description: "Cryptocurrency."
              examples:
                '200':
                  value: {"success":true,"response":{"stock":"extended-hours","cryptocurrency":"open"}}
        '400':
          $ref: '#/components/responses/400'
  
  #DONE: TRADES
  /getPositions:
    get:
      operationId: getPositions
      summary: getPositions
      description: Get strategy positions.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Trades
      parameters:
        - $ref: '#/components/parameters/optional_api_token'
        - name: strategy_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        position_id:
                          type: string
                          description: "Strategy position identifier."
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        type:
                          type: string
                          enum: [ 'asset', 'liability' ]
                          description: "Type or category for this object."
                        price:
                          type: string
                          description: "Price or execution price, depending on context."
                        amount:
                          type: string
                          description: "Amount."
                        total:
                          type: string
                          description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: [string, "null"]
                          description: "Composite FIGI identifier when available."
                        symbol:
                          type: string
                          description: "Ticker or asset symbol."
                        name:
                          type: string
                          description: "Display name."
                        sector:
                          type: string
                          description: "Sector or asset category."
                        security:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Security type, such as stock or cryptocurrency."
                        exchange:
                          type: string
                          description: "Exchange code."
                        stock:
                          type: string
                          description: "Stock symbol as stored by AlphaInsider."
                        peg:
                          type: string
                          description: "Peg or quote currency."
                        provider:
                          type: string
                          enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                          description: "External provider or data provider."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        fee:
                          type: string
                          description: "Fee value."
                        links:
                          type: object
                          description: "External research and market-data links."
                        stock_status:
                          type: string
                          enum: [ 'active', 'deleted' ]
                          description: "Current stock status."
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
              examples:
                '200':
                  value: {"success":true,"response":[{"position_id":"PAiBXHzE10Fa4ioITCXbX","strategy_id":"7Wy5AzIKY9bCmkIqjcLSg","type":"liability","price":"1.000000000000000","amount":"-0.932626292686600","total":"-0.932626292686600","updated_at":"2024-07-18T20:14:44.660Z","created_at":"2024-07-18T20:14:44.660Z","stock_id":"ubfhvYUsgvMIuJPwr76My","figi_composite":null,"symbol":"USD","name":"US Dollar","sector":"Unallocated","security":"","exchange":"ALPHAINSIDER","stock":"USD","peg":"USD","provider":"alphainsider","slippage":"0.000000000000000","fee":"0.000000000000000","links":{},"stock_status":"active","bid":"1.000000000000000","ask":"1.000000000000000","last":"1.000000000000000"},{"position_id":"XoLx1OyDdRBr_yq4JHJdB","strategy_id":"7Wy5AzIKY9bCmkIqjcLSg","type":"asset","price":"2996.940000000000000","amount":"0.000647643919923","total":"1.940949969374036","updated_at":"2024-07-18T20:14:44.660Z","created_at":"2024-05-08T19:51:06.230Z","stock_id":"v3lhjrwEhNuAOxPT29oxO","figi_composite":null,"symbol":"ETH-USD","name":"Ethereum","sector":"Cryptocurrencies","security":"cryptocurrency","exchange":"COINBASE","stock":"ETH-USD","peg":"USD","provider":"coinbase","slippage":"0.000000000000000","fee":"0.002500000000000","links":{"trading_view":"https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE","yahoo_finance":"https://finance.yahoo.com/quote/ETH-USD","coin_marketcap":"https://coinmarketcap.com/currencies/ethereum/","google_finance":"https://www.google.com/finance/quote/ETH-USD"},"stock_status":"active","bid":"2633.09","ask":"2633.09","last":"2633.09"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getOrders:
    get:
      operationId: getOrders
      summary: getOrders
      description: Get strategy orders.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Trades
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: strategy_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/strategy_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        order_id:
                          $ref: '#/components/schemas/order_id'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        type:
                          type: string
                          enum: [ 'market', 'limit', 'stop_market', 'stop_limit', 'oco', 'liquidate' ]
                          description: "Type or category for this object."
                        action:
                          type: string
                          enum: [ 'buy', 'sell' ]
                          description: "Order or signal action."
                        stop_price:
                          type: [string, "null"]
                          description: "Stop trigger price."
                        price:
                          type: string
                          description: "Price or execution price, depending on context."
                        amount:
                          type: string
                          description: "Amount."
                        total:
                          type: [string, "null"]
                          description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: [string, "null"]
                          description: "Composite FIGI identifier when available."
                        symbol:
                          type: string
                          description: "Ticker or asset symbol."
                        name:
                          type: string
                          description: "Display name."
                        sector:
                          type: string
                          description: "Sector or asset category."
                        security:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Security type, such as stock or cryptocurrency."
                        exchange:
                          type: string
                          description: "Exchange code."
                        stock:
                          type: string
                          description: "Stock symbol as stored by AlphaInsider."
                        peg:
                          type: string
                          description: "Peg or quote currency."
                        provider:
                          type: string
                          enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                          description: "External provider or data provider."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        fee:
                          type: string
                          description: "Fee value."
                        links:
                          type: object
                          description: "External research and market-data links."
                        stock_status:
                          type: string
                          enum: [ 'active', 'deleted' ]
                          description: "Current stock status."
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
                        order_dependencies:
                          type: array
                          description: "Order IDs this order is waiting on; `[]` means the order has no outstanding dependencies."
                          items:
                            type: string
              examples:
                '200':
                  value: {"success":true,"response":[{"order_id":"qoppbNXH4lG0-4x21YLCp","strategy_id":"7Wy5AzIKY9bCmkIqjcLSg","type":"limit","action":"sell","stop_price":null,"price":"4000.000000000000000","amount":"0.000200000000000","total":null,"created_at":"2024-10-22T21:47:19.540Z","stock_id":"v3lhjrwEhNuAOxPT29oxO","figi_composite":null,"symbol":"ETH-USD","name":"Ethereum","sector":"Cryptocurrencies","security":"cryptocurrency","exchange":"COINBASE","stock":"ETH-USD","peg":"USD","provider":"coinbase","slippage":"0.000000000000000","fee":"0.002500000000000","links":{"trading_view":"https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE","yahoo_finance":"https://finance.yahoo.com/quote/ETH-USD","coin_marketcap":"https://coinmarketcap.com/currencies/ethereum/","google_finance":"https://www.google.com/finance/quote/ETH-USD"},"stock_status":"active","bid":"2633.02","ask":"2633.02","last":"2633.02","order_dependencies":[]}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getMaxOrderSize:
    get:
      operationId: getMaxOrderSize
      summary: getMaxOrderSize
      description: Get max order size.<br/>Be sure to leave room for slippage and fee when calculating max buying/selling power.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Trades
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: strategy_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/strategy_id'
        - name: stock_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/stock_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Max order size payload, or an error message when `success` is false."
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      stock_id:
                        $ref: '#/components/schemas/stock_id'
                      remaining_assets_amount:
                        type: string
                        description: "Remaining asset buying/selling capacity."
                      remaining_liabilities_amount:
                        type: string
                        description: "Remaining liability capacity."
                      buying_power_total:
                        type: string
                        description: "Total buying power available for the requested order."
                      selling_power_total:
                        type: string
                        description: "Total selling power available for the requested order."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      fee:
                        type: string
                        description: "Fee value."
              examples:
                '200':
                  value: {"success":true,"response":{"strategy_id":"MGfroYBdziuVhQOAce3wB","stock_id":"v3lhjrwEhNuAOxPT29oxO","remaining_assets_amount":"0","remaining_liabilities_amount":"0","buying_power_total":"1.552444817292084","selling_power_total":"1.552444817292084","slippage":"0.000926141922545","fee":"0.002500000000000"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newOrder:
    post:
      operationId: newOrder
      summary: newOrder
      description: Create a new open order. Must pass `amount` or `total` not both.<br/><br/>For TradingView or webhook integrations with percentage based order actions, see [newOrderWebhook](/resources/webhooks/neworderwebhook) or [newOrderAllocations](/resources/trades/newOrderAllocations) api endpoint.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Trades
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - stock_id
                - action
                - type
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                stock_id:
                  $ref: '#/components/schemas/stock_id'
                action:
                  type: string
                  description: Order action.
                  enum: [ 'buy', 'sell' ]
                type:
                  type: string
                  description: Type of order.
                  enum: [ 'market', 'limit', 'stop_market', 'stop_limit', 'oco' ]
                amount:
                  type: string
                  format: double(30,15)
                  description: Number of shares to trade.
                total:
                  type: string
                  format: double(30,15)
                  description: Cash allocated towards order.
                price:
                  type: string
                  format: double(30,15)
                  description: Price to make trade at.
                stop_price:
                  type: string
                  format: double(30,15)
                  description: Price to trigger order.
                order_dependencies:
                  type: array
                  description: An array of order IDs to wait for before this order can be executed.
                  items:
                    type: string
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      order_id:
                        $ref: '#/components/schemas/order_id'
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      type:
                        type: string
                        enum: [ 'market', 'limit', 'stop_market', 'stop_limit', 'oco', 'liquidate' ]
                        description: "Type or category for this object."
                      action:
                        type: string
                        enum: [ 'buy', 'sell' ]
                        description: "Order or signal action."
                      stop_price:
                        type: [string, "null"]
                        description: "Stop trigger price."
                      price:
                        type: string
                        description: "Price or execution price, depending on context."
                      amount:
                        type: string
                        description: "Amount."
                      total:
                        type: [string, "null"]
                        description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      stock_id:
                        $ref: '#/components/schemas/stock_id'
                      figi_composite:
                        type: [string, "null"]
                        description: "Composite FIGI identifier when available."
                      symbol:
                        type: string
                        description: "Ticker or asset symbol."
                      name:
                        type: string
                        description: "Display name."
                      sector:
                        type: string
                        description: "Sector or asset category."
                      security:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Security type, such as stock or cryptocurrency."
                      exchange:
                        type: string
                        description: "Exchange code."
                      stock:
                        type: string
                        description: "Stock symbol as stored by AlphaInsider."
                      peg:
                        type: string
                        description: "Peg or quote currency."
                      provider:
                        type: string
                        enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                        description: "External provider or data provider."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      fee:
                        type: string
                        description: "Fee value."
                      links:
                        type: object
                        description: "External research and market-data links."
                      stock_status:
                        type: string
                        enum: [ 'active', 'deleted' ]
                        description: "Current stock status."
                      bid:
                        type: string
                        description: "Current bid price."
                      ask:
                        type: string
                        description: "Current ask price."
                      last:
                        type: string
                        description: "Last traded price."
                      order_dependencies:
                        type: array
                        description: "Order IDs this order is waiting on; `[]` means the order has no outstanding dependencies."
                        items:
                          type: string
              examples:
                '200':
                  value: {"success":true,"response":{"order_id":"qoppbNXH4lG0-4x21YLCp","strategy_id":"7Wy5AzIKY9bCmkIqjcLSg","type":"limit","action":"sell","stop_price":null,"price":"4000.000000000000000","amount":"0.000200000000000","total":null,"created_at":"2024-10-22T21:47:19.540Z","stock_id":"v3lhjrwEhNuAOxPT29oxO","figi_composite":null,"symbol":"ETH-USD","name":"Ethereum","sector":"Cryptocurrencies","security":"cryptocurrency","exchange":"COINBASE","stock":"ETH-USD","peg":"USD","provider":"coinbase","slippage":"0.000000000000000","fee":"0.002500000000000","links":{"trading_view":"https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE","yahoo_finance":"https://finance.yahoo.com/quote/ETH-USD","coin_marketcap":"https://coinmarketcap.com/currencies/ethereum/","google_finance":"https://www.google.com/finance/quote/ETH-USD"},"stock_status":"active","bid":"2633.43","ask":"2633.43","last":"2633.43","order_dependencies":[]}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newOrderAllocations:
    post:
      operationId: newOrderAllocations
      summary: newOrderAllocations
      description: |-
        Create new orders based on percentage allocations.

        **Important:** Before submitting allocation-generated orders, this endpoint cancels any existing open orders for the strategy. It then creates market orders to move the strategy toward target percentage allocations.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Trades
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - allocations
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                allocations:
                  type: array
                  description: "The allocations array represents the strategy's complete desired position set: any current position omitted from the array is closed, and an empty array closes every position."
                  items:
                    $ref: '#/components/schemas/allocations'
                slippage:
                  type: number
                  minimum: 0
                  maximum: 2
                  multipleOf: 0.001
                  default: 0.002
                  description: |-
                    Slippage represents the percentage offset from the current bid/ask price when placing a limit order. This adjustment helps ensure that orders are more likely to fill by accounting for potential price movements.
                    
                    **Please note that the allocations may not sum precisely to 100%.** The following calculation illustrates our approach to determining a conservative buffer for potential fees and slippage:  
                    * `MaxOrderTotal = BuyingPower * 2`  
                    This calculates the maximum possible order total, representing a full position reversal (e.g., from maximum long to maximum short, or vice versa).
                    * `ConservativeFeeTotal = MaxOrderTotal * (fee * 2)`  
                    This accounts for the buying power reduction due to fees, as fees are deducted from collateral. (Stock Fees: 0%, Crypto Fees: 0.25%).
                    * `ConservativeSlippageTotal = MaxOrderTotal * Slippage`  
                    This reserves funds for the worst-case scenario of order fills impacted by slippage.
                    * `FinalBuyingPower = BuyingPower - ConservativeFeeTotal - ConservativeSlippageTotal`  
                    The adjusted buying power after these reductions.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        order_id:
                          $ref: '#/components/schemas/order_id'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        type:
                          type: string
                          enum: [ 'market', 'limit', 'stop_market', 'stop_limit', 'oco', 'liquidate' ]
                          description: "Type or category for this object."
                        action:
                          type: string
                          enum: [ 'buy', 'sell' ]
                          description: "Order or signal action."
                        stop_price:
                          type: [string, "null"]
                          description: "Stop trigger price."
                        price:
                          type: [string, "null"]
                          description: "Price or execution price, depending on context."
                        amount:
                          type: [string, "null"]
                          description: "Amount."
                        total:
                          type: string
                          description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: string
                          description: "Composite FIGI identifier when available."
                        symbol:
                          type: string
                          description: "Ticker or asset symbol."
                        name:
                          type: string
                          description: "Display name."
                        sector:
                          type: string
                          description: "Sector or asset category."
                        security:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Security type, such as stock or cryptocurrency."
                        exchange:
                          type: string
                          description: "Exchange code."
                        stock:
                          type: string
                          description: "Stock symbol as stored by AlphaInsider."
                        peg:
                          type: string
                          description: "Peg or quote currency."
                        provider:
                          type: string
                          enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                          description: "External provider or data provider."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        fee:
                          type: string
                          description: "Fee value."
                        links:
                          type: object
                          description: "External research and market-data links."
                        stock_status:
                          type: string
                          enum: [ 'active', 'deleted' ]
                          description: "Current stock status."
                        bid:
                          type: string
                          description: "Current bid price."
                        ask:
                          type: string
                          description: "Current ask price."
                        last:
                          type: string
                          description: "Last traded price."
                        order_dependencies:
                          type: array
                          description: "Order IDs this order is waiting on; `[]` means the order has no outstanding dependencies."
                          items:
                            type: string
              examples:
                '200':
                  value: {"success":true,"response":[{"order_id":"l0-nlN5HEe3UdIutvYcDU","strategy_id":"7Wy5AzIKY9bCmkIqjcLSg","type":"market","action":"buy","stop_price":null,"price":null,"amount":null,"total":"1.246293514070567","created_at":"2026-01-27T21:12:58.215Z","stock_id":"6128jONlulvgURhFwmIb2","figi_composite":"BBG000BDTBL9","symbol":"SPY","name":"SPDR S&P 500 ETF Trust","sector":"Exchange Traded Fund","security":"stock","exchange":"ARCX","stock":"SPY","peg":"USD","provider":"polygon","slippage":"0.000000000000000","fee":"0.000000000000000","links":{"finviz":"https://www.finviz.com/quote.ashx?t=SPY","trading_view":"https://www.tradingview.com/symbols/AMEX-SPY/","yahoo_finance":"https://finance.yahoo.com/quote/SPY","google_finance":"https://www.google.com/finance/quote/SPY:NYSEARCA"},"stock_status":"active","bid":"695.42","ask":"695.49","last":"695.54","order_dependencies":[]}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /deleteOrder:
    post:
      operationId: deleteOrder
      summary: deleteOrder
      description: Delete existing order.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Trades
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - order_id
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                order_id:
                  $ref: '#/components/schemas/order_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Order deleted."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: BOTS
  /getBots:
    get:
      operationId: getBots
      summary: getBots
      description: Get user bots.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: bot_id[]
          in: query
          schema:
            type: array
            description: Array of bot IDs. Leave empty to get all bots.
            maxItems: 100
            items:
              $ref: '#/components/schemas/bot_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        bot_id:
                          $ref: '#/components/schemas/bot_id'
                        user_id:
                          $ref: '#/components/schemas/user_id'
                        leverage:
                          type: string
                          description: "Requested leverage."
                        slippage:
                          type: string
                          description: "Slippage value or configured slippage fraction."
                        rebalance_on_start:
                          type: boolean
                          description: "Whether the bot rebalances when started."
                        close_on_stop:
                          type: boolean
                          description: "Whether the bot closes positions when stopped."
                        broker:
                          type: string
                          enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                          description: "Broker used by the bot."
                        type:
                          type: string
                          enum: [ 'cryptocurrency', 'stock' ]
                          description: "Type or category for this object."
                        live:
                          type: boolean
                          description: "Whether the broker account is live rather than paper."
                        account_id:
                          type: string
                          description: "Broker account identifier."
                        status:
                          type: string
                          enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                          description: "Current status."
                        notifications:
                          type: array
                          description: "Enabled notification types."
                          items:
                            type: string
                            enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":true,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"off","notifications":[],"updated_at":"2024-10-23T14:36:02.484Z","created_at":"2024-10-23T14:36:02.484Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getBotInfo:
    get:
      operationId: getBotInfo
      summary: getBotInfo
      description: Get bot info.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: bot_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/bot_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      broker_status:
                        type: string
                        description: "Broker connection status."
                      broker_details:
                        type: object
                        description: "Broker account details returned by the broker integration."
                        properties:
                          margin_type:
                            type: string
                            description: "Broker margin type."
                          value:
                            type: string
                            description: "Broker account value."
                          buying_power:
                            type: string
                            description: "Broker buying power."
                          min_total:
                            type: string
                            description: "Minimum order total for the broker account."
                          max_leverage:
                            type: string
                            description: "Maximum broker leverage."
                          initial_buying_power_percent:
                            type: string
                            description: "Initial buying-power percentage reserved for bot execution."
                          positions:
                            type: array
                            description: "Nested position records."
                            items:
                              type: object
                              properties:
                                broker_stock_id:
                                  type: string
                                  description: "Broker-specific symbol or stock identifier."
                                amount:
                                  type: string
                                  description: "Amount."
                                bid:
                                  type: string
                                  description: "Current bid price."
                                ask:
                                  type: string
                                  description: "Current ask price."
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","broker_status":"valid","broker_details":{"margin_type":"reg_t","value":"93003.68","buying_power":"186007.36","min_total":"1","max_leverage":"2","initial_buying_power_percent":"0.95","positions":[{"broker_stock_id":"COIN","amount":"105.16414","bid":"338","ask":"356.99"},{"broker_stock_id":"INTC","amount":"-617.19069","bid":"34.08","ask":"0"},{"broker_stock_id":"PLTR","amount":"156.39204","bid":"179.7","ask":"179.76"},{"broker_stock_id":"TSLA","amount":"12.45853","bid":"405.26","ask":"0"},{"broker_stock_id":"XYZ","amount":"348.94207","bid":"73.28","ask":"76.81"}]}}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /newBot:
    post:
      operationId: newBot
      summary: newBot
      description: Create new bot.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - broker
                - broker_keys
              properties:
                broker:
                  type: string
                  description: Bot broker.
                  enum: [ 'bitfinex', 'binance', 'alpaca', 'hyperliquid' ]
                broker_keys:
                  $ref: '#/components/schemas/broker_keys'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":true,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"off","notifications":[],"updated_at":"2024-10-23T14:36:02.484Z","created_at":"2024-10-23T14:36:02.484Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateBotSettings:
    post:
      operationId: updateBotSettings
      summary: updateBotSettings
      description: Update bot settings.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
                leverage:
                  type: number
                  minimum: 2
                  maximum: 50
                  multipleOf: 1
                  description: |-
                    The maximum leverage strategies can use to place orders.
                slippage:
                  type: number
                  minimum: 0
                  maximum: 0.05
                  multipleOf: 0.001
                  description: |-
                    The maximum percent from current price orders can be filled.
                rebalance_on_start:
                  type: boolean
                  description: Rebalance on start.
                close_on_stop:
                  type: boolean
                  description: Close on stop.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":false,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"off","notifications":[],"updated_at":"2024-10-23T14:39:52.461Z","created_at":"2024-10-23T14:36:02.484Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateBotBrokerKeys:
    post:
      operationId: updateBotBrokerKeys
      summary: updateBotBrokerKeys
      description: Update bot broker keys.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
                - broker_keys
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
                broker_keys:
                  $ref: '#/components/schemas/broker_keys'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"oSDsXkKq8nq8_quqrySSK","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":true,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"on","notifications":[],"updated_at":"2024-10-23T15:15:08.758Z","created_at":"2024-10-23T14:53:11.748Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateBotNotifications:
    post:
      operationId: updateBotNotifications
      summary: updateBotNotifications
      description: Update bot notifications.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
                - notifications
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
                notifications:
                  type: array
                  description: Which notification types to receive.
                  items:
                    type: string
                    enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":false,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"off","notifications":["start","stop","info","warning","error"],"updated_at":"2024-10-23T14:43:06.475Z","created_at":"2024-10-23T14:36:02.484Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /deleteBot:
    post:
      operationId: deleteBot
      summary: deleteBot
      description: Delete bot.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Bot deleted."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /startBot:
    post:
      operationId: startBot
      summary: startBot
      description: Start bot.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
                rebalance_on_start:
                  type: boolean
                  description: Rebalance on start.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":false,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"scheduled_rebalance","notifications":["start","stop","info","warning","error"],"updated_at":"2024-10-23T14:46:57.875Z","created_at":"2024-10-23T14:36:02.484Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /stopBot:
    post:
      operationId: stopBot
      summary: stopBot
      description: Stop bot.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
                close_on_stop:
                  type: boolean
                  description: Close on stop.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":false,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"stopping","notifications":["start","stop","info","warning","error"],"updated_at":"2024-10-23T14:47:32.896Z","created_at":"2024-10-23T14:36:02.484Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /resetBot:
    post:
      operationId: resetBot
      summary: resetBot
      description: Reset bot.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      bot_id:
                        $ref: '#/components/schemas/bot_id'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      leverage:
                        type: string
                        description: "Requested leverage."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      rebalance_on_start:
                        type: boolean
                        description: "Whether the bot rebalances when started."
                      close_on_stop:
                        type: boolean
                        description: "Whether the bot closes positions when stopped."
                      broker:
                        type: string
                        enum: [ 'hyperliquid', 'bitfinex', 'binance', 'alpaca' ]
                        description: "Broker used by the bot."
                      type:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Type or category for this object."
                      live:
                        type: boolean
                        description: "Whether the broker account is live rather than paper."
                      account_id:
                        type: string
                        description: "Broker account identifier."
                      status:
                        type: string
                        enum: [ 'on', 'scheduled_rebalance', 'rebalancing', 'scheduled_close', 'closing', 'stopping', 'off' ]
                        description: "Current status."
                      notifications:
                        type: array
                        description: "Enabled notification types."
                        items:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":{"bot_id":"oSDsXkKq8nq8_quqrySSK","user_id":"user_1","leverage":"2.000000000000000","slippage":"0.005000000000000","rebalance_on_start":true,"close_on_stop":true,"broker":"alpaca","type":"stock","live":false,"account_id":"AAABBBCCC","status":"scheduled_rebalance","notifications":[],"updated_at":"2024-10-23T15:17:07.233Z","created_at":"2024-10-23T14:53:11.748Z"}}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getBotPerformance:
    get:
      operationId: getBotPerformance
      summary: getBotPerformance
      description: Get bot performance data.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: bot_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/bot_id'
        - name: frequency
          in: query
          schema:
            $ref: '#/components/schemas/frequency'
        - name: interval
          in: query
          schema:
            $ref: '#/components/schemas/interval'
        - name: start_date
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        bot_id:
                          $ref: '#/components/schemas/bot_id'
                        portfolio_value:
                          type: string
                          description: "Portfolio value."
                        activity:
                          type: string
                          description: "Trade activity label for a performance interval."
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: { "success": true,"response": [{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","portfolio_value":"100000.000000000000000","activity":"","created_at":"2025-12-09T20:00:00.000Z"},{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","portfolio_value":"100000.000000000000000","activity":"start","created_at":"2025-12-09T21:00:00.000Z"},{"bot_id":"h_zZfeqsX9o8hgB8DVc0P","portfolio_value":"100000.000000000000000","activity":"info","created_at":"2025-12-10T19:00:00.000Z"}] }
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /resetBotPerformance:
    post:
      operationId: resetBotPerformance
      summary: resetBotPerformance
      description: Resets the bot performance graph.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: string
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
              examples:
                '200':
                  value: {"success":true,"response":"Bot performance reset."}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getBotAllocations:
    get:
      operationId: getBotAllocations
      summary: getBotAllocations
      description: Get bot allocations.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: bot_id[]
          in: query
          required: true
          schema:
            type: array
            description: Array of bot IDs.
            maxItems: 100
            items:
              $ref: '#/components/schemas/bot_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        bot_allocation_id:
                          type: string
                          description: "Bot allocation identifier."
                        bot_id:
                          $ref: '#/components/schemas/bot_id'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        percent:
                          type: string
                          description: "Portfolio allocation fraction."
                        strategy_value:
                          type: string
                          description: "Normalized strategy value. Convert before displaying user-facing USD values."
                        positions:
                          type: array
                          description: "Nested position records."
                          items:
                            type: object
                            properties:
                              position_id:
                                type: string
                                description: "Strategy position identifier."
                              strategy_id:
                                $ref: '#/components/schemas/strategy_id'
                              type:
                                type: string
                                enum: [ 'asset', 'liability' ]
                                description: "Type or category for this object."
                              price:
                                type: string
                                description: "Price or execution price, depending on context."
                              amount:
                                type: string
                                description: "Amount."
                              total:
                                type: string
                                description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                              updated_at:
                                $ref: '#/components/schemas/updated_at'
                              created_at:
                                $ref: '#/components/schemas/created_at'
                              stock_id:
                                $ref: '#/components/schemas/stock_id'
                              figi_composite:
                                type: [string, "null"]
                                description: "Composite FIGI identifier when available."
                              symbol:
                                type: string
                                description: "Ticker or asset symbol."
                              name:
                                type: string
                                description: "Display name."
                              sector:
                                type: string
                                description: "Sector or asset category."
                              security:
                                type: string
                                enum: [ 'cryptocurrency', 'stock' ]
                                description: "Security type, such as stock or cryptocurrency."
                              exchange:
                                type: string
                                description: "Exchange code."
                              stock:
                                type: string
                                description: "Stock symbol as stored by AlphaInsider."
                              peg:
                                type: string
                                description: "Peg or quote currency."
                              provider:
                                type: string
                                enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                                description: "External provider or data provider."
                              slippage:
                                type: string
                                description: "Slippage value or configured slippage fraction."
                              fee:
                                type: string
                                description: "Fee value."
                              links:
                                type: object
                                description: "External research and market-data links."
                              stock_status:
                                type: string
                                enum: [ 'active', 'deleted' ]
                                description: "Current stock status."
                              bid:
                                type: string
                                description: "Current bid price."
                              ask:
                                type: string
                                description: "Current ask price."
                              last:
                                type: string
                                description: "Last traded price."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"bot_allocation_id":"g1DDEzc68EPrWyhSxRPHJ","bot_id":"h_zZfeqsX9o8hgB8DVc0P","strategy_id":"YbKCgktxu0ugmQ1QKCfA3","percent":"0.6","strategy_value":"1","positions":[{"position_id":"G3nEoY0dAYGXpucdAMC5R","strategy_id":"YbKCgktxu0ugmQ1QKCfA3","type":"asset","price":"1.000000000000000","amount":"1.000000000000000","total":"1.000000000000000","updated_at":"2024-10-17T14:24:25.987Z","created_at":"2024-10-17T14:24:25.987Z","stock_id":"ubfhvYUsgvMIuJPwr76My","figi_composite":null,"symbol":"USD","name":"US Dollar","sector":"Unallocated","security":"","exchange":"ALPHAINSIDER","stock":"USD","peg":"USD","provider":"alphainsider","slippage":"0.000000000000000","fee":"0.000000000000000","links":{},"stock_status":"active","bid":"1.00","ask":"1.00","last":"1.00"}],"updated_at":"2024-10-23T14:48:47.090Z","created_at":"2024-10-23T14:45:48.648Z"},{"bot_allocation_id":"1Su_xi4PbyC2o4HhOmjxO","bot_id":"h_zZfeqsX9o8hgB8DVc0P","strategy_id":"WuRnay0CF3P1oPRSdogj5","percent":"0.4","strategy_value":"1","positions":[{"position_id":"RSTqnGGFOBVONbKNzrLUq","strategy_id":"WuRnay0CF3P1oPRSdogj5","type":"asset","price":"1.000000000000000","amount":"1.000000000000000","total":"1.000000000000000","updated_at":"2024-10-22T20:44:42.391Z","created_at":"2024-10-22T20:44:42.391Z","stock_id":"ubfhvYUsgvMIuJPwr76My","figi_composite":null,"symbol":"USD","name":"US Dollar","sector":"Unallocated","security":"","exchange":"ALPHAINSIDER","stock":"USD","peg":"USD","provider":"alphainsider","slippage":"0.000000000000000","fee":"0.000000000000000","links":{},"stock_status":"active","bid":"1.00","ask":"1.00","last":"1.00"}],"updated_at":"2024-10-23T14:48:47.090Z","created_at":"2024-10-23T14:45:48.648Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /updateBotAllocations:
    post:
      operationId: updateBotAllocations
      summary: updateBotAllocations
      description: Update bot allocations.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - bot_id
                - allocations
              properties:
                bot_id:
                  $ref: '#/components/schemas/bot_id'
                allocations:
                  type: array
                  description: Array of allocations.
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - strategy_id
                      - percent
                    properties:
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      percent:
                        type: number
                        description: Percent of portfolio in this strategy.
                        minimum: 0
                        maximum: 1
                        multipleOf: 0.0001
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        bot_allocation_id:
                          type: string
                          description: "Bot allocation identifier."
                        bot_id:
                          $ref: '#/components/schemas/bot_id'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        percent:
                          type: string
                          description: "Portfolio allocation fraction."
                        strategy_value:
                          type: string
                          description: "Normalized strategy value. Convert before displaying user-facing USD values."
                        positions:
                          type: array
                          description: "Nested position records."
                          items:
                            type: object
                            properties:
                              position_id:
                                type: string
                                description: "Strategy position identifier."
                              strategy_id:
                                $ref: '#/components/schemas/strategy_id'
                              type:
                                type: string
                                enum: [ 'asset', 'liability' ]
                                description: "Type or category for this object."
                              price:
                                type: string
                                description: "Price or execution price, depending on context."
                              amount:
                                type: string
                                description: "Amount."
                              total:
                                type: string
                                description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                              updated_at:
                                $ref: '#/components/schemas/updated_at'
                              created_at:
                                $ref: '#/components/schemas/created_at'
                              stock_id:
                                $ref: '#/components/schemas/stock_id'
                              figi_composite:
                                type: [string, "null"]
                                description: "Composite FIGI identifier when available."
                              symbol:
                                type: string
                                description: "Ticker or asset symbol."
                              name:
                                type: string
                                description: "Display name."
                              sector:
                                type: string
                                description: "Sector or asset category."
                              security:
                                type: string
                                enum: [ 'cryptocurrency', 'stock' ]
                                description: "Security type, such as stock or cryptocurrency."
                              exchange:
                                type: string
                                description: "Exchange code."
                              stock:
                                type: string
                                description: "Stock symbol as stored by AlphaInsider."
                              peg:
                                type: string
                                description: "Peg or quote currency."
                              provider:
                                type: string
                                enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                                description: "External provider or data provider."
                              slippage:
                                type: string
                                description: "Slippage value or configured slippage fraction."
                              fee:
                                type: string
                                description: "Fee value."
                              links:
                                type: object
                                description: "External research and market-data links."
                              stock_status:
                                type: string
                                enum: [ 'active', 'deleted' ]
                                description: "Current stock status."
                              bid:
                                type: string
                                description: "Current bid price."
                              ask:
                                type: string
                                description: "Current ask price."
                              last:
                                type: string
                                description: "Last traded price."
                        updated_at:
                          $ref: '#/components/schemas/updated_at'
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"bot_allocation_id":"g1DDEzc68EPrWyhSxRPHJ","bot_id":"h_zZfeqsX9o8hgB8DVc0P","strategy_id":"YbKCgktxu0ugmQ1QKCfA3","percent":"0.6","strategy_value":"1","positions":[{"position_id":"G3nEoY0dAYGXpucdAMC5R","strategy_id":"YbKCgktxu0ugmQ1QKCfA3","type":"asset","price":"1.000000000000000","amount":"1.000000000000000","total":"1.000000000000000","updated_at":"2024-10-17T14:24:25.987Z","created_at":"2024-10-17T14:24:25.987Z","stock_id":"ubfhvYUsgvMIuJPwr76My","figi_composite":null,"symbol":"USD","name":"US Dollar","sector":"Unallocated","security":"","exchange":"ALPHAINSIDER","stock":"USD","peg":"USD","provider":"alphainsider","slippage":"0.000000000000000","fee":"0.000000000000000","links":{},"stock_status":"active","bid":"1.00","ask":"1.00","last":"1.00"}],"updated_at":"2024-10-23T14:45:48.648Z","created_at":"2024-10-23T14:45:48.648Z"},{"bot_allocation_id":"1Su_xi4PbyC2o4HhOmjxO","bot_id":"h_zZfeqsX9o8hgB8DVc0P","strategy_id":"WuRnay0CF3P1oPRSdogj5","percent":"0.4","strategy_value":"1","positions":[{"position_id":"RSTqnGGFOBVONbKNzrLUq","strategy_id":"WuRnay0CF3P1oPRSdogj5","type":"asset","price":"1.000000000000000","amount":"1.000000000000000","total":"1.000000000000000","updated_at":"2024-10-22T20:44:42.391Z","created_at":"2024-10-22T20:44:42.391Z","stock_id":"ubfhvYUsgvMIuJPwr76My","figi_composite":null,"symbol":"USD","name":"US Dollar","sector":"Unallocated","security":"","exchange":"ALPHAINSIDER","stock":"USD","peg":"USD","provider":"alphainsider","slippage":"0.000000000000000","fee":"0.000000000000000","links":{},"stock_status":"active","bid":"1.00","ask":"1.00","last":"1.00"}],"updated_at":"2024-10-23T14:45:48.648Z","created_at":"2024-10-23T14:45:48.648Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /getBotActivities:
    get:
      operationId: getBotActivities
      summary: getBotActivities
      description: Get bot activities.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Bots
      parameters:
        - $ref: '#/components/parameters/api_token'
        - name: bot_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/bot_id'
        - name: bot_activity_id[]
          in: query
          schema:
            type: array
            description: Array of bot activity IDs. Leave empty to get all bot activities.
            maxItems: 100
            items:
              $ref: '#/components/schemas/bot_activity_id'
        - name: type[]
          in: query
          schema:
            type: array
            description: Array of activity types to filter by.
            items:
              type: string
              enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
        - name: start_date
          in: query
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
            default: 10
        - name: offset_id
          in: query
          schema:
            $ref: '#/components/schemas/offset_id'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    items:
                      type: object
                      properties:
                        bot_activity_id:
                          $ref: '#/components/schemas/bot_activity_id'
                        bot_id:
                          $ref: '#/components/schemas/bot_id'
                        type:
                          type: string
                          enum: [ 'start', 'stop', 'info', 'warning', 'error' ]
                          description: "Type or category for this object."
                        message:
                          type: string
                          description: "Activity or status message."
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value: {"success":true,"response":[{"bot_activity_id":"tI5eyI6xex1Pz-No1XuN-","bot_id":"h_zZfeqsX9o8hgB8DVc0P","type":"start","message":"Bot started.","created_at":"2024-10-23T14:46:58.395Z"}]}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
  #DONE: Webhooks
  /newOrderWebhook:
    post:
      operationId: newOrderWebhook
      summary: newOrderWebhook
      description: |-
        New order from webhook. [Tutorial setup](https://alphainsider.com/resources#trading-view).

        **Important:** Before submitting a new order, this endpoint cancels any existing open orders for the strategy.

        By default you go fully in or out of a position at `leverage`. Set `pyramiding` to scale into a position over multiple same-direction alerts.
      x-mint:
        mcp:
          enabled: true
      tags:
        - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - stock_id
                - action
                - api_token
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                stock_id:
                  $ref: '#/components/schemas/stock_id'
                action:
                  type: string
                  description: |-
                    Order actions. Action "buy" is the same as "long", "sell" is the same as "short", "close" is the same as "flat".
                    It is recommended for TradingView webhooks to use the **{{strategy.market_position}}** to get all strategy actions.
                    [See TradingView strategy alert guide for full list of automated actions](https://www.tradingview.com/support/solutions/43000481368-strategy-alerts/).
                  enum: [ 'buy', 'long', 'sell', 'short', 'close', 'flat' ]
                leverage:
                  type: number
                  minimum: 0
                  maximum: 2
                  multipleOf: 0.01
                  default: 1
                  description: |-
                    Leverage to trade at. Defaults to 1 if not set.
                pyramiding:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: |-
                    Number of same-direction trades needed to reach full `leverage`. Each same-direction alert steps the position by `leverage / pyramiding` toward full leverage. Once at full leverage, additional same-direction alerts rebalance the position back to exactly `leverage`. An opposite-direction alert reverses the position to the first step on the new side. Ignored for "close"/"flat", which liquidates the strategy. If not set, each alert goes fully in or out of the position at `leverage`.
                slippage:
                  type: number
                  minimum: 0
                  maximum: 0.05
                  multipleOf: 0.001
                  default: 0.002
                  description: |-
                    Slippage represents the percentage offset from the current bid/ask price when placing a limit order. This adjustment helps ensure that orders are more likely to fill by accounting for potential price movements. Defaults to 0.002 if not set.
                api_token:
                  type: string
                  format: JWT
                  description: User API token with `newOrderWebhook` permission.
            examples:
              request_sample:
                value:
                  strategy_id: "<string>"
                  stock_id: "<string>"
                  action: "{{strategy.market_position}}"
                  leverage: 1.5
                  pyramiding: 5
                  api_token: "<string>"
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: "Endpoint-specific response payload, or an error message when `success` is false."
                    properties:
                      order_id:
                        $ref: '#/components/schemas/order_id'
                      strategy_id:
                        $ref: '#/components/schemas/strategy_id'
                      type:
                        type: string
                        enum: [ 'market', 'limit', 'stop_market', 'stop_limit', 'oco', 'liquidate' ]
                        description: "Type or category for this object."
                      action:
                        type: string
                        enum: [ 'buy', 'sell' ]
                        description: "Order or signal action."
                      stop_price:
                        type: [string, "null"]
                        description: "Stop trigger price."
                      price:
                        type: [string, "null"]
                        description: "Price or execution price, depending on context."
                      amount:
                        type: string
                        description: "Amount."
                      total:
                        type: [string, "null"]
                        description: "Total value; for positions/orders this is strategy-normalized unless documented otherwise."
                      created_at:
                        $ref: '#/components/schemas/created_at'
                      stock_id:
                        $ref: '#/components/schemas/stock_id'
                      figi_composite:
                        type: [string, "null"]
                        description: "Composite FIGI identifier when available."
                      symbol:
                        type: string
                        description: "Ticker or asset symbol."
                      name:
                        type: string
                        description: "Display name."
                      sector:
                        type: string
                        description: "Sector or asset category."
                      security:
                        type: string
                        enum: [ 'cryptocurrency', 'stock' ]
                        description: "Security type, such as stock or cryptocurrency."
                      exchange:
                        type: string
                        description: "Exchange code."
                      stock:
                        type: string
                        description: "Stock symbol as stored by AlphaInsider."
                      peg:
                        type: string
                        description: "Peg or quote currency."
                      provider:
                        type: string
                        enum: [ 'coinbase', 'binance', 'massive', 'alphainsider' ]
                        description: "External provider or data provider."
                      slippage:
                        type: string
                        description: "Slippage value or configured slippage fraction."
                      fee:
                        type: string
                        description: "Fee value."
                      links:
                        type: object
                        description: "External research and market-data links."
                      stock_status:
                        type: string
                        enum: [ 'active', 'deleted' ]
                        description: "Current stock status."
                      bid:
                        type: string
                        description: "Current bid price."
                      ask:
                        type: string
                        description: "Current ask price."
                      last:
                        type: string
                        description: "Last traded price."
                      order_dependencies:
                        type: array
                        description: "Order IDs this order is waiting on; `[]` means the order has no outstanding dependencies."
                        items:
                          type: string
              examples:
                '200':
                  value: { "success": true,"response": { "order_id": "qoppbNXH4lG0-4x21YLCp","strategy_id": "7Wy5AzIKY9bCmkIqjcLSg","type": "market","action": "sell","stop_price": null,"price": null,"amount": "0.000200000000000","total": null,"created_at": "2024-10-22T21:47:19.540Z","stock_id": "v3lhjrwEhNuAOxPT29oxO","figi_composite": null,"symbol": "ETH-USD","name": "Ethereum","sector": "Cryptocurrencies","security": "cryptocurrency","exchange": "COINBASE","stock": "ETH-USD","peg": "USD","provider": "coinbase","slippage": "0.000000000000000","fee": "0.002500000000000","links": { "trading_view": "https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE","yahoo_finance": "https://finance.yahoo.com/quote/ETH-USD","coin_marketcap": "https://coinmarketcap.com/currencies/ethereum/","google_finance": "https://www.google.com/finance/quote/ETH-USD" },"stock_status": "active","bid": "2633.43","ask": "2633.43","last": "2633.43","order_dependencies": [] } }
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  
components:
  # PARAMETERS
  parameters:
    api_token:
      in: header
      name: Authorization
      description: User API token.
      required: true
      schema:
        type: string
        format: JWT
    optional_api_token:
      in: header
      name: Authorization
      description: User API token.
      schema:
        type: string
        format: JWT

  # SCHEMAS
  schemas:
    success:
      type: boolean
      description: True when the request succeeded.
    created_at:
      type: string
      format: date-time
      description: Creation timestamp.
    updated_at:
      type: string
      format: date-time
      description: Last update timestamp.
    nullable_invoice_id:
      type: [ string, 'null' ]
      description: Invoice identifier, when one exists.
    nullable_end_date:
      type: [ string, 'null' ]
      format: date-time
      description: End timestamp for the current period or range.
    nullable_input_date:
      type: [ string, 'null' ]
      format: date-time
      description: Starting timestamp for relative strategy calculations.
    user_id:
      type: string
      description: AlphaInsider user identifier.
    strategy_id:
      type: string
      description: AlphaInsider strategy identifier.
    timeline_id:
      type: string
      description: Timeline event identifier.
    stock_id:
      type: string
      description: AlphaInsider stock identifier, or `SYMBOL:EXCHANGE` in requests.
    order_id:
      type: string
      description: Order identifier.
    source_id:
      type: string
      description: Payment source identifier.
    invoice_id:
      type: string
      description: Invoice identifier, when one exists.
    bot_id:
      type: string
      description: AlphaInsider bot identifier.
    bot_activity_id:
      type: string
      description: Bot activity identifier.
    timeframe:
      type: string
      description: Time window used for ranking or performance data.
      enum: [ 'day', 'week', 'month', 'year', 'five_year' ]
      default: 'month'
    billing_timeframe:
      type: string
      description: Billing period for account or product subscriptions.
      enum: [ 'month', 'year' ]
    frequency:
      type: number
      description: The number of intervals per tick.
      default: 1
    interval:
      type: string
      description: The timeframe per tick.
      enum: [ 'hour', 'day', 'week' ]
      default: 'hour'
    start_date:
      type: string
      format: date-time
      description: Start date.
    end_date:
      type: string
      format: date-time
      description: End timestamp for the current period or range.
    sort:
      type: string
      description: Sort results by.
      enum: [ 'top', 'trending', 'performance', 'popular', 'newest' ]
      default: 'top'
    limit:
      type: number
      description: Number of results to return.
    offset_id:
      type: string
      description: Offet by ID. Used for pagination.
    input_value:
      type: number
      description: Relative starting balance.
    input_date:
      type: string
      format: date-time
      description: Starting timestamp for relative strategy calculations.
    broker_keys:
      type: object
      description: Broker keys.
      properties:
        live:
          type: boolean
          description: Live or paper account.
        bitfinex_key:
          type: string
          description: Bitfinex key.
        bitfinex_secret:
          type: string
          description: Bitfinex secret.
        binance_key:
          type: string
          description: Binance key.
        binance_secret:
          type: string
          description: Binance secret.
        alpaca_key:
          type: string
          description: Alpaca key.
        alpaca_secret:
          type: string
          description: Alpaca secret.
        hyperliquid_key:
          type: string
          description: Hyperliquid key.
        hyperliquid_secret:
          type: string
          description: Hyperliquid secret.
    allocations:
      type: object
      description: Array of positions, in percents, for the strategy to go into.
      required:
        - stock_id
        - action
        - percent
      properties:
        stock_id:
          $ref: '#/components/schemas/stock_id'
        action:
          type: string
          description: |-
            Order actions. Action "buy" is the same as "long", "sell" is the same as "short", "close" is the same as "flat". When using "close" or "flat", the percent is set to 0—ignoring any percent passed.
          enum: [ 'buy', 'long', 'sell', 'short', 'close', 'flat' ]
        percent:
          type: number
          description: The final position size, expressed as a positive decimal fraction of your equity (e.g., TSLA long 1.5 for a 150% long position in TSLA). Values must be positive decimals ranging from 0 to 2, with the sum of all allocations not exceeding the maximum leverage of 2 (or 200%).
          minimum: 0
          maximum: 2
          multipleOf: 0.0001
          

  # RESPONSES
  responses:
    '400':
      description: Request failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                description: "False when the request failed."
              response:
                type: string
                description: "Error message."
          examples:
            '400':
              value: {"success": false, "response": "Request failed."}
    '401':
      description: Authentication failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                description: "False when the request failed."
              response:
                type: string
                description: "Error message."
          examples:
            '401':
              value: {"success": false, "response": "Authentication failed."}
    '429':
      description: Rate limit reached.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                description: "False when the request failed."
              response:
                type: string
                description: "Error message."
          examples:
            '429':
              value: {"success": false, "response": "Rate limit reached."}
