CloudPDF
DocsPricing
Start building

Store validation data

POST/v1/docs/{docId}/layers/{layerName}/signatures/validation-infov3.3.0

Store certificates, OCSP responses and CRLs in the layer's file, so its signatures can be checked with no network.

Each entry is one DER object of at most 16 MiB, base64. An entry the file already holds, byte for byte, is not stored again: `added` counts the new ones. An entry that is not one DER object fails the request and nothing is stored; the error names it, as in `certificates[1]`. The server stores what it is given and asks no certificate authority: collect the answers first. It needs `doc.sign` for the document, not for a group of fields, and is refused after a certification that allows no changes. It cannot be undone, and it leaves undo for earlier changes as it was. Arrived in 3.3.

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 for its own tenant: under /v1/tenants/{tenantId}/ the path tenant must equal the token's tenant_id, and on /v1/docs/{docId} the document must belong to that tenant and the token's scope must hold the operation's document permissions, as a document token does. For servers; browsers get document tokens. Doc-scoped viewer tokens are rejected on every admin route.

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
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.

Idempotency-Keyheaderstring

Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.

Request body#

application/jsonDocSignaturesAddValidationInfoRequestrequired
certificatesstring[]
ocspResponsesstring[]
crlsstring[]

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

{
  "certificates": [
    "certificates"
  ],
  "ocspResponses": [
    "ocspResponses"
  ],
  "crls": [
    "crls"
  ]
}

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({
  token: "<token>",
});

await client.doc.signatures.addValidationInfo({
  docId: "docId",
  layerName: "layerName"
});

Responses#

200OK
application/jsonDocSignaturesAddValidationInfoResponse
addedobject
certificatesinteger
ocspResponsesinteger
crlsinteger
metaMutationMeta
affectedPagesPageRef[]
kind"objectNumber"
objectNumberinteger
cacheDeltaCacheDelta
opIdstring
undoableboolean
missingCharactersstring[]optional
400Bad request
application/jsonErrorResponse
errorEngineError
code"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError"

Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`.

messagestring
detailsobjectoptional

What a code carries besides its message, as each code says.

404Not found
application/jsonErrorResponse
errorEngineError
code"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError"

Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`.

messagestring
detailsobjectoptional

What a code carries besides its message, as each code says.

409Conflict
application/jsonErrorResponse
errorEngineError
code"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError"

Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`.

messagestring
detailsobjectoptional

What a code carries besides its message, as each code says.

defaultError
application/jsonErrorResponse
errorEngineError
code"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError"

Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`.

messagestring
detailsobjectoptional

What a code carries besides its message, as each code says.