1. Sites
uploadthefile API documentation
  • Pages
    • Create a page
      POST
    • Update a page in place
      PUT
    • List pages
      GET
    • Get a page
      GET
    • Rename a page
      PATCH
    • Delete a page
      DELETE
    • Unzip & host a page
      POST
    • List a hosted site's files
      GET
    • Apply a batch of file changes
      POST
    • Replace one file
      PUT
    • Delete one file
      DELETE
    • Get page password state
      GET
    • Set page password
      PUT
    • Remove page password
      DELETE
    • Get page expiry
      GET
    • Set page expiry
      PUT
    • Get email-gate config
      GET
    • Configure email-gate
      PUT
    • Disable email-gate
      DELETE
    • List or export captured emails
      GET
    • Erase captured emails
      DELETE
    • Get page display mode
      GET
    • Set page display mode
      PUT
    • Get PDF chat availability
      GET
    • Enable PDF chat
      PUT
    • Disable PDF chat
      DELETE
    • Bulk delete pages
      POST
  • Short links
    • List short links
    • Create a short link
    • Bulk update short links
    • Get a short link
    • Update a short link
    • Delete a short link
    • Get link click history
  • Domains
    • List custom domains
    • Connect a custom domain
    • Search domain availability
    • Rebind a domain to a different page
    • Disconnect a domain
  • Account
    • Get account, limits, and usage
  • Team
    • List team members
    • Invite a team member
    • Revoke a team member
    • Change a team member's role
    • Resend a pending invite
  • AI connectors
    • Authorization server metadata
    • Protected resource metadata (MCP endpoint)
    • Protected resource metadata (RFC 9728 §3.1 path-insertion form)
    • Register an OAuth client
    • Authorization endpoint (consent screen)
    • Consent decision (internal, not a public integration point)
    • Token endpoint
    • Revocation endpoint
    • MCP endpoint
  • Subjects
    • List subjects
    • Create or get a subject
    • Get a subject
    • Update a subject
    • Delete (tombstone) a subject
  • Subject tokens
    • Mint a subject token
    • Revoke a subject's tokens
  • Sites
    • List a subject's sites
      GET
    • Create a site for a subject
      POST
    • Get a site
      GET
    • Apply a batch of file changes
      PATCH
    • Delete a site
      DELETE
    • List a site's files
      GET
    • Read one file's content
      GET
  • Usage
    • Per-subject usage for a period
  • Webhooks
    • List webhook endpoints
    • Register a webhook endpoint
    • Get a webhook endpoint
    • Update a webhook endpoint
    • Delete a webhook endpoint
    • Rotate an endpoint's signing secret
    • List deliveries (the delivery log)
    • Replay a delivery
    • Poll event history (no endpoint required)
  • Schemas
    • UploadCreateForm
    • PlatformSubject
    • UploadUpdateForm
    • SubjectCreateRequest
    • SubdomainName
    • SubjectPatchRequest
    • RenamePageRequest
    • SubjectMintRequest
    • CreateLinkRequest
    • SubjectEnvelope
    • UpdateLinkRequest
    • SubjectListEnvelope
    • BulkDeletePagesRequest
    • SubjectDeleteEnvelope
    • BulkLinkActionRequest
    • SubjectMintEnvelope
    • ClickPoint
    • SubjectRevokeEnvelope
    • DisplayMode
    • Site
    • SetDisplayModeRequest
    • SiteCreateRequest
    • SetPasswordRequest
    • SitePatchRequest
    • SetEmailGateRequest
    • SiteFile
    • EmailCapture
    • SiteEnvelope
    • ConnectDomainRequest
    • SiteListEnvelope
    • RebindDomainRequest
    • SitePatchEnvelope
    • DomainConnection
    • SiteDeleteEnvelope
    • SiteFilesEnvelope
    • DomainSearchResult
    • UsageSubject
    • SiteFileContentEnvelope
    • LinkCode
    • UsageSubjectsEnvelope
    • ExpiryOption
    • WebhookEventType
    • ApiPage
    • WebhookEndpoint
    • ShortLink
    • WebhookEndpointCreateRequest
    • AccountInfo
    • WebhookEndpointPatchRequest
    • TeamMember
    • WebhookEndpointEnvelope
    • SeatUsage
    • WebhookEndpointSecretEnvelope
    • InviteMemberRequest
    • WebhookEndpointListEnvelope
    • UpdateMemberRoleRequest
    • WebhookEndpointDeleteEnvelope
    • ResendCooldownError
    • WebhookDelivery
    • UploadResult
    • WebhookDeliveryListEnvelope
    • HostResult
    • WebhookReplayEnvelope
    • DeleteResult
    • WebhookEvent
    • UpgradeNudge
    • WebhookEventListEnvelope
    • UploadResultEnvelope
    • Error
    • PageEnvelope
    • PagesListEnvelope
    • HostEnvelope
    • DeleteEnvelope
    • ProjectFile
    • LinkEnvelope
    • ProjectFilesEnvelope
    • LinksListEnvelope
    • AccountEnvelope
    • TeamMembersEnvelope
    • TeamMemberEnvelope
    • RevokeMemberEnvelope
    • BulkAffectedEnvelope
    • BulkDeletedEnvelope
    • PagePasswordStateEnvelope
    • ClickSeriesEnvelope
    • PagePasswordResultEnvelope
    • EmailGateStateEnvelope
    • EmailGateUpdatedEnvelope
    • EmailGateDisabledEnvelope
    • CapturesEnvelope
    • DisplayModeStateEnvelope
    • DisplayModeResultEnvelope
    • DeleteCapturesRequest
    • CapturesDeletedEnvelope
    • DomainConnectionEnvelope
    • DomainDeletedEnvelope
    • ChatAvailabilityEnvelope
    • DomainSearchEnvelope
    • DomainsListEnvelope
    • OAuthError
    • OAuthAuthorizationServerMetadata
    • OAuthProtectedResourceMetadata
    • OAuthClientRegistrationRequest
    • OAuthClientRegistrationResponse
    • OAuthTokenRequest
    • OAuthTokenResponse
  1. Sites

Apply a batch of file changes

PATCH
/sites/{pageId}
Add, replace, or delete files on an EXISTING hosted site, addressed
by its IMMUTABLE pageId (never its public name). Accepts EITHER
multipart/form-data (file parts to put, delete fields naming a
path to remove — the SAME shape the public v1 project-files endpoint
uses) OR application/json: { "changes": [...] }. Refused before
the body is read if the page is moderated, plan-locked, expired, or
its subject is suspended/not in good standing.
Accepts a site of kind site OR kind html — a single HTML page is a
project with a one-entry manifest, stored and served by exactly the
same code as a multi-file site. Any other kind (a downloadable ZIP, a
PDF, an image) has no individually addressable files and is refused
with 400.
An HTML page grows into a site. Committing a change that leaves a
kind: html page holding MORE THAN ONE file promotes it to
kind: site in the same transaction. The promotion is ONE-WAY and
happens IN PLACE: the page id, public name, URL and entry path are all
unchanged, so no link breaks and no redirect is involved. Replacing the
single file of an HTML page is an edit, not an expansion, and leaves it
kind: html. This response body does not report the promotion — read
GET /sites/{pageId} afterwards to observe the new kind.
Requires a declared Content-Length header — refused with 411 if
absent, stricter than the rest of this API (see LengthRequired).

Request

Authorization
API Key
Add parameter in header
x-api-key
Example:
x-api-key: ********************
or
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params

Body Params
application/json
Required

Examples

Responses

🟢200OK
application/json
The committed file listing.
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🟠409
🟠411
🟠413
🟠429
🔴503Service Unavailable
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://upload.tf/api/v1/sites/a1b2c3d4e5' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "changes": [
        {
            "op": "put",
            "path": "string",
            "contentBase64": "string"
        }
    ]
}'
Response Response Example
200 - Example 1
{
    "success": true,
    "data": {
        "files": [
            {
                "path": "string",
                "sizeBytes": 0,
                "contentType": "string",
                "isEntry": true
            }
        ],
        "fileCount": 0,
        "totalBytes": 0
    }
}
Modified at 2026-08-25 00:05:47
Previous
Get a site
Next
Delete a site
Built with