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

# Add file to a matter

> Uploads a new file for the specified matter.



## OpenAPI

````yaml /openapi.json post /matters/{matterId}/documents/files
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /matters/{matterId}/documents/files:
    post:
      tags:
        - Files
      summary: Add file to a matter
      description: Uploads a new file for the specified matter.
      operationId: AddFile
      parameters:
        - name: matterId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AddFileDto'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AddFileDto'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AddFileDto'
        required: true
      responses:
        '202':
          description: When request is accepted. Returns an 'UploadFileInfo' object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileInfo'
        '400':
          description: When an unsupported request is made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    AddFileDto:
      required:
        - fileName
      type: object
      properties:
        fileName:
          maxLength: 256
          minLength: 0
          type: string
          description: Full name of the file including the file extension
          example: court filing.pdf
        folderId:
          type: string
          description: >-
            Unique identifier of the folder to add the file to. If null it will
            be placed in the root folder
          nullable: true
          example: b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2
        userId:
          type: string
          description: >-
            Unique identifier of the file owner. If null it will fallback to the
            authenticated user
          nullable: true
          example: 750eb5c5-ac0b-7d11-4997-e0ce9d8896c8
        folderPath:
          type: string
          description: >-
            Path of the folder to add the file to. If null then the FolderId
            will be used
          nullable: true
          example: Court Filings/2023/January
        fileAdditionalData:
          type: object
          additionalProperties:
            nullable: true
          description: Collection of KeyValuePair(string, string) to update File meta data.
          nullable: true
        dateCreated:
          type: string
          description: >-
            The original datetime that the file was created. If null the current
            datetime will be used
          format: date-time
          nullable: true
          example: '2023-04-23T14:00:00Z'
        dateModified:
          type: string
          description: >-
            The initial datetime that the file was last modified. If null the
            current datetime will be used
          format: date-time
          nullable: true
          example: '2023-04-24T14:00:00Z'
      additionalProperties: false
    UploadFileInfo:
      type: object
      properties:
        fileId:
          type: string
          description: Unique identifier of the file.
          nullable: true
          example: b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2
        uploadUrl:
          type: string
          description: "Temporary Link to upload file.\r\n\r\nImportant note: When uploading to this URL, set the 'Content-Type' header to an empty value.\r\n\r\nExample cURL: curl --location --request PUT 'URL_GOES_HERE' \\ --header 'Content-Type: \"\"' \\ --data '@/C:/dir/test.pdf'"
          nullable: true
          example: ''
        expiry:
          type: string
          description: Expiry date/time when the upload link is no longer accessible.
          format: date-time
          example: '2022-04-23T14:30:00Z'
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````