CloudPDF
DocsPricing
Start building

Upload document through the origin

POST/v1/tenants/{tenantId}/documents/{id}/upload-proxyv3.0.0-next.9

Upload a bounded PDF through the API when the initialized transfer kind is proxy.

This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available.

Authentication#

Any one of these credentials is accepted.

API token

The deployment's static root credential (CLOUDPDF_API_AUTH_TOKENS), valid on every surface.

Tenant token

Delegated tenant JWT, valid only under its own /v1/tenants/{tenantId}/ subtree — the path tenant must equal the token's tenant_id. Doc-scoped viewer tokens are rejected on every admin route.

Required scopedocs.create

Parameters#

tenantIdpathstringrequired
idpathstringrequired

Request body#

multipart/form-dataobjectrequired
filestring<binary>required

SDK examples#

The selected SDK is remembered across the API reference. Values are examples; replace them with identifiers and input from your application.

import { CloudPDFClient } from "@cloudpdf/sdk";
import { readFile } from "node:fs/promises";

const client = new CloudPDFClient({
  baseUrl: "https://yourhost.com/path/to/api",
  token: "<token>",
});

await client.documents.uploadProxy({
  file: new Blob([await readFile("document.pdf")], { type: "application/pdf" }),
  tenantId: "tenantId",
  id: "documentId",
});

Responses#

200OK
application/jsonDocumentsUploadProxy200Response
sha256string
400Bad request
application/jsonDocumentsUploadProxy400Response
errorobject
codestring
messagestring
409Conflict
application/jsonDocumentsUploadProxy409Response
errorobject
codestring
messagestring
defaultError
application/jsonAdminErrorPayload
errorobject
codestring
messagestring