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#
tenantIdpathstringrequiredidpathstringrequiredRequest body#
multipart/form-dataobjectrequiredfilestring<binary>requiredSDK 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/jsonDocumentsUploadProxy200Responsesha256string400Bad request
application/jsonDocumentsUploadProxy400Responseerrorobjectcodestringmessagestring409Conflict
application/jsonDocumentsUploadProxy409ResponseerrorobjectcodestringmessagestringdefaultError
application/jsonAdminErrorPayloaderrorobjectcodestringmessagestring