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

# Update Stack

> Update stack properties



## OpenAPI

````yaml api-reference/openapi.json post /stack/update
openapi: 3.0.0
info:
  title: Stax API
  version: 1.0.0
  description: API for Stax automated document classifier and trust accounting system
  contact:
    name: Stax.ai
    url: https://stax.ai
servers:
  - url: https://api.stax.ai
    description: Production server
security: []
paths:
  /stack/update:
    post:
      tags:
        - Stack
      summary: Update Stack
      description: Update stack properties
      operationId: stackUpdate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - stackId
                - stackDiff
              properties:
                stackId:
                  $ref: '#/components/schemas/ObjectId'
                stackDiff:
                  type: object
                  description: Fields to update
                  properties:
                    path:
                      type: string
                    restrict:
                      type: boolean
                    access:
                      type: array
                      items:
                        $ref: '#/components/schemas/ObjectId'
                    pinned:
                      type: boolean
                    hideHint:
                      type: boolean
                    enabled:
                      type: boolean
                    keys:
                      type: array
                      items:
                        type: string
                    dataTypes:
                      type: array
                      items:
                        $ref: '#/components/schemas/DataType'
                    rules:
                      $ref: '#/components/schemas/StackRules'
                    trainer:
                      $ref: '#/components/schemas/Trainer'
                    forms:
                      type: array
                      items:
                        $ref: '#/components/schemas/ObjectId'
                    tags:
                      type: array
                      items:
                        type: string
      responses:
        '200':
          description: Stack updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          $ref: '#/components/responses/Error'
      security:
        - cookieAuth: []
        - bearerAuth: []
components:
  schemas:
    ObjectId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: MongoDB ObjectId
    DataType:
      type: object
      properties:
        key:
          type: string
        dataType:
          type: string
          enum:
            - text
            - number
            - date
    StackRules:
      type: object
      properties:
        enabled:
          type: boolean
        match:
          $ref: '#/components/schemas/MatchRules'
    Trainer:
      type: object
      properties:
        manualTrigger:
          type: boolean
        isTraining:
          type: boolean
        lastTrained:
          type: string
          format: date-time
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
      required:
        - success
    MatchRules:
      type: object
      properties:
        mode:
          type: string
          enum:
            - all
            - any
        source:
          type: array
          items:
            type: string
        name:
          type: array
          items:
            type: string
        phrases:
          type: array
          items:
            type: string
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Error message
        authError:
          type: boolean
          description: Indicates if this is an authentication error
      required:
        - success
        - error
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: authToken
      description: Cookie-based authentication using userId and authToken cookies
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Bearer token authentication requires two headers: 1) Authorization
        header with 'Bearer {apiKey}' format, and 2) email header with the
        user's email address for identification.

````