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

# POST /document/attach



## OpenAPI

````yaml /api-reference/trust-accounting/openapi.json post /document/attach
openapi: 3.0.3
info:
  title: Stax API (stack, tpa, document)
  description: >-
    Routes under /stack, /tpa, and /document. Parameters and JSON bodies are
    inferred from Express handlers; multipart and streaming responses are called
    out explicitly. Session auth uses cookies userId + authToken or headers
    x-user-id + x-auth-token; API keys use Authorization.
  version: 1.0.0
servers:
  - url: /
    description: Relative to API host
security: []
tags:
  - name: stack
    description: Stack (workspace) operations
  - name: tpa
    description: Trust plan accounting (TPA)
  - name: document
    description: Document operations
paths:
  /document/attach:
    post:
      tags:
        - document
      summary: POST /document/attach
      operationId: post_document_attach
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: JSON response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
                  key:
                    type: object
                    additionalProperties: true
                additionalProperties: true
        '401':
          description: Not authorized
      security:
        - SessionCookies: []
          UserIdCookie: []
        - ApiKeyAuth: []
components:
  securitySchemes:
    SessionCookies:
      type: apiKey
      in: cookie
      name: authToken
      description: Session token (with userId cookie or x-user-id / x-auth-token headers)
    UserIdCookie:
      type: apiKey
      in: cookie
      name: userId
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: Authorization header (API key flow)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.