Files

Upload a base64-encoded file and get a public URL

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.

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

Headers

X-API-Keystring nullable

Request body

filenamestring required

Original filename to store, including extension, e.g. report.pdf.

content_typestring nullable

MIME type for browser/CDN serving. Use application/pdf for PDFs or text/csv for CSV files.

data_base64string nullable

Base64-encoded file bytes. Data URLs are also accepted.

file_base64string nullable

Alias for data_base64, useful when a low-code tool requires a different field name.

datastring nullable

Alias for data_base64, useful when a low-code tool can only send a generic text field.

expires_instring 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.

Example request

{
  "content_type": "application/pdf",
  "data_base64": "JVBERi0xLjQK...",
  "expires_in": "7d",
  "filename": "report.pdf",
  "filename_mode": "download"
}

Response

Successful Response

file_idstring required

Stable FilePost file ID.

urlstring required

Public CDN URL. Anyone with this URL can view/download the file without a FilePost account.

namestring required

Original filename.

sizeinteger required

Decoded file size in bytes.

content_typestring required

Stored MIME type.

expires_atstring nullable

UTC expiry timestamp when the file is temporary; otherwise null.

provisionalboolean

True when email verification is required before the file becomes permanent.

filename_mode'download' | 'public' required

Effective filename visibility mode used for this upload.

Example response

{
  "content_type": "application/pdf",
  "expires_at": "2026-06-24T12:30:00",
  "file_id": "abc123def456",
  "filename_mode": "public",
  "name": "report.pdf",
  "provisional": false,
  "size": 10485760,
  "url": "https://cdn.filepost.dev/file/filepost/uploads/ab/abc123def456/report.pdf"
}

Changes

No recorded changes to this operation across all 1 revision of this API.