Documentation
Documentation menu

Create a project

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

POST /v1/upload

Authentication

Send x-api-key for an account upload or x-email for a temporary preview associated with an address that has no account. Use one of these headers per request.

Request

Content type is multipart/form-data. Let the HTTP client set the multipart boundary.

Field Required Description
files Yes One or more nonempty binary parts. Repeat files for each file and include filenames.
domain No Desired hostname without a scheme or path. Omit to generate a hostname.
settings No A single multipart text field containing a JSON object. See Project settings.
ogImageFile No A link-preview image in JPG, JPEG, PNG, GIF, or WebP, up to 300 KiB.
logoImageFile No A favicon in JPG, JPEG, PNG, GIF, or WebP, up to 64 × 64 pixels.

Side effect. A fresh domain creates a project. With an API key and a domain you already own, this request replaces the existing project’s files. For updates, use Update a project and send the complete file set.

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

200 OK typically includes data.link (the hostname), the account status when available, inPreviewMode, and linkPreviewType. The API-key response includes data.profile.quotaUsed from before the request, plus projectLimit for Solo or accountLimit for other plans. The email-only response omits profile.

{
  "success": true,
  "data": {
    "link": "example.tiiny.site",
    "status": "active",
    "inPreviewMode": false,
    "linkPreviewType": "NONE",
    "profile": { "quotaUsed": 524288, "projectLimit": 5 }
  }
}

Large uploads handled by a background worker can return { "link": {...}, "files": [...] } instead of the standard envelope.

Errors

  • 400 with INVALID_DOMAIN, FILES_REQUIRED, or NO_INDEX_FILE. When the response includes htmlFileList, check your ZIP entry point.
  • 401 if authentication is missing or the email-only flow is unavailable for the address.
  • 403 if the API key is unknown or has API access disabled, or with CUSTOM_DOMAIN_NOT_OWNED when domain is on a custom domain that is not connected to your account. See Custom domains.
  • 413 when a file, request, project count, or storage limit is reached.
  • 429 with RATE_LIMIT_EXCEEDED when the key’s daily limit is reached.

See Errors and limits for recovery steps.

Search documentation