Class RebalancingApi

java.lang.Object
markets.alpaca.client.openapi.broker.api.RebalancingApi

public class RebalancingApi extends Object
Generated client for RebalancingApi operations.

This class is generated from the configured OpenAPI spec. Operation method Javadocs include OAS summaries, descriptions, parameters, return types, response details, and external documentation links when present in the spec.

Operations

  • deleteV1RebalancingPortfoliosPortfolioId: Inactivate Portfolio By ID
  • deleteV1RebalancingRunsRunId: Cancel Run by ID
  • deleteV1RebalancingSubscriptionsSubscriptionId: Unsubscribe Account (Delete Subscription)
  • getV1RebalancingPortfolios: List Portfolios
  • getV1RebalancingPortfoliosPortfolioId: Get Portfolio by ID
  • getV1RebalancingRuns: List All Runs.
  • getV1RebalancingRunsRunId: Get Run by ID
  • getV1RebalancingSubscriptions: List All Subscriptions
  • getV1RebalancingSubscriptionsSubscriptionId: Get Subscription by ID
  • patchV1RebalancingPortfoliosPortfolioId: Update Portfolio by ID
  • postV1RebalancingPortfolios: Create Portfolio
  • postV1RebalancingRuns: Create Run
  • postV1RebalancingSubscriptions: Create Subscription
  • Constructor Details

    • RebalancingApi

      public RebalancingApi()
    • RebalancingApi

      public RebalancingApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • getHostIndex

      public int getHostIndex()
    • setHostIndex

      public void setHostIndex(int hostIndex)
    • getCustomBaseUrl

      public String getCustomBaseUrl()
    • setCustomBaseUrl

      public void setCustomBaseUrl(String customBaseUrl)
    • deleteV1RebalancingPortfoliosPortfolioIdCall

      public okhttp3.Call deleteV1RebalancingPortfoliosPortfolioIdCall(@Nonnull String portfolioId, ApiCallback _callback) throws ApiException
      Build call for deleteV1RebalancingPortfoliosPortfolioId
      Parameters:
      portfolioId - The Portfolio ID (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingPortfoliosPortfolioId

      public void deleteV1RebalancingPortfoliosPortfolioId(@Nonnull String portfolioId) throws ApiException
      Inactivate Portfolio By ID Archives a portfolio (soft delete). Only permitted when the portfolio has no active subscriptions. Archived portfolios are hidden from the default list response and cannot be used for new subscriptions.
      Parameters:
      portfolioId - The Portfolio ID (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingPortfoliosPortfolioIdWithHttpInfo

      public ApiResponse<Void> deleteV1RebalancingPortfoliosPortfolioIdWithHttpInfo(@Nonnull String portfolioId) throws ApiException
      Inactivate Portfolio By ID Archives a portfolio (soft delete). Only permitted when the portfolio has no active subscriptions. Archived portfolios are hidden from the default list response and cannot be used for new subscriptions.
      Parameters:
      portfolioId - The Portfolio ID (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingPortfoliosPortfolioIdAsync

      public okhttp3.Call deleteV1RebalancingPortfoliosPortfolioIdAsync(@Nonnull String portfolioId, ApiCallback<Void> _callback) throws ApiException
      Inactivate Portfolio By ID (asynchronously) Archives a portfolio (soft delete). Only permitted when the portfolio has no active subscriptions. Archived portfolios are hidden from the default list response and cannot be used for new subscriptions.
      Parameters:
      portfolioId - The Portfolio ID (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingRunsRunIdCall

      public okhttp3.Call deleteV1RebalancingRunsRunIdCall(@Nonnull String runId, ApiCallback _callback) throws ApiException
      Build call for deleteV1RebalancingRunsRunId
      Parameters:
      runId - the id of the portfolio run (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingRunsRunId

      public void deleteV1RebalancingRunsRunId(@Nonnull String runId) throws ApiException
      Cancel Run by ID Cancels a run so it does not start, or is not retried. Only a run in QUEUED or IN_PROGRESS can be canceled. A run in any other status is rejected. Canceling does not stop a run that is already placing orders: those orders are not canceled, and the run's final status can replace CANCELED.
      Parameters:
      runId - the id of the portfolio run (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingRunsRunIdWithHttpInfo

      public ApiResponse<Void> deleteV1RebalancingRunsRunIdWithHttpInfo(@Nonnull String runId) throws ApiException
      Cancel Run by ID Cancels a run so it does not start, or is not retried. Only a run in QUEUED or IN_PROGRESS can be canceled. A run in any other status is rejected. Canceling does not stop a run that is already placing orders: those orders are not canceled, and the run's final status can replace CANCELED.
      Parameters:
      runId - the id of the portfolio run (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingRunsRunIdAsync

      public okhttp3.Call deleteV1RebalancingRunsRunIdAsync(@Nonnull String runId, ApiCallback<Void> _callback) throws ApiException
      Cancel Run by ID (asynchronously) Cancels a run so it does not start, or is not retried. Only a run in QUEUED or IN_PROGRESS can be canceled. A run in any other status is rejected. Canceling does not stop a run that is already placing orders: those orders are not canceled, and the run's final status can replace CANCELED.
      Parameters:
      runId - the id of the portfolio run (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingSubscriptionsSubscriptionIdCall

      public okhttp3.Call deleteV1RebalancingSubscriptionsSubscriptionIdCall(@Nonnull String subscriptionId, ApiCallback _callback) throws ApiException
      Build call for deleteV1RebalancingSubscriptionsSubscriptionId
      Parameters:
      subscriptionId - (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingSubscriptionsSubscriptionId

      public void deleteV1RebalancingSubscriptionsSubscriptionId(@Nonnull String subscriptionId) throws ApiException
      Unsubscribe Account (Delete Subscription) Deletes the subscription which stops the rebalancing of an account.
      Parameters:
      subscriptionId - (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingSubscriptionsSubscriptionIdWithHttpInfo

      public ApiResponse<Void> deleteV1RebalancingSubscriptionsSubscriptionIdWithHttpInfo(@Nonnull String subscriptionId) throws ApiException
      Unsubscribe Account (Delete Subscription) Deletes the subscription which stops the rebalancing of an account.
      Parameters:
      subscriptionId - (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • deleteV1RebalancingSubscriptionsSubscriptionIdAsync

      public okhttp3.Call deleteV1RebalancingSubscriptionsSubscriptionIdAsync(@Nonnull String subscriptionId, ApiCallback<Void> _callback) throws ApiException
      Unsubscribe Account (Delete Subscription) (asynchronously) Deletes the subscription which stops the rebalancing of an account.
      Parameters:
      subscriptionId - (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 No Content -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosCall

      public okhttp3.Call getV1RebalancingPortfoliosCall(@Nullable String name, @Nullable String description, @Nullable String symbol, @Nullable String portfolioId, @Nullable String status, ApiCallback _callback) throws ApiException
      Build call for getV1RebalancingPortfolios
      Parameters:
      name - Name of portfolio (optional)
      description - Description of portfolio (optional)
      symbol - Symbol included in portfolio (optional)
      portfolioId - Portfolio ID (optional)
      status - Portfolio Status (optional)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 Array of Portfolios -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfolios

      public List<Portfolio> getV1RebalancingPortfolios(@Nullable String name, @Nullable String description, @Nullable String symbol, @Nullable String portfolioId, @Nullable String status) throws ApiException
      List Portfolios Lists portfolios. When more than one query parameter is passed, only portfolios meeting all provided values will be returned (logical AND between parameter values).
      Parameters:
      name - Name of portfolio (optional)
      description - Description of portfolio (optional)
      symbol - Symbol included in portfolio (optional)
      portfolioId - Portfolio ID (optional)
      status - Portfolio Status (optional)
      Returns:
      List<Portfolio>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 Array of Portfolios -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosWithHttpInfo

      public ApiResponse<List<Portfolio>> getV1RebalancingPortfoliosWithHttpInfo(@Nullable String name, @Nullable String description, @Nullable String symbol, @Nullable String portfolioId, @Nullable String status) throws ApiException
      List Portfolios Lists portfolios. When more than one query parameter is passed, only portfolios meeting all provided values will be returned (logical AND between parameter values).
      Parameters:
      name - Name of portfolio (optional)
      description - Description of portfolio (optional)
      symbol - Symbol included in portfolio (optional)
      portfolioId - Portfolio ID (optional)
      status - Portfolio Status (optional)
      Returns:
      ApiResponse<List<Portfolio>>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 Array of Portfolios -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosAsync

      public okhttp3.Call getV1RebalancingPortfoliosAsync(@Nullable String name, @Nullable String description, @Nullable String symbol, @Nullable String portfolioId, @Nullable String status, ApiCallback<List<Portfolio>> _callback) throws ApiException
      List Portfolios (asynchronously) Lists portfolios. When more than one query parameter is passed, only portfolios meeting all provided values will be returned (logical AND between parameter values).
      Parameters:
      name - Name of portfolio (optional)
      description - Description of portfolio (optional)
      symbol - Symbol included in portfolio (optional)
      portfolioId - Portfolio ID (optional)
      status - Portfolio Status (optional)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 Array of Portfolios -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosPortfolioIdCall

      public okhttp3.Call getV1RebalancingPortfoliosPortfolioIdCall(@Nonnull String portfolioId, ApiCallback _callback) throws ApiException
      Build call for getV1RebalancingPortfoliosPortfolioId
      Parameters:
      portfolioId - The Portfolio ID (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosPortfolioId

      public Portfolio getV1RebalancingPortfoliosPortfolioId(@Nonnull String portfolioId) throws ApiException
      Get Portfolio by ID Get a portfolio by its ID.
      Parameters:
      portfolioId - The Portfolio ID (required)
      Returns:
      Portfolio
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosPortfolioIdWithHttpInfo

      public ApiResponse<Portfolio> getV1RebalancingPortfoliosPortfolioIdWithHttpInfo(@Nonnull String portfolioId) throws ApiException
      Get Portfolio by ID Get a portfolio by its ID.
      Parameters:
      portfolioId - The Portfolio ID (required)
      Returns:
      ApiResponse<Portfolio>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingPortfoliosPortfolioIdAsync

      public okhttp3.Call getV1RebalancingPortfoliosPortfolioIdAsync(@Nonnull String portfolioId, ApiCallback<Portfolio> _callback) throws ApiException
      Get Portfolio by ID (asynchronously) Get a portfolio by its ID.
      Parameters:
      portfolioId - The Portfolio ID (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsCall

      public okhttp3.Call getV1RebalancingRunsCall(@Nullable String accountId, @Nullable String status, @Nullable String type, @Nullable Integer pageToken, @Nullable Integer limit, ApiCallback _callback) throws ApiException
      Build call for getV1RebalancingRuns
      Parameters:
      accountId - Any runs for this account_id will be returned (optional)
      status - Status of portfolio run to filter by (optional)
      type - Type of portfolio run (full_rebalance, invest_cash) (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of runs to return. Defaults to 100. (optional, default to 100)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The runs which match the query -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRuns

      public GetV1RebalancingRuns200Response getV1RebalancingRuns(@Nullable String accountId, @Nullable String status, @Nullable String type, @Nullable Integer pageToken, @Nullable Integer limit) throws ApiException
      List All Runs. Lists runs.
      Parameters:
      accountId - Any runs for this account_id will be returned (optional)
      status - Status of portfolio run to filter by (optional)
      type - Type of portfolio run (full_rebalance, invest_cash) (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of runs to return. Defaults to 100. (optional, default to 100)
      Returns:
      GetV1RebalancingRuns200Response
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The runs which match the query -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsWithHttpInfo

      public ApiResponse<GetV1RebalancingRuns200Response> getV1RebalancingRunsWithHttpInfo(@Nullable String accountId, @Nullable String status, @Nullable String type, @Nullable Integer pageToken, @Nullable Integer limit) throws ApiException
      List All Runs. Lists runs.
      Parameters:
      accountId - Any runs for this account_id will be returned (optional)
      status - Status of portfolio run to filter by (optional)
      type - Type of portfolio run (full_rebalance, invest_cash) (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of runs to return. Defaults to 100. (optional, default to 100)
      Returns:
      ApiResponse<GetV1RebalancingRuns200Response>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The runs which match the query -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsAsync

      public okhttp3.Call getV1RebalancingRunsAsync(@Nullable String accountId, @Nullable String status, @Nullable String type, @Nullable Integer pageToken, @Nullable Integer limit, ApiCallback<GetV1RebalancingRuns200Response> _callback) throws ApiException
      List All Runs. (asynchronously) Lists runs.
      Parameters:
      accountId - Any runs for this account_id will be returned (optional)
      status - Status of portfolio run to filter by (optional)
      type - Type of portfolio run (full_rebalance, invest_cash) (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of runs to return. Defaults to 100. (optional, default to 100)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The runs which match the query -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsRunIdCall

      public okhttp3.Call getV1RebalancingRunsRunIdCall(@Nonnull String runId, ApiCallback _callback) throws ApiException
      Build call for getV1RebalancingRunsRunId
      Parameters:
      runId - the id of the portfolio run (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The run object -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsRunId

      public PortfolioRun getV1RebalancingRunsRunId(@Nonnull String runId) throws ApiException
      Get Run by ID Get a run by its ID.
      Parameters:
      runId - the id of the portfolio run (required)
      Returns:
      PortfolioRun
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The run object -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsRunIdWithHttpInfo

      public ApiResponse<PortfolioRun> getV1RebalancingRunsRunIdWithHttpInfo(@Nonnull String runId) throws ApiException
      Get Run by ID Get a run by its ID.
      Parameters:
      runId - the id of the portfolio run (required)
      Returns:
      ApiResponse<PortfolioRun>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The run object -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingRunsRunIdAsync

      public okhttp3.Call getV1RebalancingRunsRunIdAsync(@Nonnull String runId, ApiCallback<PortfolioRun> _callback) throws ApiException
      Get Run by ID (asynchronously) Get a run by its ID.
      Parameters:
      runId - the id of the portfolio run (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The run object -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No rebalance run with this ID exists for your correspondent. Check the run ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsCall

      public okhttp3.Call getV1RebalancingSubscriptionsCall(@Nullable String accountId, @Nullable String portfolioId, @Nullable Integer pageToken, @Nullable Integer limit, ApiCallback _callback) throws ApiException
      Build call for getV1RebalancingSubscriptions
      Parameters:
      accountId - Any subscriptions for this account_id will be returned (optional)
      portfolioId - Portfolio ID (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of subscriptions to return. Defaults to 100. (optional, default to 100)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptions

      public GetV1RebalancingSubscriptions200Response getV1RebalancingSubscriptions(@Nullable String accountId, @Nullable String portfolioId, @Nullable Integer pageToken, @Nullable Integer limit) throws ApiException
      List All Subscriptions Lists subscriptions
      Parameters:
      accountId - Any subscriptions for this account_id will be returned (optional)
      portfolioId - Portfolio ID (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of subscriptions to return. Defaults to 100. (optional, default to 100)
      Returns:
      GetV1RebalancingSubscriptions200Response
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsWithHttpInfo

      public ApiResponse<GetV1RebalancingSubscriptions200Response> getV1RebalancingSubscriptionsWithHttpInfo(@Nullable String accountId, @Nullable String portfolioId, @Nullable Integer pageToken, @Nullable Integer limit) throws ApiException
      List All Subscriptions Lists subscriptions
      Parameters:
      accountId - Any subscriptions for this account_id will be returned (optional)
      portfolioId - Portfolio ID (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of subscriptions to return. Defaults to 100. (optional, default to 100)
      Returns:
      ApiResponse<GetV1RebalancingSubscriptions200Response>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsAsync

      public okhttp3.Call getV1RebalancingSubscriptionsAsync(@Nullable String accountId, @Nullable String portfolioId, @Nullable Integer pageToken, @Nullable Integer limit, ApiCallback<GetV1RebalancingSubscriptions200Response> _callback) throws ApiException
      List All Subscriptions (asynchronously) Lists subscriptions
      Parameters:
      accountId - Any subscriptions for this account_id will be returned (optional)
      portfolioId - Portfolio ID (optional)
      pageToken - Offset into the result set for pagination. Defaults to 0 when omitted. (optional, default to 0)
      limit - Maximum number of subscriptions to return. Defaults to 100. (optional, default to 100)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsSubscriptionIdCall

      public okhttp3.Call getV1RebalancingSubscriptionsSubscriptionIdCall(@Nonnull String subscriptionId, ApiCallback _callback) throws ApiException
      Build call for getV1RebalancingSubscriptionsSubscriptionId
      Parameters:
      subscriptionId - (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The portfolio subscription -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No subscription with this ID exists for your correspondent. Check the subscription ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsSubscriptionId

      public PortfolioSubscription getV1RebalancingSubscriptionsSubscriptionId(@Nonnull String subscriptionId) throws ApiException
      Get Subscription by ID Get a subscription by its ID.
      Parameters:
      subscriptionId - (required)
      Returns:
      PortfolioSubscription
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The portfolio subscription -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No subscription with this ID exists for your correspondent. Check the subscription ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsSubscriptionIdWithHttpInfo

      public ApiResponse<PortfolioSubscription> getV1RebalancingSubscriptionsSubscriptionIdWithHttpInfo(@Nonnull String subscriptionId) throws ApiException
      Get Subscription by ID Get a subscription by its ID.
      Parameters:
      subscriptionId - (required)
      Returns:
      ApiResponse<PortfolioSubscription>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The portfolio subscription -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No subscription with this ID exists for your correspondent. Check the subscription ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • getV1RebalancingSubscriptionsSubscriptionIdAsync

      public okhttp3.Call getV1RebalancingSubscriptionsSubscriptionIdAsync(@Nonnull String subscriptionId, ApiCallback<PortfolioSubscription> _callback) throws ApiException
      Get Subscription by ID (asynchronously) Get a subscription by its ID.
      Parameters:
      subscriptionId - (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The portfolio subscription -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No subscription with this ID exists for your correspondent. Check the subscription ID and try again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • patchV1RebalancingPortfoliosPortfolioIdCall

      public okhttp3.Call patchV1RebalancingPortfoliosPortfolioIdCall(@Nonnull String portfolioId, @Nullable PatchV1RebalancingPortfoliosPortfolioIdRequest patchV1RebalancingPortfoliosPortfolioIdRequest, ApiCallback _callback) throws ApiException
      Build call for patchV1RebalancingPortfoliosPortfolioId
      Parameters:
      portfolioId - The Portfolio ID (required)
      patchV1RebalancingPortfoliosPortfolioIdRequest - (optional)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The updated portfolio -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • patchV1RebalancingPortfoliosPortfolioId

      public Portfolio patchV1RebalancingPortfoliosPortfolioId(@Nonnull String portfolioId, @Nullable PatchV1RebalancingPortfoliosPortfolioIdRequest patchV1RebalancingPortfoliosPortfolioIdRequest) throws ApiException
      Update Portfolio by ID Updates a portfolio. Only the fields provided are changed, and at least one of name, description, cooldown_days, weights, or rebalance_conditions is required. Omitting rebalance_conditions leaves the existing conditions unchanged; sending an empty array removes every condition. Updating a portfolio does not rebalance subscribed accounts by itself: each account is rebalanced the next time one of the portfolio's rebalance conditions is met during normal market hours, using the updated weights, and not while that account's cooldown is active. A portfolio with no rebalance conditions is rebalanced only when triggered manually.
      Parameters:
      portfolioId - The Portfolio ID (required)
      patchV1RebalancingPortfoliosPortfolioIdRequest - (optional)
      Returns:
      Portfolio
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The updated portfolio -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • patchV1RebalancingPortfoliosPortfolioIdWithHttpInfo

      public ApiResponse<Portfolio> patchV1RebalancingPortfoliosPortfolioIdWithHttpInfo(@Nonnull String portfolioId, @Nullable PatchV1RebalancingPortfoliosPortfolioIdRequest patchV1RebalancingPortfoliosPortfolioIdRequest) throws ApiException
      Update Portfolio by ID Updates a portfolio. Only the fields provided are changed, and at least one of name, description, cooldown_days, weights, or rebalance_conditions is required. Omitting rebalance_conditions leaves the existing conditions unchanged; sending an empty array removes every condition. Updating a portfolio does not rebalance subscribed accounts by itself: each account is rebalanced the next time one of the portfolio's rebalance conditions is met during normal market hours, using the updated weights, and not while that account's cooldown is active. A portfolio with no rebalance conditions is rebalanced only when triggered manually.
      Parameters:
      portfolioId - The Portfolio ID (required)
      patchV1RebalancingPortfoliosPortfolioIdRequest - (optional)
      Returns:
      ApiResponse<Portfolio>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The updated portfolio -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • patchV1RebalancingPortfoliosPortfolioIdAsync

      public okhttp3.Call patchV1RebalancingPortfoliosPortfolioIdAsync(@Nonnull String portfolioId, @Nullable PatchV1RebalancingPortfoliosPortfolioIdRequest patchV1RebalancingPortfoliosPortfolioIdRequest, ApiCallback<Portfolio> _callback) throws ApiException
      Update Portfolio by ID (asynchronously) Updates a portfolio. Only the fields provided are changed, and at least one of name, description, cooldown_days, weights, or rebalance_conditions is required. Omitting rebalance_conditions leaves the existing conditions unchanged; sending an empty array removes every condition. Updating a portfolio does not rebalance subscribed accounts by itself: each account is rebalanced the next time one of the portfolio's rebalance conditions is met during normal market hours, using the updated weights, and not while that account's cooldown is active. A portfolio with no rebalance conditions is rebalanced only when triggered manually.
      Parameters:
      portfolioId - The Portfolio ID (required)
      patchV1RebalancingPortfoliosPortfolioIdRequest - (optional)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 The updated portfolio -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      404 No portfolio with this ID exists for your correspondent. Check the portfolio ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Retry with backoff. If it keeps happening, contact support. -
    • postV1RebalancingPortfoliosCall

      public okhttp3.Call postV1RebalancingPortfoliosCall(@Nullable PostV1RebalancingPortfoliosRequest postV1RebalancingPortfoliosRequest, ApiCallback _callback) throws ApiException
      Build call for postV1RebalancingPortfolios
      Parameters:
      postV1RebalancingPortfoliosRequest - (optional)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the portfolio was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingPortfolios

      public Portfolio postV1RebalancingPortfolios(@Nullable PostV1RebalancingPortfoliosRequest postV1RebalancingPortfoliosRequest) throws ApiException
      Create Portfolio Creates a portfolio allocation containing securities and/or cash. Having no rebalancing conditions is allowed but the rebalance event would need to be triggered manually. Portfolios created with API may have multiple rebalance_conditions, but only one of type calendar.
      Parameters:
      postV1RebalancingPortfoliosRequest - (optional)
      Returns:
      Portfolio
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the portfolio was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingPortfoliosWithHttpInfo

      public ApiResponse<Portfolio> postV1RebalancingPortfoliosWithHttpInfo(@Nullable PostV1RebalancingPortfoliosRequest postV1RebalancingPortfoliosRequest) throws ApiException
      Create Portfolio Creates a portfolio allocation containing securities and/or cash. Having no rebalancing conditions is allowed but the rebalance event would need to be triggered manually. Portfolios created with API may have multiple rebalance_conditions, but only one of type calendar.
      Parameters:
      postV1RebalancingPortfoliosRequest - (optional)
      Returns:
      ApiResponse<Portfolio>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the portfolio was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingPortfoliosAsync

      public okhttp3.Call postV1RebalancingPortfoliosAsync(@Nullable PostV1RebalancingPortfoliosRequest postV1RebalancingPortfoliosRequest, ApiCallback<Portfolio> _callback) throws ApiException
      Create Portfolio (asynchronously) Creates a portfolio allocation containing securities and/or cash. Having no rebalancing conditions is allowed but the rebalance event would need to be triggered manually. Portfolios created with API may have multiple rebalance_conditions, but only one of type calendar.
      Parameters:
      postV1RebalancingPortfoliosRequest - (optional)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the portfolio was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingRunsCall

      public okhttp3.Call postV1RebalancingRunsCall(@Nonnull PostV1RebalancingRunsRequest postV1RebalancingRunsRequest, ApiCallback _callback) throws ApiException
      Build call for postV1RebalancingRuns
      Parameters:
      postV1RebalancingRunsRequest - (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 The resource does not exist or is not visible to this correspondent. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the run was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingRuns

      public void postV1RebalancingRuns(@Nonnull PostV1RebalancingRunsRequest postV1RebalancingRunsRequest) throws ApiException
      Create Run Creates a rebalance run. Omit `weights` or provide an empty array to create a subscription-driven run using the account's active subscription. Provide a non-empty `weights` array to create a manual one-off run. A manual run is rejected if the account already has an active subscription. The determination of a run's orders and the execution of a run take place during normal market hours. Runs can be initiated outside normal market hours but remain `QUEUED` until normal market hours. Only one run in a non-terminal status is allowed at any time.
      Parameters:
      postV1RebalancingRunsRequest - (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 The resource does not exist or is not visible to this correspondent. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the run was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingRunsWithHttpInfo

      public ApiResponse<Void> postV1RebalancingRunsWithHttpInfo(@Nonnull PostV1RebalancingRunsRequest postV1RebalancingRunsRequest) throws ApiException
      Create Run Creates a rebalance run. Omit `weights` or provide an empty array to create a subscription-driven run using the account's active subscription. Provide a non-empty `weights` array to create a manual one-off run. A manual run is rejected if the account already has an active subscription. The determination of a run's orders and the execution of a run take place during normal market hours. Runs can be initiated outside normal market hours but remain `QUEUED` until normal market hours. Only one run in a non-terminal status is allowed at any time.
      Parameters:
      postV1RebalancingRunsRequest - (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 The resource does not exist or is not visible to this correspondent. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the run was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingRunsAsync

      public okhttp3.Call postV1RebalancingRunsAsync(@Nonnull PostV1RebalancingRunsRequest postV1RebalancingRunsRequest, ApiCallback<Void> _callback) throws ApiException
      Create Run (asynchronously) Creates a rebalance run. Omit `weights` or provide an empty array to create a subscription-driven run using the account's active subscription. Provide a non-empty `weights` array to create a manual one-off run. A manual run is rejected if the account already has an active subscription. The determination of a run's orders and the execution of a run take place during normal market hours. Runs can be initiated outside normal market hours but remain `QUEUED` until normal market hours. Only one run in a non-terminal status is allowed at any time.
      Parameters:
      postV1RebalancingRunsRequest - (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 The resource does not exist or is not visible to this correspondent. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the run was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingSubscriptionsCall

      public okhttp3.Call postV1RebalancingSubscriptionsCall(@Nullable PostV1RebalancingSubscriptionsRequest postV1RebalancingSubscriptionsRequest, ApiCallback _callback) throws ApiException
      Build call for postV1RebalancingSubscriptions
      Parameters:
      postV1RebalancingSubscriptionsRequest - (optional)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 No account with that ID exists for your correspondent. Check the account ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the subscription was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingSubscriptions

      public PortfolioSubscription postV1RebalancingSubscriptions(@Nullable PostV1RebalancingSubscriptionsRequest postV1RebalancingSubscriptionsRequest) throws ApiException
      Create Subscription Creates a subscription between an account and a portfolio. `trade_marker` is optional. Omitting it means `discretionary`. A discretionary subscription is rejected with 422 unless the correspondent's advisor is marked discretionary. Send `unsolicited` to create the subscription without that advisor flag. Existing subscriptions created before trade markers return `trade_marker: null` and their orders stay unmarked.
      Parameters:
      postV1RebalancingSubscriptionsRequest - (optional)
      Returns:
      PortfolioSubscription
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 No account with that ID exists for your correspondent. Check the account ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the subscription was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingSubscriptionsWithHttpInfo

      public ApiResponse<PortfolioSubscription> postV1RebalancingSubscriptionsWithHttpInfo(@Nullable PostV1RebalancingSubscriptionsRequest postV1RebalancingSubscriptionsRequest) throws ApiException
      Create Subscription Creates a subscription between an account and a portfolio. `trade_marker` is optional. Omitting it means `discretionary`. A discretionary subscription is rejected with 422 unless the correspondent's advisor is marked discretionary. Send `unsolicited` to create the subscription without that advisor flag. Existing subscriptions created before trade markers return `trade_marker: null` and their orders stay unmarked.
      Parameters:
      postV1RebalancingSubscriptionsRequest - (optional)
      Returns:
      ApiResponse<PortfolioSubscription>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 No account with that ID exists for your correspondent. Check the account ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the subscription was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -
    • postV1RebalancingSubscriptionsAsync

      public okhttp3.Call postV1RebalancingSubscriptionsAsync(@Nullable PostV1RebalancingSubscriptionsRequest postV1RebalancingSubscriptionsRequest, ApiCallback<PortfolioSubscription> _callback) throws ApiException
      Create Subscription (asynchronously) Creates a subscription between an account and a portfolio. `trade_marker` is optional. Omitting it means `discretionary`. A discretionary subscription is rejected with 422 unless the correspondent's advisor is marked discretionary. Send `unsolicited` to create the subscription without that advisor flag. Existing subscriptions created before trade markers return `trade_marker: null` and their orders stay unmarked.
      Parameters:
      postV1RebalancingSubscriptionsRequest - (optional)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      400 The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again. -
      401 The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again. -
      403 These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account. -
      404 No account with that ID exists for your correspondent. Check the account ID and try again. -
      415 The Content-Type header is not application/json. Set Content-Type to application/json and send the body again. -
      422 The request failed validation or cannot be completed in its current state. The message describes the reason. -
      500 Something went wrong on our side while handling the request. Check whether the subscription was created before retrying, because this request is not idempotent. If it keeps happening, contact support. -