> ## 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.

# updateAccountSubscription

> Update account subscription.



## OpenAPI

````yaml /openapi.yaml post /updateAccountSubscription
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:
  /updateAccountSubscription:
    post:
      tags:
        - Subscriptions
      summary: updateAccountSubscription
      description: Update account subscription.
      operationId: updateAccountSubscription
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - timeframe
              properties:
                type:
                  type: string
                  description: Account subscription tier.
                  enum:
                    - standard
                    - pro
                    - premium
                timeframe:
                  type: string
                  description: Account subscription timeframe.
                  enum:
                    - month
                    - year
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: object
                    description: >-
                      Endpoint-specific response payload, or an error message
                      when `success` is false.
                    properties:
                      account_subscription_id:
                        type: string
                        description: Account subscription identifier.
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      status:
                        type: string
                        enum:
                          - pending
                          - active
                        description: Current status.
                      product_id:
                        type: string
                        description: Billing product identifier.
                      type:
                        type: string
                        description: Type or category for this object.
                      timeframe:
                        $ref: '#/components/schemas/billing_timeframe'
                      level:
                        type: integer
                        description: Subscription tier level.
                      name:
                        type: string
                        description: Display name.
                      next_product_id:
                        type: string
                        description: >-
                          Next billing product identifier after a pending
                          change.
                      next_type:
                        type: string
                        description: Next account subscription type after a pending change.
                      next_timeframe:
                        $ref: '#/components/schemas/billing_timeframe'
                      next_level:
                        type: integer
                        description: Next subscription tier level after a pending change.
                      next_name:
                        type: string
                        description: >-
                          Next account subscription display name after a pending
                          change.
                      invoice_id:
                        $ref: '#/components/schemas/invoice_id'
                      limits:
                        type: object
                        description: Account or tier operational limits.
                        properties:
                          new_order:
                            type: integer
                            description: >-
                              Maximum successful `/newOrder` requests per day
                              per strategy.
                          new_post:
                            type: integer
                            description: >-
                              Maximum successful `/newPost` requests per day per
                              strategy.
                          like:
                            type: integer
                            description: Maximum successful `/like` requests per day.
                          max_sessions:
                            type: integer
                            description: Maximum number of active sessions.
                          max_api_tokens:
                            type: integer
                            description: Maximum number of API tokens.
                          max_strategies:
                            type: integer
                            description: >-
                              Maximum number of strategies the account can
                              create.
                          max_subscriptions:
                            type: integer
                            description: Maximum number of strategy subscriptions.
                          max_open_orders:
                            type: integer
                            description: Maximum number of open orders per strategy.
                          max_bots:
                            type: integer
                            description: Maximum number of bots.
                      end_date:
                        $ref: '#/components/schemas/nullable_end_date'
                      updated_at:
                        $ref: '#/components/schemas/updated_at'
                      created_at:
                        $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value:
                    success: true
                    response:
                      account_subscription_id: oPajv9WU3wtwtBYLQxm4z
                      user_id: user_1
                      status: pending
                      product_id: 7wswTAd1xbDAEQkPhbBn6
                      type: standard
                      timeframe: month
                      level: 0
                      name: Standard Account Subscription
                      next_product_id: qkV9qPfpxr4wWMaZKprdI
                      next_type: pro
                      next_timeframe: month
                      next_level: 1
                      next_name: Pro Account Monthly Subscription
                      invoice_id: NJ9Fo2OSoM5MRy5ithwnw
                      limits:
                        new_order: 50
                        new_post: 100
                        like: 100
                        max_sessions: 100
                        max_api_tokens: 50
                        max_strategies: 5
                        max_subscriptions: 10
                        max_open_orders: 100
                        max_bots: 0
                      end_date: null
                      updated_at: '2024-10-08T16:30:00.062Z'
                      created_at: '2024-08-30T13:40:27.343Z'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
components:
  parameters:
    api_token:
      in: header
      name: Authorization
      description: User API token.
      required: true
      schema:
        type: string
        format: JWT
  schemas:
    success:
      type: boolean
      description: True when the request succeeded.
    user_id:
      type: string
      description: AlphaInsider user identifier.
    billing_timeframe:
      type: string
      description: Billing period for account or product subscriptions.
      enum:
        - month
        - year
    invoice_id:
      type: string
      description: Invoice identifier, when one exists.
    nullable_end_date:
      type:
        - string
        - 'null'
      format: date-time
      description: End timestamp for the current period or range.
    updated_at:
      type: string
      format: date-time
      description: Last update timestamp.
    created_at:
      type: string
      format: date-time
      description: Creation timestamp.
  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.

````