Commit upload
POST /v1 /tenants /{tenantId} /documents /{id} /commitv3.0.0-next.9
Finish an upload: verify the SHA-256 and promote the document to ready.
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#
application/jsonDocumentsCommitRequestrequiredsha256stringrequiredA complete body with every required field. Strings stand in for your own values.
{
"sha256": "sha256"
}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";
const client = new CloudPDFClient({
baseUrl: "https://yourhost.com/path/to/api",
token: "<token>",
});
await client.documents.commit({
tenantId: "tenantId",
id: "id",
sha256: "sha256"
});Responses#
200OK
application/jsonDocumentsCommit200ResponsedocumentobjectidstringtenantIdstringstate"pending" | "ready" | "failed" | "deleting"baseShastringstorageSizeBytesnumbermetadataobjectidempotencyKeystringfailureReasonstringthumbnailState"pending" | "ready" | "locked" | "failed"optionalthumbnailUrlstringoptionalcreatedAtnumberupdatedAtnumbercreatedBystring400Bad request
application/jsonDocumentsCommit400Responseerrorobjectcodestringmessagestring404Not found
application/jsonDocumentsCommit404ResponseerrorobjectcodestringmessagestringdefaultError
application/jsonAdminErrorPayloaderrorobjectcodestringmessagestring