CloudPDF
DocsPricing
Start building

Complete a signature

POST/v1/docs/{docId}/layers/{layerName}/signatures/{signingId}/completev3.0.0-next.15

Install the CMS into the prepared candidate and publish the sealed bytes as the document's next base version.

`cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. Every layer of the document then sits over the new version; refetch the manifest after a completion.

Authentication#

Any one of these credentials is accepted.

API token

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

Document token

Doc-scoped JWT, valid only on the /v1/docs/{docId} subtree it names, gated by the capability scopes it carries (each operation's x-required-capability).

Document capabilitydoc.sign

Parameters#

docIdpathstringrequired
layerNamepathstringrequired
signingIdpathstringrequired
X-Document-Passwordheaderstring

Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

Request body#

application/jsonDocSignaturesCompleteRequestrequired
cmsstringrequired
expectedVersionobjectrequired
baseSha256stringrequired
editsVersionintegerrequired

A complete body with every required field. Strings stand in for your own values.

{
  "cms": "cms",
  "expectedVersion": {
    "baseSha256": "baseSha256",
    "editsVersion": 1
  }
}

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.doc.signatures.complete({
  docId: "docId",
  layerName: "layerName",
  signingId: "signingId",
  cms: "cms",
  expectedVersion: {
    baseSha256: "baseSha256",
    editsVersion: 1
  }
});

Responses#

200OK
application/jsonDocSignaturesComplete200Response
status"completed" | "already-completed"
signatureobject
indexinteger
fieldFormFieldRef
kind =
kind"objectNumber"
objectNumberinteger
fieldNamestring
widgetFormWidget
signedboolean
kind"signature" | "timestamp"
filterstring
subFilterstring
byteRange[integer, integer, integer, integer]
contentsSizeinteger
coverage"whole-revision" | "partial" | "malformed"
revisionIndexinteger
signerobject
namestring
reasonstring
locationstring
contactInfostring
signedAtstring<date-time>
docMdp1 | 2 | 3
catalogCertificationboolean
fieldMdpobject
action"all" | "include" | "exclude"
fieldsstring[]
permission1 | 2 | 3optional
lockobject
seedValueobject
requiredFlagsinteger
presentFlagsinteger
versioninteger
mdp0 | 1 | 2 | 3
filterstring
subFiltersstring[]
digestMethodsstring[]
reasonsstring[]
unsupportedRequiredboolean
versionobject
sha256string
byteLengthinteger
previousobject
baseSha256string
editsVersioninteger
protectionobject
enforced"none" | "lta" | "fill" | "annotate"
judged"none" | "lta" | "fill" | "annotate"
certificationobject
signatureIndexinteger
permission1 | 2 | 3
fieldLocksobject[]
signatureIndexinteger
source"fieldmdp" | "lock"
specobject
action"all" | "include" | "exclude"
fieldsstring[]
permission1 | 2 | 3optional
policyVersioninteger
metaMutationMeta
affectedPagesPageRef[]
kind"objectNumber"
objectNumberinteger
cacheDeltaCacheDelta
opIdstring
undoableboolean
400Bad request
application/jsonDocSignaturesComplete400Response
404Not found
application/jsonDocSignaturesComplete404Response
409Conflict
application/jsonDocSignaturesComplete409Response
defaultError
application/jsonEngineErrorPayload
name"EngineError"
code"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "SharePasswordRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "StaleBase" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused"
messagestring
detailsobjectoptional