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

# Upload an attachment

> Upload a new file attachment (e.g. a receipt)



## OpenAPI

````yaml https://dev.hurdlr.com/rest/v1/devUtils/documentation?version=5&Authorization=dexfeE6aRK3zwXP4ku5aWm8w&env=sandbox post /v5/files/upload/{entity}
openapi: 3.0.1
info:
  title: Tight API
  contact:
    name: Hurdlr, Inc. (dba Tight)
    url: https://www.tight.com
    email: api@tight.com
  version: 6.0.0
servers:
  - url: https://sandbox.hurdlr.com/rest
    description: Staging Environment
  - url: https://prod.hurdlr.com/rest
    description: Production Environment
security:
  - accessTokenSecurity: []
  - basicSecurity: []
tags:
  - name: Authentication
  - name: Banks
  - name: Business & Client Management
  - name: Invoicing
  - name: Revenue
  - name: Investments
  - name: Payouts
  - name: Bills
  - name: Expenses
  - name: Payroll
  - name: Reports
  - name: Accounting
  - name: Mileage
  - name: Taxes
  - name: Time Tracking
  - name: Imports
  - name: Files
  - name: Accountant
  - name: Audit Trail
  - name: Support
  - name: Tax Engine Express
  - name: Interview Endpoint
  - name: Ledgering
  - name: Configuration
  - name: Templates
paths:
  /v5/files/upload/{entity}:
    post:
      tags:
        - Files
      summary: Upload an attachment
      description: Upload a new file attachment (e.g. a receipt)
      operationId: uploadAttachment
      parameters:
        - name: file
          in: query
          description: File to be uploaded
          required: true
          schema:
            type: string
            format: binary
        - name: entityId
          in: query
          description: Id of the entity to which this attachment belongs
          schema:
            type: number
        - name: caption
          in: query
          description: Caption for the attachment, especially useful for images
          required: true
          schema:
            type: string
        - name: date
          in: query
          description: >-
            Date of the attachment (e.g. if attachment is a receipt, optionally
            provide the receipt date)
          schema:
            type: string
        - name: amount
          in: query
          description: >-
            The dollar amount associated with the attachment (e.g. if attachment
            is a receipt, optionally provide the total cost on the receipt)
          schema:
            type: string
        - name: entity
          in: path
          description: The Tight entity to which this attachment belongs
          required: true
          schema:
            pattern: .+
            type: string
            enum:
              - bankTransfer
              - business
              - closing
              - company
              - expense
              - invoice
              - invoicePayment
              - revenue
              - taxPayment
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUploadRetValV5'
      security:
        - accessTokenSecurity: []
components:
  schemas:
    AttachmentUploadRetValV5:
      type: object
      properties:
        result:
          type: string
          enum:
            - SUCCESS
            - FAILURE_CLOUDSTORAGE_NOT_SETUP
            - FAILURE_UPLOAD_ERROR
            - MASTER_SUCCESS_PERSONAL_FAILURE_UPLOAD_ERROR
            - FAILURE_NO_DATA
            - FAILURE_TOKEN_INVALIDATED
            - FAILURE_EMAIL_TOKEN_INVALIDATED
            - FAILURE_UNKNOWN_ERROR
            - FAILURE_USER_OVER_QUOTA
            - FAILURE_VALIDATION_ERROR
        attachment:
          $ref: '#/components/schemas/AttachmentDTOV5'
    AttachmentDTOV5:
      type: object
      properties:
        type:
          type: string
          description: Type of the attachment
          readOnly: true
          example: FILE
          enum:
            - PICTURE
            - FILE
            - VOICE
            - INVOICE
        id:
          type: integer
          description: Id of the attachment, required when updating an existing attachment
          format: int64
        caption:
          type: string
          description: Caption of the attachment
        publicFileUrl:
          type: string
          description: URL at which the attachment is located
          readOnly: true
        date:
          type: string
          description: Date of the attachment
          format: date-time
        amount:
          type: number
          description: Amount of the attachment
        entity:
          type: string
          description: The Tight entity to which this attachment belongs
        fileName:
          type: string
        entityId:
          type: integer
          description: Id of the entity to which this attachment belongs
          format: int64
        fileSize:
          type: string
          description: File size of attachment
          example: 24 KB
        iconUrl:
          type: string
          description: Icon URL based on file extension
          example: https://cdn.sandbox.tight.com/icons/attachments/pdf.svg
  securitySchemes:
    accessTokenSecurity:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: /auth/account
          scopes:
            write: ''

````