> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glider.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio Automation Start

> Start automated rebalancing for a portfolio

Starts automated rebalancing for a portfolio.

<ParamField path="portfolioId" type="string" required>
  The unique identifier of the portfolio
</ParamField>

<ParamField body="runRebalanceImmediately" type="boolean" default="false">
  Whether to run an initial rebalance immediately after starting
</ParamField>

<ParamField body="initializeScheduleAutomatically" type="boolean" default="true">
  Set to false for manual-only rebalancing without a schedule
</ParamField>

<ParamField body="interval" type="number" default="21600000">
  Rebalance interval in milliseconds (default: 6 hours)
</ParamField>

<ParamField header="X-API-KEY" type="string" required>
  Your API key for authentication
</ParamField>

<ParamField header="Content-Type" type="string" default="application/json">
  The format of the request body
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/schedule/start' \
    --header 'Content-Type: application/json' \
    --header 'X-API-KEY: your_api_key_here' \
    --data '{
      "runRebalanceImmediately": true,
      "initializeScheduleAutomatically": true,
      "interval": 21600000
    }'
  ```

  ```javascript JavaScript theme={null}
  const portfolioId = "port_abc123";
  const startResponse = await fetch(
    `https://api.glider.fi/v1/portfolio/${portfolioId}/rebalance/schedule/start`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "X-API-KEY": "your_api_key_here",
      },
      body: JSON.stringify({
        runRebalanceImmediately: true, // Run initial rebalance immediately
        initializeScheduleAutomatically: true, // Set to false for manual-only rebalancing
        interval: 21600000, // 6 hours in milliseconds
      }),
    }
  );

  const startResult = await startResponse.json();
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "portfolioId": "port_abc123",
      "rebalanceScheduleId": "sched_abc123",
      "status": "started",
      "message": "Portfolio automation started successfully",
      "runRebalanceImmediately": true,
      "isAutomated": true,
      "intervalMs": 21600000
    },
    "correlationId": "corr_abc123",
    "requestId": "req_xyz789",
    "timestamp": "2023-05-21T13:45:12.345Z"
  }
  ```
</ResponseExample>
