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

# updateStrategy

> Update existing strategy.



## OpenAPI

````yaml /openapi.yaml post /updateStrategy
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
security: []
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:
  /updateStrategy:
    post:
      tags:
        - Strategies
      summary: updateStrategy
      description: Update existing strategy.
      operationId: updateStrategy
      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'
components:
  parameters:
    api_token:
      in: header
      name: Authorization
      description: User API token.
      required: true
      schema:
        type: string
        format: JWT
  schemas:
    strategy_id:
      type: string
      description: AlphaInsider strategy identifier.
    input_value:
      type: number
      description: Relative starting balance.
    success:
      type: boolean
      description: True when the request succeeded.
    user_id:
      type: string
      description: AlphaInsider user identifier.
    updated_at:
      type: string
      format: date-time
      description: Last update timestamp.
    created_at:
      type: string
      format: date-time
      description: Creation timestamp.
    timeframe:
      type: string
      description: Time window used for ranking or performance data.
      enum:
        - day
        - week
        - month
        - year
        - five_year
      default: month
  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.

````