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

# Upload and add file attachment to room

> Upload a file and add it as an attachment to a room. The file will be uploaded to storage and added to the default materials group. Maximum file size is 2 GB. Use multipart/form-data with fields: roomId, name, and file (binary). Authenticate using Bearer token with your Noux API key. Example: curl -X POST ... -H "Authorization: Bearer KEY" -F roomId=ROOM_ID -F name="My file" -F file=@/path/to/document.pdf — note the @ before the file path, and do not set Content-Type manually (curl adds the boundary).



## OpenAPI

````yaml /openapi.json post /api/v1/room/attachment/file
openapi: 3.0.0
info:
  title: Noux REST API
  version: 1.0.0
  description: This page contains the standard OpenAPI specification for the Noux REST API.
  contact:
    name: Noux Digital Oy
    url: https://nouxdigital.com/
servers:
  - url: https://api.noux.app
    description: Production API
  - url: http://localhost:4000
    description: Local development
security: []
paths:
  /api/v1/room/attachment/file:
    post:
      tags:
        - Rooms
      summary: Upload and add file attachment to room
      description: >-
        Upload a file and add it as an attachment to a room. The file will be
        uploaded to storage and added to the default materials group. Maximum
        file size is 2 GB. Use multipart/form-data with fields: roomId, name,
        and file (binary). Authenticate using Bearer token with your Noux API
        key. Example: curl -X POST ... -H "Authorization: Bearer KEY" -F
        roomId=ROOM_ID -F name="My file" -F file=@/path/to/document.pdf — note
        the @ before the file path, and do not set Content-Type manually (curl
        adds the boundary).
      parameters:
        - schema:
            type: string
            description: Bearer token with Noux API key
          required: true
          description: Bearer token with Noux API key
          name: authorization
          in: header
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                roomId:
                  type: string
                  description: Room ID to add attachment to
                name:
                  type: string
                  description: Name of the attachment, visible in the room UI
                file:
                  type: string
                  description: File to upload (required)
                  format: binary
              required:
                - roomId
                - name
                - file
      responses:
        '200':
          description: Attachment added successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachmentId:
                    type: string
                    description: The created attachment ID
                required:
                  - attachmentId
        '400':
          description: Bad request - invalid input, room not found, or file too large
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                    enum:
                      - true
                    description: Indicates this is an error response
                  code:
                    type: string
                    enum:
                      - PARSE_ERROR
                      - BAD_REQUEST
                      - INTERNAL_SERVER_ERROR
                      - NOT_IMPLEMENTED
                      - METHOD_NOT_SUPPORTED
                      - TIMEOUT
                      - CONFLICT
                      - PRECONDITION_FAILED
                      - PAYLOAD_TOO_LARGE
                      - UNPROCESSABLE_CONTENT
                      - TOO_MANY_REQUESTS
                      - CLIENT_CLOSED_REQUEST
                      - INVALID_INPUT
                      - UNAUTHORIZED
                      - NOT_FOUND
                      - FORBIDDEN
                      - INVALID_STATE
                      - SERVER_ERROR
                    description: Error code for programmatic handling
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - code
                  - message
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                    enum:
                      - true
                    description: Indicates this is an error response
                  code:
                    type: string
                    enum:
                      - PARSE_ERROR
                      - BAD_REQUEST
                      - INTERNAL_SERVER_ERROR
                      - NOT_IMPLEMENTED
                      - METHOD_NOT_SUPPORTED
                      - TIMEOUT
                      - CONFLICT
                      - PRECONDITION_FAILED
                      - PAYLOAD_TOO_LARGE
                      - UNPROCESSABLE_CONTENT
                      - TOO_MANY_REQUESTS
                      - CLIENT_CLOSED_REQUEST
                      - INVALID_INPUT
                      - UNAUTHORIZED
                      - NOT_FOUND
                      - FORBIDDEN
                      - INVALID_STATE
                      - SERVER_ERROR
                    description: Error code for programmatic handling
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - code
                  - message
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Noux API key from your integration settings

````