---
title: "Upload a base64-encoded file and get a public URL"
method: POST
path: "/v1/upload/base64"
tags: ["Files"]
---

# Upload a base64-encoded file and get a public URL

`POST /v1/upload/base64`

## Request

- Base URL: `https://filepost.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://filepost.dev/v1/upload/base64`
- Auth: none declared

Upload file bytes as base64 in an application/json body. This is intended for low-code platforms that can produce a base64 string but cannot send multipart/form-data. Authenticate with X-API-Key. The returned URL is public and can be opened without a FilePost account. PDFs served with content_type application/pdf open inline in the browser. Add optional expires_in, such as 30s, 24h, or 7d, to auto-delete the file later. Set filename_mode to download or public to override the account default for this upload.

## Headers

- `X-API-Key` string, nullable

## Request body

- Base64UploadRequest
  - `filename` string, required: Original filename to store, including extension, e.g. report.pdf.
  - `content_type` string, nullable: MIME type for browser/CDN serving. Use application/pdf for PDFs or text/csv for CSV files.
  - `data_base64` string, nullable: Base64-encoded file bytes. Data URLs are also accepted.
  - `file_base64` string, nullable: Alias for data_base64, useful when a low-code tool requires a different field name.
  - `data` string, nullable: Alias for data_base64, useful when a low-code tool can only send a generic text field.
  - `expires_in` string, nullable: Optional auto-delete period. Supports seconds, minutes, hours, or days, e.g. 30s, 15m, 24h, 7d.
  - `filename_mode` 'download' | 'public', nullable: Override the account default for this upload. 'download' keeps the filename out of the URL while preserving it for downloads; 'public' places the filename in the public URL.

## Response `200`

Successful Response

- UploadResponse
  - `file_id` string, required: Stable FilePost file ID.
  - `url` string, required: Public CDN URL. Anyone with this URL can view/download the file without a FilePost account.
  - `name` string, required: Original filename.
  - `size` integer, required: Decoded file size in bytes.
  - `content_type` string, required: Stored MIME type.
  - `expires_at` string, nullable: UTC expiry timestamp when the file is temporary; otherwise null.
  - `provisional` boolean: True when email verification is required before the file becomes permanent.
  - `filename_mode` 'download' | 'public', required: Effective filename visibility mode used for this upload.
  - `quota` QuotaAdvisoryResponse
    - `code` 'monthly_upload_limit_approaching' | 'monthly_upload_limit_reached', required
    - `urgency` 'warning' | 'high' | 'critical' | 'blocked', required
    - `message` string, required
    - `used` integer, required
    - `limit` integer, required
    - `remaining` integer, required
    - `reset_at` string, required
    - `upgrade` QuotaUpgradeResponse
      - `plan` string, required
      - `url` string, required
      - `promotion_code` string, required
      - `offer` string, required
      - `uploads_per_month` integer, required
      - `benefits` QuotaUpgradeBenefitsResponse, required
        - `uploads_per_month` integer, required
        - `additional_uploads_per_month` integer, required
        - `max_file_size_mb` integer, required
        - `additional_file_size_mb` integer, required
        - `storage` string, required
        - `max_intake_links` integer, required
        - `rate_limit` string, required
        - `monthly_price_usd` integer, required
        - `annual_price_usd` integer, required
      - `action` QuotaActionResponse, required
        - `label` string, required
        - `method` 'POST', required
        - `url` string, required
        - `auth_header` 'X-API-Key', required
      - `alternative` QuotaUpgradeAlternativeResponse
        - `plan` string, required
        - `offer` string, required
        - `uploads_per_month` integer, required
        - `action` QuotaActionResponse, required
          - `label` string, required
          - `method` 'POST', required
          - `url` string, required
          - `auth_header` 'X-API-Key', required
    - `next_action` QuotaNextActionResponse
      - `code` string, required
      - `message` string, required
    - `action` QuotaActionResponse
      - `label` string, required
      - `method` 'POST', required
      - `url` string, required
      - `auth_header` 'X-API-Key', required
    - `action_reason` 'lite_trial' | 'paid_upgrade', nullable
    - `action_benefit` string, nullable
  - `conversion` ConversionOfferResponse
    - `code` 'lite_trial_available' | 'lite_trial_active', required
    - `message` string, required
    - `action_url` string, required
    - `action` object, nullable
    - `lite_trial` object, required
  - `journey` JourneyResponse
    - `stage` 'first_value' | 'repeat_value' | 'returning_workflow', required
    - `upload_index` integer, required
    - `workflow_source` string, required
    - `title` string, required
    - `message` string, required
    - `action_label` string, required
    - `action_url` string, required
    - `suggested_tool` string, nullable: Dashboard uploads only: the tool to highlight for repeating this upload.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/filepost/apis/filepost-api.md) · [All operations](https://skmtc.dev/filepost/apis/filepost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/filepost/apis/filepost-api/revisions/8fdf9a6d47ce?raw)
