How to Upload Files and Get Public URLs with One API Call

Published: (April 2, 2026 at 02:50 PM EDT)
1 min read
Source: Dev.to

Source: Dev.to

Quick start

Upload a file and receive a permanent public URL in a single request:

curl -X POST https://filepost.dev/v1/upload \
  -H "X-API-Key: fh_your_key" \
  -F "file=@photo.png"
{
  "url": "https://cdn.filepost.dev/file/filepost/uploads/a1/a1b2c3.png",
  "file_id": "a1b2c3d4e5f6",
  "size": 84210
}

The returned URL is served via Cloudflare CDN and remains permanent.

Example in Python

import requests

r = requests.post(
    "https://filepost.dev/v1/upload",
    headers={"X-API-Key": "fh_your_key"},
    files={"file": open("photo.png", "rb")}
)
print(r.json()["url"])

Example in Node.js

const fs = require('fs');
const FormData = require('form-data');
const fetch = require('node-fetch');

const form = new FormData();
form.append('file', fs.createReadStream('photo.png'));

const res = await fetch('https://filepost.dev/v1/upload', {
  method: 'POST',
  headers: { 'X-API-Key': 'fh_your_key' },
  body: form
});
console.log((await res.json()).url);

API endpoints

  • GET /v1/files – List your files
  • GET /v1/files/{id} – Retrieve file details
  • DELETE /v1/files/{id} – Delete a file

Pricing & limits

  • 30 uploads per month
  • Maximum file size: 50 MB
  • No credit card required – obtain an API key at filepost.dev.
0 views
Back to Blog

Related posts

Read more »