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

# Prepare file upload(s)

> Creates presigned URLs for one or more file uploads to Filejar storage. Processes multiple files in parallel. Requires API key authentication.



## OpenAPI

````yaml api-reference/openapi.json post /v1/upload/prepare
openapi: 3.0.0
info:
  title: FileJar Core API
  version: 1.0.0
  description: >-
    API documentation for FileJar Core API - File upload and organization
    management
servers:
  - url: http://localhost:8787
    description: Local development server
  - url: https://core-api.filejar.dev
    description: Production server
security: []
tags:
  - name: Health
    description: Health check endpoints
  - name: Upload
    description: File upload endpoints
  - name: Files
    description: File retrieval and management endpoints
paths:
  /v1/upload/prepare:
    post:
      tags:
        - Upload
      summary: Prepare file upload(s)
      description: >-
        Creates presigned URLs for one or more file uploads to Filejar storage.
        Processes multiple files in parallel. Requires API key authentication.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: Array of files to prepare for upload
              items:
                type: object
                properties:
                  file_name:
                    type: string
                    minLength: 1
                    maxLength: 255
                    description: >-
                      Optional file name. If not provided, a random UUID will be
                      used.
                    example: my-file.pdf
              example:
                - file_name: document1.pdf
                - file_name: image1.jpg
                - {}
      responses:
        '200':
          description: Upload preparation successful
          content:
            application/json:
              schema:
                type: array
                description: Array of prepared uploads
                items:
                  type: object
                  properties:
                    key:
                      type: string
                      description: File key/path in storage
                      example: org-id/filename.pdf
                    signed_url:
                      type: string
                      format: uri
                      description: >-
                        Proxy URL for uploading files through the API (PUT
                        request to /v1/files/{key})
                      example: >-
                        https://core-api.filejar-dev.workers.dev/v1/files/org-id/filename.pdf
                    upload_id:
                      type: string
                      format: uuid
                      description: Unique identifier for this upload
                  required:
                    - key
                    - signed_url
                    - upload_id
                example:
                  - key: org-id/document1.pdf
                    signed_url: >-
                      https://core-api.filejar-dev.workers.dev/v1/files/org-id/document1.pdf
                    upload_id: 123e4567-e89b-12d3-a456-426614174000
                  - key: org-id/image1.jpg
                    signed_url: >-
                      https://core-api.filejar-dev.workers.dev/v1/files/org-id/image1.jpg
                    upload_id: 223e4567-e89b-12d3-a456-426614174001
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Validation failed
                  fields:
                    type: object
                    description: Field-specific validation errors
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: API key required
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Organization not found
        '429':
          description: Too many requests - Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Too many requests, please try again later
                  retryAfter:
                    type: number
                    description: Seconds to wait before retrying
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Internal server error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: WorkOS API key for authentication

````