EmberlyEmberly Docs

Quickstart for Developers

Upload a file from code in five minutes.

This takes you from a new account to uploading from code. If you'd rather use the website, see Getting Started.

1. Create an API Key

  1. Sign in to embrly.ca.
  2. Open Profile → API and create a key. Give it a name you'll recognise, like "Backup script".
  3. Copy the key. It starts with ebk_ and is only shown once.

Keep it secret

An API key can do anything your account can. Don't commit it to a repository or put it in code that runs in a browser. You can revoke it in Profile → API at any time.

2. Upload a File

cURL

curl https://embrly.ca/api/files \
  -H "Authorization: Bearer ebk_..." \
  -F "[email protected]"

JavaScript

const form = new FormData()
form.append('file', file)
 
const res = await fetch('https://embrly.ca/api/files', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.EMBERLY_API_KEY}` },
  body: form,
})
 
const { data } = await res.json()
console.log(data.url)

Python

import os
import requests
 
with open("photo.png", "rb") as f:
    res = requests.post(
        "https://embrly.ca/api/files",
        headers={"Authorization": f"Bearer {os.environ['EMBERLY_API_KEY']}"},
        files={"file": f},
    )
 
print(res.json()["data"]["url"])

PowerShell

$headers = @{ Authorization = "Bearer $env:EMBERLY_API_KEY" }
$res = Invoke-RestMethod -Uri "https://embrly.ca/api/files" `
  -Method Post -Headers $headers -Form @{ file = Get-Item ".\photo.png" }
$res.data.url

3. Use the Response

{
  "success": true,
  "data": {
    "id": "clx9k2m...",
    "url": "https://embrly.ca/aB3dE/photo.png",
    "name": "photo.png",
    "size": 204800,
    "type": "image/png"
  }
}

url is the link to share. Keep id if you want to change or delete the file later.

4. Upload Options

Add these as form fields:

FieldValuesDescription
visibilityPUBLIC (default) or PRIVATEPrivate files are only visible to you.
passwordany textViewers must enter it to open the file.
expiresAtISO 8601 dateDelete the file at this time.
domainone of your verified domainsUse it in the returned link.
curl https://embrly.ca/api/files \
  -H "Authorization: Bearer ebk_..." \
  -F "[email protected]" \
  -F "visibility=PRIVATE" \
  -F "password=s3cret" \
  -F "expiresAt=2026-12-31T23:59:59Z"

5. Large Files

For files close to your upload limit, or anything over a few hundred megabytes, upload in parts so a dropped connection doesn't mean starting again. See Large Files.

Next Steps

On this page