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

# Upload a file

> Uploads a file as base64 and optionally links it to users or organisations



## OpenAPI

````yaml /swagger/auth-api.json post /api/v1/{app_id}/files/upload
openapi: 3.0.0
info:
  contact:
    email: support@enad.io
    name: API support
    url: http://enad.io/support
  description: This is the documentation for Auth API v1
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://enad.io/terms/
  title: Public API
  version: '1.0'
servers:
  - url: //customers.enad.io
security: []
paths:
  /api/v1/{app_id}/files/upload:
    post:
      tags:
        - Files
      summary: Upload a file
      description: >-
        Uploads a file as base64 and optionally links it to users or
        organisations
      parameters:
        - description: UUID of the app
          in: path
          name: app_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/internal_pkg_server_domains_files.UploadFileRequest
        description: File upload data
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_models.File
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage
      security:
        - BearerAuth: []
components:
  schemas:
    internal_pkg_server_domains_files.UploadFileRequest:
      properties:
        base64_encoded_image:
          type: string
        custom_fields:
          additionalProperties: {}
          type: object
        filename:
          type: string
        order_reference:
          type: string
        organisation_number:
          type: string
        relationship_ids:
          items:
            type: string
          type: array
      required:
        - base64_encoded_image
      type: object
    github_com_enadhq_koopa-key_internal_pkg_server_models.File:
      properties:
        app_id:
          type: string
        content_type:
          type: string
        created_at:
          type: string
        custom_fields:
          additionalProperties: {}
          type: object
        filename:
          type: string
        id:
          type: string
        updated_at:
          type: string
        url:
          type: string
      type: object
    github_com_enadhq_koopa-key_internal_pkg_server_web.ErrorMessage:
      properties:
        details:
          items:
            type: string
          type: array
        message:
          type: string
        success:
          type: boolean
      type: object

````