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

# Generate presigned upload URL

> Generate a presigned URL for client to upload a document directly to GCS



## OpenAPI

````yaml /api-reference/preview.json post /organizations/{organization_id}/employees/{employee_id}/documents/upload
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /organizations/{organization_id}/employees/{employee_id}/documents/upload:
    post:
      tags:
        - Core
        - Documents
      summary: Generate presigned upload URL
      description: Generate a presigned URL for client to upload a document directly to GCS
      operationId: >-
        generate_upload_url_organizations__organization_id__employees__employee_id__documents_upload_post
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
              - type: string
                format: uuid
            title: Organization Id
        - name: employee_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
              - type: string
                format: uuid
            title: Employee Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentUploadRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerToken: []
components:
  schemas:
    DocumentUploadRequest:
      properties:
        document_type:
          $ref: '#/components/schemas/DocumentType'
        document_name:
          type: string
          title: Document Name
          description: User-friendly document name
          examples:
            - Payslip May 2025
            - Work Permit 2025
        document_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Document Date
          description: The period/date this document represents (e.g., payroll month)
        file_size_bytes:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: File Size Bytes
          description: Expected file size in bytes (for validation)
      additionalProperties: true
      type: object
      required:
        - document_type
        - document_name
      title: DocumentUploadRequest
      description: Request schema for generating presigned upload URL.
    DocumentUploadResponse:
      properties:
        upload_url:
          type: string
          title: Upload Url
          description: Presigned URL for uploading the document
        document_id:
          type: string
          title: Document Id
          description: Document ID
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: When the presigned URL expires
      additionalProperties: true
      type: object
      required:
        - upload_url
        - document_id
        - expires_at
      title: DocumentUploadResponse
      description: Response schema for presigned upload URL.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentType:
      type: string
      enum:
        - payslip
        - contract
        - work_permit
        - id_document
        - proof_of_address
        - org_logo
        - uk_bacs_file
        - uk_bacs_file_csv
        - other
      title: DocumentType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerToken:
      type: oauth2
      flows:
        password:
          scopes:
            read:all: Read all
            write:all: Write all
            read:health_check: Read health check
            write:health_check: Write health check
            read:wage_types: Read wage types
            write:wage_types: Write wage types
          tokenUrl: >-
            https://auth-preview.intermezzo.ai/authorize?audience=api-preview.intermezzo.ai

````