Documentation
Documentation menu

Create a project

Upload a website, document, or collection of files and get a shareable hostname.

POST /v1/upload

Effect. Creates a project and may publish files publicly. With a key and an existing owned domain, it replaces that project’s files. Confirm what the user wants to publish before sending files.

Authentication

Use exactly one header: x-api-key: <key> for an account upload, or x-email: <address> for a temporary preview when the address has no account.

Request

Content-Type: multipart/form-data. Let the HTTP client set the boundary.

Field Type Required Constraints
files Repeated binary part Yes One part per nonempty file, with a filename. For a static ZIP, include a root index.html.
domain String No Hostname only. Omit for an auto-generated name. An existing owned name selects replacement.
settings JSON-encoded string No One multipart text part. See Project settings.
ogImageFile Binary No JPG, JPEG, PNG, GIF, or WebP. Maximum 300 KiB.
logoImageFile Binary No JPG, JPEG, PNG, GIF, or WebP. Maximum 64 × 64 pixels.

Explore Projects for individual workflows, including access control, search indexing, visitor comments, link appearance, and custom domains.

Example

curl --fail-with-body https://ext.tiiny.host/v1/upload \
  -H "x-api-key: $TIINY_API_KEY" \
  -F 'files=@index.html' -F 'files=@styles.css'

Success response

{"success":true,"data":{"link":"example.tiiny.site","status":"active","inPreviewMode":false,"linkPreviewType":"NONE","profile":{"quotaUsed":524288,"projectLimit":5}}}
Field Meaning
data.link Returned hostname. Prefix it with https:// for the live URL.
data.status Account status, when available.
data.inPreviewMode, data.linkPreviewType Whether the link is temporary and why.
data.profile In API-key responses, quotaUsed comes from before the upload. Solo returns projectLimit. Other plans return accountLimit. Email-only responses omit the profile.

The large-upload worker can return {"link":{…},"files":[…]} instead of the usual envelope.

Errors

HTTP Code or condition What to do
400 INVALID_DOMAIN, FILES_REQUIRED, NO_INDEX_FILE Fix the hostname or multipart parts. For an archive, check the returned htmlFileList if present.
400 INVALID_SITE_SETTINGS Inspect the field-level errors array. See Settings reference.
401 Missing key, ineligible email, or unauthorized replacement Check authentication and ownership.
403 Unknown or API-disabled key Check the key and account eligibility.
403 CUSTOM_DOMAIN_NOT_OWNED Connect the domain with POST /v1/custom-domains first. See Custom domains.
413 FILE_SIZE_LIMIT_EXCEEDED, LINK_LIMIT_REACHED, SOLO_UPLOAD_LIMIT_REACHED, PRO_UPLOAD_LIMIT_REACHED, or gateway request cap Check file, storage, and project limits.
429 RATE_LIMIT_EXCEEDED Wait for the daily quota to reset.

After an uncertain result, check Fetch profile before creating again. An automatic retry without a domain can create a duplicate project.

Search documentation