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

# Create File

> Create a new file.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json post /orgs/{org_id}/files
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/files:
    post:
      tags:
        - Orgs Files
      summary: Create File
      description: Create a new file.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the org
          name: org_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateFileSchema'
                - type: object
                  properties:
                    visibility:
                      $ref: '#/components/schemas/FileVisibilitySchema'
              description: CreateOrgFileSchema
          multipart/form-data:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateFileSchema'
                - type: object
                  properties:
                    visibility:
                      $ref: '#/components/schemas/FileVisibilitySchema'
              description: CreateOrgFileSchema
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSchema'
components:
  schemas:
    CreateFileSchema:
      type: object
      properties:
        file:
          anyOf:
            - type: string
              format: binary
            - $ref: '#/components/schemas/FileDataSchema'
            - type: string
          description: >-
            File to be uploaded. It can be a file object, a base64 encoded
            string, or a file data object containing base64 data, name, and
            type.
        file_url:
          type: string
          description: URL of the file to be uploaded
          example: https://example.com/files/document.pdf
        allowed_types:
          $ref: '#/components/schemas/FileAllowedTypesSchema'
    FileVisibilitySchema:
      type: string
      enum:
        - PUBLIC
        - PRIVATE
      description: >-
        Whether the file is private or public, private files URLs are signed
        with a token and can be accessed temporarily
      example: PRIVATE
    FileSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the file
        file_path:
          type: string
          maxLength: 2048
          description: Path to the file in the storage system
        file_filename:
          type: string
          maxLength: 255
          description: Name of the file
          example: document.pdf
        file_size:
          type: number
          description: Size of the file in bytes
          example: 1024
        file_mimetype:
          type: string
          maxLength: 255
          description: MIME type of the file
          example: application/pdf
        file_url:
          type: string
          maxLength: 2048
          description: URL to access the file
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the file was created
      required:
        - id
        - file_path
        - file_filename
        - file_size
        - file_mimetype
        - file_url
        - created_at
      description: Detailed information about a file
    FileDataSchema:
      type: object
      properties:
        data:
          type: string
          description: URL, Raw or Base64 encoded file data.
          example: SGVsbG8sIHdvcmxkIQ==
        type:
          type: string
          maxLength: 128
          description: Mime type of the file, if not provided it will be inferred.
          example: application/pdf
        name:
          type: string
          minLength: 1
          description: Name of the file.
          example: document.pdf
        encoding:
          type: string
          enum:
            - base64
            - raw
          description: >-
            Encoding of the file data when it's a direct input, by default
            base64 is expected.
          example: base64
      required:
        - data
      description: Data payload for creating a file
    FileAllowedTypesSchema:
      type: array
      items:
        type: string
        maxLength: 255
      maxItems: 255
      default:
        - '*/*'
      description: >-
        The allowed mime types for the file field (e.g. image/*,
        application/pdf)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````