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

# initiate file upload

> get a presigned url to upload a file directly to supabase storage. max 50mb. limited to 1gb upload bandwidth per hour.



## OpenAPI

````yaml /api-reference/openapi.json post /file
openapi: 3.1.0
info:
  title: 1px API
  description: minimalistic tools for the web.
  version: 1.0.0
  contact:
    name: 1px
    url: https://1px.ch
servers:
  - url: https://api.1px.ch
    description: production
security:
  - bearerAuth: []
paths:
  /file:
    post:
      summary: initiate file upload
      description: >-
        get a presigned url to upload a file directly to supabase storage. max
        50mb. limited to 1gb upload bandwidth per hour.
      operationId: initiateFileUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: cat.jpg
                size:
                  type: integer
                  example: 12345
                type:
                  type: string
                  example: image/jpeg
              required:
                - name
                - size
                - type
      responses:
        '200':
          description: presigned url generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignedUpload'
        '400':
          description: missing fields, invalid size, or blocked file type
        '401':
          description: missing or invalid api key
        '429':
          description: bandwidth limit exceeded
components:
  schemas:
    PresignedUpload:
      type: object
      properties:
        presignedUrl:
          type: string
        id:
          type: string
          example: abc123
        content:
          type: string
          example: abc123.jpg
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: your 1px api key. get one from /dashboard/api

````